PDA

View Full Version : IntelliJ 12.1.5 with ExtJS 4.2.1 - Auto complete woes!



provster
7 Oct 2013, 12:59 PM
Hi guys,

I've been trying to create a new project in IntelliJ 12.1.5, with ExtJS 4.2.1, but I'm having problems with the auto complete. I have tried adding ExtJS as a global library as below:

46206

Weirdly, no matter what I do, IntelliJ seems to think it's a release version. Also, when I add ext-all-debug-w-comments.js as above, I get no auto complete at all.


46207

The library is set to global scope, and is assigned to the module my source is in.

46208


So I tried using ext-debug-w-comments.js and the code completion then works, however, I'm presuming I'm not getting code completion for hundreds of extra classes which might be useful, as this file is only ~32k lines as opposed to the full ~118k.

46210


Finally, the worst problem is that I have some other javascript libraries in the module for older code, like jquery, and these are being picked up by IntelliJ. I would rather disable them completely. Because the back end is a Java Servlet and I'm using Tomcat, I have to have the libraries javascript in the WebContent folder, as well as the full ExtJS folder. When I do this, IntelliJ seems to parse all the javascript and fills the autocomplete completely up with thousands of entries. It also seems to parse all the ExtJS stuff, including all the examples. See below:


46211


So my questions are:
Why does adding [B]ext-all-debug-w-comments.js seem to show no documentation?
How should I add ExtJS properly to my project? The starter guide suggests dumping the complete extracted folder into my server, but it seems like there are a lot of extra files in there I don't need... and IntelliJ seems to want to build up a huge autocomplete index from them all.
How can I selectively remove other js libraries from the auto complete without using the sources tab from the project structure dialog to exclude them? This causes them not to be deployed when tomcat runs which isn't what I want.

Thanks :)

ettavolt
7 Oct 2013, 9:50 PM
Even if you've switched to the dark side, IDEA is not able to work with docs webapp - there is no reason for pointing there.

What do I do (on the light theme!):
# Attach src directory of ExtJS distribution to clean library.
# Shutdown IDEA.
# Open applicationLibraries.xml from the settings.
# Change SOURCES tag of library to CLASSES and vice versa. (Star WEB-6911 (http://youtrack.jetbrains.com/issue/WEB-6911))
# Save&Close.
# Open project.
# Mark all Ext files under project root as plain text (context menu option).
# Turn on configured library for project.

provster
8 Oct 2013, 9:30 AM
I'm sorry, I'm a fan of the dark side despite their terrible reputation :P

I was able to make a global library with the src folder as you suggested, but in doing so it got me thinking..

If IntelliJ is picking up all javascript files included under the module's root, instead of creating a library wouldn't it be sufficient to mark all the files except the src as plain text and not add a library at all?
Does marking files as plain text remove them from IntelliJ's indexing?
Is there an easier way to mark them as plain text than the context menu? Where does it put it's config file?
What does changing "SOURCES tag of library to CLASSES" do? Is this to get around the bug you linked to? it seemed to add all the src js files just fine, and I was able to get the autocomplete + documentation working.

ettavolt
10 Oct 2013, 12:32 AM
1. Yes, but you'll have separate index for each project.
2. I believe only text-search index is left.
3. This is per-project setting. I suggest you look in to .idea/ - I haven't tried this personally.
4. Have you visited applicationLibraries.xml? By default you will see src files been listed under SOURCES. After turning on such library for project, idea will clear it (after indexing). So changing the section name is a workaround.