C
C
Cat Anton2016-10-18 14:37:09
JavaScript
Cat Anton, 2016-10-18 14:37:09

Why doesn't PhpStorm detect method declarations correctly?

Good afternoon.
- We have require.js, Backbone, jQuery installed via NPM.
- PhpStorm has the RequireJS plugin installed.
- Added library folder node_modules to JavaScript Libraries .
Code example:

/* global define */

define(['backbone'], function (Backbone) {
    var model = new Backbone.Model();
    model.get();
});

The IDE does not give any errors or warnings. But when you try to go to the method declaration (Ctrl + Click or RMB > Go to > Declaration), model.getthe framework offers completely inappropriate options, including jQuery and Backbone.Collection.
da8ed2419bb34b42831bd66f1ab2bd17.png
How can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yesworld, 2016-10-27
@yesworld

Because Shtor has indexed all JS files/libs.
Add to the exception all the folders that are not needed.
RMB on the folder, select Mark Directory As and Excluded
If the file you need is there, add it separately to the library: External Libraries .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question