Problem
I'm currently trying to build a 3D web app based on three.js.
I'm using neovim as my development environment and YouCompleteMe as a completion system.
I installed tern to complete JS, and I added .tern-project file like this.
{
"libs": [
"browser",
"ecmascript",
],
"loadEagerly": [
],
"plugins": {
"threejs": {}
}
}
I also copied threejs.js and threejs.json to my project's directory generated by tern-threejs.
However, YouCompleteMe doesn't show semantic completion compared to tern-threejs's demo codemirror
Comparison:
codemirror:
neovim:
Note: I can't see any completion at all.
What seems to be the problem?


threejs.jsis a tern plugin file andthreejs.jsonis a tern library file. plugin files should be copied intern/plugindirectory and library files needs to be placed withintern/defsdirectory. These two directory exists within tern directory.With 'YouCompleteMe' installed this dir path is:
~/.vim/YouCompleteMe/third_party/ycmd/third_party/tern-runtime/node_modules/tern. You only need to copy one of aforementioned files. Plugin file or lib file; and update your.tern-projectfile accordingly. so:First ensure that you have enabled the Tern completer on YouCompleteMe. For example on my Mac, I had to run the following:
See YouCompleteMe installation guide for details on how to do it on other environments.
Copy
threejs.jsthen navigate toand paste.
Update your project's
.tern-projectfile as follows:Note that i've also included
es_modulesplugin (which is a plugin shipped with tern itself) as you are using ES6 module pattern system.