Reputation: 7737
How does Intellisense work in IDEs for JavaScript such as Webstorm or Eclipse?
Where do the suggestions come from?
Can we write the code to make the suggestions more accurate?
Upvotes: 0
Views: 315
Reputation: 2125
Disclaimer, I'm the author of tern.java
I suggest you that you try tern.java by starting to read Getting Started
Upvotes: 0
Reputation: 93908
Please see http://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/ for some hints on improving JavaScript code completion in WebStorm. In general: suggestions are taken from index that is built for all .js and d.ts files available in the project/set up as libraries. To make the completion better, you can try using JSDoc annotations/typescript definition stubs
Upvotes: 2
Reputation: 111227
In Eclipse you can write plug-ins which use the org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer extension point to contribute additional Content Assist proposals.
Eclipse gives you access to an Abstract Syntax Tree of the code to help with analyzing the source.
Upvotes: 0