Code completion in Node project
ferrao opened this issue · 2 comments
I have been scratching my head for a while on how to get code completion to work with a NodeJS project. All my node projects set NODE_PATH=src:..
This is the best way that I found to avoid things like:
const myModule = require('../../../../some-other-module');
I can now simply do :
const myModule = require('some-other-module');
But code completion does not work at all. Typing myModule. reveals lots of wrong stuff, nothing related to the module contents.
Any pointers on how to properly configure the language server? I have tried all settings.json and jsconfig.json snippets I have found, always without success. I have navigated through many web pages and tried all sorts of configurations, but the result is always the same.
Pretty sure completions for javascript files are dependent on type information, and so you'll need to install the types for the modules your working with. Try npm install --save-dev @types/node.
You can search for type definition packages here: http://definitelytyped.org