Open olalonde opened 8 years ago
Intriguing, what's your environment?
I have a node project, and this
// .tern-project.js
{
"plugins": {
"node": {}
}
}
was sufficient to get autocomplete and type hints in the Vim plugin.
A .tern-project file like:
{ "plugins": { "es_modules": {} }, "libs": [ "ecma5", "ecma6" ], "ecmaVersion": 6 }
should get you up and running.
Weird, that works when I put .tern-project
in my project root but it doesn't work it in ~/.tern-config
Can you provide the content of your .tern-project
and .tern-config
in both working an non-working state, and describe what exactly doesn't work? The two files should be interpreted in pretty much the same way.
my (global) ~/.tern-config
looks like this:
{
"plugins": {
"node": {}
}
}
I did it to squash the error messages in vim for the stray javascript file where a .tern-project is not defined. It seems to work.
I, too, would like to see some examples.
I cannot believe there are no examples for the global tern-config. I cannot get youcompleteme working without a default config. I write very little JS, and only need basic completion of ES5 and if I need something more specific I can begin to explore project specific files, but it would be ideal if tern shipped a good example ~/.tern-config
so I can know where to even begin.
My current ~/.tern-config
is:
{
"plugins": {
"node": {},
"es_modules": {}
},
"libs": [
"ecma5",
"ecma6"
],
"ecmaVersion": 6
}
Not sure exactly what it does but once in a while I get smart auto completion in Vim :D
@olalonde FTR the best example I have found so far is from a TernJS plugin for Atom: https://atom.io/packages/atom-ternjs
This SO answer also helped me understand this file a little more. https://stackoverflow.com/a/41377689/1253966
This is the base ~/.tern-config
I'm using for my VIM.
{
"libs": [
"browser",
"jquery",
"react"
],
"plugins": {
"angular": {},
"doc_comment": null,
"es_modules": {},
"node": {}
},
"dontLoad": [
"node_modules/**"
]
}
I work in react, angular mainly so the above works well for me.
How would the config be if you want to import the RxJs library ?
It would be nice to have a list of sample
.tern-config
files for different setups. I've been reading the docs for a while and still can't figure out how to get autocompletion to work on imported modules.