Open ferrao opened 5 years ago
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
I'm referring to my own code @malob , not some external project dependency. And all my code is plain JavaScript.
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
andjsconfig.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.