Autocomplete feature for Atom editor custom node js modules

2.2k views Asked by At

I have installed Ternjs package which is for providing autocompleting feature for javascript in Atom editor. Also enabled this in my project via Packages -> Atom Ternjs -> Configure Project.

did a Restart Server.

Basic node js module code are displayed based on autocompleting feature when I type code in the text editor, whereas third party nodejs module's code such express, mongodb not suggested

.tern-project

{
  "ecmaVersion": 6,
  "libs": [],
  "loadEagerly": [],
  "dontLoad": [
    "node_modules/**"
  ],
  "plugins": {
    "doc_comment": true,
    "node": {
      "dontLoad": "",
      "load": "",
      "modules": ""
    },
    "angular": {}
  }
}

Below screenshot shows that autocomplete works for inbuilt modules of node js. I have used filesystem module enter image description here

Below screenshot show that autocomplete not working for express module (3rd party) of node js platform. enter image description here

Much appreciated any help to resolve issue in Atom Ternjs package.

2

There are 2 answers

0
Sriram M On

After amended line dontLoad: []. It worked fine.

.tern-project

{
  "ecmaVersion": 6,
  "libs": [],
  "loadEagerly": [],
  "plugins": {
    "doc_comment": true,
    "node": {
      "dontLoad": "",
      "load": "",
      "modules": ""
    },
    "angular": {}
  },
  "dontLoad": []
}

latest file that worked well.

0
TechDogLover OR kiaNasirzadeh On

it is extemly suggested to check "browser" under "libs" as shown: enter image description here enter image description here