how to configure code completion suggestions to include external JS library only
Hi,
Is it possible to configure code completion suggestions?
I'd like to add casperjs library and see JavaScript suggestions only.
This is what I see.... Java, Java Script, Groovy.. everything

This is what I want to see - casper.js methods only.

Please sign in to leave a comment.
You need to exclude the directory where all your other libraries reside from indexing (Mark directory as/Excluded) and then add casper.js to JavaScript libraries in Settings | Languages & Frameworks | JavaScript | Libraries
See https://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/
Hi @Elena,
That worked.
But I've got a new issue.
The autocompletion works for "new Casper()" defined objects only.
In my case casper is not defined in the code itself but by maven configuration.
Is there a way to instruct InteliJ using a comments or configuration file, so casper variable would use casper.js for autocompletion.
If not that is a great feature that could be added.
haven't got what you mean,sorry... do you mean that `casper` var is not defined/assigned anywhere in your code? You can try using JSDoc comment then, like
yes I meant that, var casper is not defined in my code but injected using maven
The JSDoc works partially
Doesn't work using casper name
But when I rename the name it works - but that is not a solution
this happens because the `casper` variable is already defined somewhere, and is used when completing methods instead of the var defined in JSDoc... For example, with casperjs installed via NPM, it's defined in samples folder... I was able to get rid of the issue by excluding all files it's defined in, so that the only file added to libraries is `node_modules\casperjs\modules\casper.js`
Thank you :)
That fixed the issue.