How to enable npm modules auto-suggestion in require() ?

Previously, in webstorm 10,

while I type

var something = require('xx');

webstorm will auto-suggest the npm module installed for me to choose.
To enable this :

1. Languages & Framworks -> Javascript
2. Switch Javascript language version to JSX Harmony

Now, it's gone in WebStorm 11
So, anyone can help to find this feature back?


P.S. I start to use WebStorm since version 6. WebStorm customer service suck, so I do not want to upgrade.
and almost everytime, their upgrade suck!! frustrated since WebStorm 9. I am sorry I want to say so.
WebStorm is still the best IDE tool in js, but I really hope someone to replace them.
Almost every upgrade, they will do something stupid like windows.

19 comments
Comment actions Permalink

works for me - see screenshot:

require.png
Note that you need to hit Ctrl+space to get the completion.

And what's wrong with WebStorm customer service? :)

0
Comment actions Permalink

doesn't work for me, I am using mac

0
Comment actions Permalink

OS doesn't matter; please make sure you have NodeJS plugin installed and enabled


0
Comment actions Permalink

yes. Node.js plugin is enabled. I am a Node.js coder.

0
Comment actions Permalink

Please try invalidating caches (File/Invalidate caches, restart). If the problem persists, please provide a project that shows up the issue

0
Comment actions Permalink

tried, still doesn't work.

It's easy. any simple project doesn't work. e.g.


var fs = require('');

try:

cmd + space : it will switch the input source. Even only en input source, it still doesn' work.

ctrl + space : it will open the mac spotlight feature

ctrl + space + shift: webstorm show 'No suggestions'

Mac 10.9.5, webstorm 11,

1
Comment actions Permalink

ok:)
- File/New project, empty project, added file app.js
- enabled 'Node.js Core' library in Settings/Languages & Frameworks/Node.js and NPM
- entered

var fs = require('')


Result:

require.png

0
Comment actions Permalink

please hit Ctrl+space within '' in require() - what is the result? Attach a screenshot

0
Comment actions Permalink

Attached pleaes find the result. -- it will trigger Mac spotlight feature.

ctrl + space is a hot key in Mac to trigger spotlight feature ( If I am correct, it's for non-English mac )



Attachment(s):
webstorm-ctrl-space-result.jpg
0
Comment actions Permalink

Please try assigning a different shortcut to Main menu/Code/Completion/Basic action in Preferences/Keymap

0
Comment actions Permalink
ctrl + space is a hot key in Mac to trigger spotlight feature ( If I am correct, it's for non-English mac )


Use whatever shortcut you have got there for "Code | Completion | Basic"

0
Comment actions Permalink

Hi, I've disabled ctrl + spacebar hot key in Mac.

Then, webstorm basic code completion works.
Thanks for your help. However, I'll go back to WebStorm 10, because this is a down-grade of code completion,
because in Webstorm 10, I simply type the first letter, the suggested modules list will show immediately.
now, I have to click ctrl + spacebar, and disable Mac spotlight feature.

Or any way to fix it?

0
Comment actions Permalink

This is not the only place where you have to invoke completion explicitly - it doesn't auto-popup everywhere to not get into user's way. But, well, if downgrading is better that re-assigning a shortcut (that was the same in all previous versions), please feel free to downgrade

0
Comment actions Permalink

Thanks a lot !! :)

I've changed the basic completion hot key to option + space and try to get used to it to play around WebStorm 11,
because I've refused to upgrade for a long while, till the end I've found I have to upgrade because I need some new features, e.g. jsx support. haha :)

Or I'll down grade back to Webstorm 10 and wait till WebStorm introduce some new features which force me to upgrade.

Thank you again for your patience and awesom help!! :)

0
Comment actions Permalink

I am VERY disappointed about webstorm 11 !!!

I've reverted back to WebStorm 10, guess what??
Now, it will not auto-complete Node.js core module in require, such as 'fs', 'path'...etc.

I apologized that I am wrong, I should learn it while I upgrade webstorm from 8 to 9.
Again, a terrible nightmare !!!

I can see webstorm now only want to add something new , fancy to attract newbie.
I am sorry I am not es6 fan, and I just want to code Node.js.

The most stupid version of Webstorm I have ever seen since Webstorm 6.

0
Comment actions Permalink

Sorry, what's wrong? Didn't we discussed modules completion in require() in the messages above? Or, is it a new issue? Please calm down and explain, or stop posting ....

0
Comment actions Permalink

I've spent all the night on this, do nothing ... just because I am curious how Webstorm 11 will be.

Now, I revert back to webstorm 10, because I cannot get used to the extra 'hot-key' to open the suggested module list.

However, now in Webstorm 10, while I type module name in require(),
all the Node.js core modules disappeared except the local installed npm modules.

for example,

var fs = require('fs') // fs will not show automatically

var request = require('superagent'); // superagent will show automaticlaly because it is a local install npm module.

how can I revert back to no webstorm state? so I can re-install webstorm again ?
I've back-up my preference settings already.

0
Comment actions Permalink

fixed.
I kill the webstorm preferences under ~/Library/Preferences
and re-install the Webstorm, then it's been fixed.

I guess the preference was mis-configured while I open both Webstorm 11 and Webstorm 10.
Apologized for all the postings, and thank you for your patience on this. Hope Webstorm 12 will be better.

0

Please sign in to leave a comment.