Code completion in Webstorm 2018.1.2 almost non functional for React development
I use Clion and Pycharm on a regular basis. I am a big fan of Jetbrains tools. I have been trying to use Webstorm for Javascript and React. I am finding the code completion to be pretty much useless in Webstorm. I keep going back to Vscode for Javascript because the code completion for Javascript React apps just works. I want to be able to stay in the Jetbrains eco system for Javascript. Simple things like typing console.log don't get any help on code completion. None of my React libraries get any code completion help. I am using create-react-app. I am also using axios, react-router, and react-router-dom. There are so many reasons I want to use Webstorm instead of Vscode. But when I fire up Vscode the code completion is fast and always works. When I use Clion and Pycharm, the code completion is great. Are there plans to get the code completion up to Vscode standards when it comes to Webstorm? I am on MacOS High Sierra.
Please sign in to leave a comment.
console.log() definitely has code completion:
Do you have HTML library enabled in Settings | Languages & Frameworks | JavaScript | Libraries?
Also, please can you elaborate on the issues with completion from React libraries? Code snippets that show up the issue would be helpful
FYI: problem with axios module is tracked as https://youtrack.jetbrains.com/issue/WEB-32066
I created a brand new project using the Webstorm GUI to create it.
I was able to get console.log working etc. Not sure what was going on with the other project. I don't however get any completion help on items defined in the react-router or react-router-dom libraries.
I did some experimentation, it seems like Vscode is doing a brute force index of everything in the entire project. Even if I type something nonsense and then go down a few lines and type the same thing, it figures it out and helps me complete another line of the same nonsense. Even though I may get some suggested completions that don't make syntactical sense it works very well because it reaches into all the library files and helps with completion. Not getting this with Webstorm.
Is there a completion mode setting that I can change that will enable something similar?
I did verify that the HTML library was enabled in settings
>I don't however get any completion help on items defined in the react-router or react-router-dom libraries.
Please can you provide exact code snippets I can usev to recreate the issue?
>it seems like Vscode is doing a brute force index of everything in the entire project
webstorm does the same thing - it indexes the project files and libraries. See https://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/ for details
>Even if I type something nonsense and then go down a few lines and type the same thing, it figures it out and helps me complete another line of the same nonsense
You can try 'hippie completion' (cyclic expand word) - see https://www.jetbrains.com/help/webstorm/auto-completing-code.html#hippie_completion. It's Alt+Slash in default keymap.