4

I have just installed auto-complete layer in spacemacs. I've done as follows:

  • added the auto-completion layer to dotspacemacs/layers ()
  • added the javascript layer with the following variables:

    1. javascript-disable-tern-port-files nil

    2. tern-command '("node" "C:/Users/cristi/AppData/Roaming/npm/node_modules/tern/bin/tern"

  • installed tern with npm install -g tern
  • in dotspacemacs/user-config I added:

    1. (setq tern-command '("node" "C:/Users/cristi/AppData/Roaming/npm/node_modules/tern/bin/tern")

I dont know what else I could try.

(defun dotspacemacs/layers ()
    (setq-default
        dotspacemacs-configuration-layers
        ' (javascript :variables
                 javascript-disable-tern-port-files nil
                 tern-command '("node" "C:/Users/cristi/AppData/Roaming/npm/node_modules/tern/bin/tern"
    )
        (auto-completion :variables
                      auto-completion-enable-sort-by-usage t
                      auto-completion-enable-help-tooltip t
                      auto-completion-enable-snippets-in-popup t)
)


(defun dotspacemacs/user-config ()
    (setq tern-command '("node" "C:/Users/cristi/AppData/Roaming/npm/node_modules/tern/bin/tern"))
)

Autocompletion only works for things that I have allready defined in my .js file, such as the properties and methods of an object, but it doesn't autocomplete or shows hints for things like document.getElementById, or querySelector and all that stuff.

code_dude
  • 951
  • 2
  • 15
  • 28

0 Answers0