简体   繁体   中英

Autocomplete feature for Atom editor custom node js modules

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在此处输入图片说明

Below screenshot show that autocomplete not working for express module (3rd party) of node js platform. 在此处输入图片说明

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

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.

it is extemly suggested to check "browser" under "libs" as shown: 在此处输入图片说明 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM