Customizing ternjs for sublime text 3

234 views Asked by At

I've installed tern_for_sublime for sublime text 3 following steps in github readme page of the project and autocomplete for core javascript functions like string functions are working.But browser DOM specific autocompletion is not available.I was intimated that for vim in the .tern-project file the following config must be done for DOM and jquery auto-completion:

{
  "libs": [
       "browser",
       "jquery"
  ]
}

Even though I added the json the autocomplete isn't showing DOM Auto completion.So what should I add?

1

There are 1 answers

0
socket_var On BEST ANSWER

I solved this by adding .tern-config file at the root of my user directory as I needed the configuration globally which in my case is C:/Users/my-name containing the JSON defining the triggers as follows:

{
  "libs": [
     "browser",
     "jquery",
     "ecmascript"                //for both es5 and es6 :)
  ]
}

If you don't need the above settings globally but you only need it for your project itself you can add the above JSON in a .tern-project file at the root of your project..!!