Reputation: 456
I'm struggling to get WebStorm Code Completion working and haven't been able to figure it out. I've been all over the forums and have tried everything suggested and would love some help.
After struggling for several hours, I decided to open up a fresh project in hopes of isolating the issue. Surprisingly, I couldn't even get that to work. I fired up a brand new, empty Node folder and added a index.js with the following code:
var ReadableStream = require('stream').Readable;
var pr = require('process');
let Joi = require('joi');
var rs = new ReadableStream();
Joi.object().keys ({
count: Joi.number().integer().required().description('')
})
I am NOT getting code completion for either the Joi object, the pr object, or the rs object. Note that I AM getting code completion properly in Visual Studio Code.
Here's what I've done already:
npm install joi
, npm install process
, and npm install stream
and verified their presence in package.json
...I'm running WebStorm 2018.2.
Can someone help me here?
Upvotes: 4
Views: 771
Reputation: 93738
Put cursor on 'joi'
in require('joi')
, hit Alt+Enter
, choose to install Typescript definitions for better completion:
Do the same for process
.
This should do the thing:
And this is just what VSCode actually does
Upvotes: 4