How to make work TernJS with project files?

360 Views Asked by At

I got a node/express/mongoose etc.. project following a MVC folder structure. I'm using VIM 7.4

I got already working autocompletion with TernJS and YouCompleteMe, but what I don't figure out, is how to autocomplete code from other project files into the current file.

i.e When editing server.js, I would like to get autocompletion from user.server.model.js instead of remember or open it in a tab to take a look at the code inside.

I know there is something to do with a .tern-project file, but I can't make it work.

This is my .tern-project:

{
  "libs": [
    "browser",
    "jquery"
  ],
  "loadEagerly": [],
  "plugins": {
    "node": {}
  }
}

... and this is my working directory from I need to get all that code completion wherever file I'm editing:

.
├── app
│   ├── controllers
│   ├── models
│   ├── routes
│   └── views
├── config
│   ├── config.js
│   ├── env
│   ├── express.js
│   ├── mongoose.js
│   ├── passport.js
│   └── strategies
├── node_modules
├── package.json
├── public
│   ├── css
│   ├── img
│   └── js
└── server.js
0

There are 0 best solutions below