Autocompletion for CDN JS libraries

It works nicely in the HTML in which a 'script' tag resides, which has been downloaded locally with the convenient "Download library" pop up.

Is it possible to take advantage of this code assist from a standalone js file in the same project? Can we reference somehow that the library we're about to use is downloaded and let webstorm assist us with the coding part?

Thanks

3 comments
Comment actions Permalink

>Is it possible to take advantage of this code assist from a standalone js file in the same project?

Not sure I follow you... If the library .js file is already included in your project, there is no need to download it - it's already available; WebStorm takes all JavaScript files in the project and goes through them, adding functions and methods to an internal index used for code completion suggestions. The index is automatically updated whenever existing files are changed or new files are added. Downloading a library just allows including external file in this index, nothing more

0
Comment actions Permalink

Thanks for the reply Elena (and in the second topic I opened! :)).

 

I meant the following scenario: I have a js script linked from a cdn. I clicked download locally via the pop up. Now, if I go to a js file which I'm gonna write myself (003 in the example), can i get code assist for the now locally downloaded script file?

Hope the above along with the pic below makes more sense.

 

0
Comment actions Permalink

Sure, once the library is downloaded, you should get coding assistance when calling its methods in your project JavaScript file. But note that coding assistance is based on static code analysis, and analysis results are extremely unreliable when using a compressed scrambled code like the one included in d3.min.js. 

 

0

Please sign in to leave a comment.