Javascript autocompletion (introspection) between files does not works

Greetings!

I'm using PyCharm since 0.95 and everything used to work fine.

Just today i've switched to version 1.1 from 1.0.1 and seen very disappointing thing: "PyCharm can't see objects/functions defined in other javascript files".

So if i want to use an object defined in other javascript file, it shows like undefined and autocompleter knows nothing about it. I usually combine javascript files in django templates, so i don't have a direct reference to them. Just a script link with a {{ MEDIA_URL}} prefix.

Any opinions how to fix it or what i do wrong?

P.S. I've added a jQuery as a library to my project and it found it. I've also tried to add all my other files as library, but that does not help and it looks strange to add your JS files as libraries.

Cheers and Merry Christmas,

Oleg

10 comments
Comment actions Permalink

This is sideeffect of early implementation of JavaScript library support, you can switch it off as workaround

0
Comment actions Permalink

It seems that JavaScript autocompletion works fine in PyCharm 1.1 at least for JavaScript and HTML files without any tricks. Oleg, does this problem appear only in Django templates or you get a similar result for .js/.html files as well?

0
Comment actions Permalink

Hello!

Maxim:

How can i disable Javascript Libraries support?

Rustam:

It works fine only inside one file. It knows nothing about content of other javascript file. For example if i have a function x() in file x.js it will not autocomplete it's name and mark it as invalid in another file j.js

The same with javascript section inside of HTML file.

Cheers,

Oleg

0
Comment actions Permalink

I have tried all the use cases I could imagine but still can't reproduce your problem. What happens if you remove all the libraries and restart the IDE? What if you create a new empty project? Do you get the same result there? Just guessing because I'm running out of ideas.

0
Comment actions Permalink

Rustam,

Try to use Settings() object from attached file in Django project in different cases: from other file, from javascript section of other template.

Do you have autosuggest of Settings object, do you see its method in autosuggest box? Version 1.0.1 also used to work great with a jQuery.fn.pluginName. $('aaa').pluginName was recognized. Now i see nothing.



Attachment(s):
settings.js
0
Comment actions Permalink

I tried your example with PyCharm 1.1 and made a screenshot showing that there are completion variants from Settings.js:

pycharm_completion_screenshot.png

I think the problem is not in this particular Settings.js file but somewhere else. In my test I don't have any JS libraries defined just to make sure that there are no libraries which may have influenced that.



Attachment(s):
pycharm_completion_screenshot.png
0
Comment actions Permalink

Could you include jQuery also into your project and attach zip to message. I will try it on my installation.

0
Comment actions Permalink

Well, I have this same issue. It stoped working after enabling django support.

0
Comment actions Permalink

And after disabling django support and invalidating caches it works again. So cause of this problem is in django support.

0

Please sign in to leave a comment.