简体   繁体   中英

Javascript Intellisense in IDE

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?

样本图片

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

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.

Disclaimer, I'm the author of tern.java

I suggest you that you try tern.java by starting to read Getting Started

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM