Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tern Autocomplete with Express

I'm using the tern_for_vim plugin for developing node applications. Currently various functions aren't displaying and I'm unsure why. For example: none of the html verb functions appear in the autocompletion list app.get (after assigning var app = express()) however app.listen does and I'm unsure why. I have searched around but can't find anywhere documenting usage of tern with express. Does anyone have a solution?

I have the following configuration file:

.tern-project:

{
  "libs": [
    "browser",
    "jquery",
    "express"
  ],
  "plugins": {
    "node" : {}
  }
}
like image 966
tjenks Avatar asked Feb 14 '26 05:02

tjenks


1 Answers

libs declaration is used for tern JSON type definitions. Today it doesn't exists express tern JSON type definitions, that's why you cannot use it inside your .tern-project

I have created and initialized tern-express project to support express with tern. Any contribution are welcome!

like image 159
Angelo Avatar answered Feb 17 '26 18:02

Angelo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!