jIDEA is not finding anything ! (is this a bug?)

I'm new in Java, so probably I'm doing something realy stupid, can somebody tell me why the IDE is not showing anything here:

intellij_static_bug.jpg

I'm trying to get the public static var "DO_NOT_ESCAPE_QUOTES" from GeneralCommandLine
Because I want to avoid the escaping, anyway, when I create the instance of my GeneralCommandLine object I can't access to "putUserData" neither, but I think is exactly the same problem.

0
15 comments

Hello,

Try to put that code into a method.

Denis

0

I have the code inside a method, that screencapture is just a simplification, and I forget to include that inside a method (anyway, I noticed that just after posting my question and I updated the image, I don't know why the post still showing the old one).
Anyway, that's NOT the problem of course:

intellij_static_bug2.jpg

0

that is correct. Looking at the class itself it only has a few public static  methods:

http://grepcode.com/file/repository.grepcode.com/java/ext/com.jetbrains/intellij-idea/10.0/com/intellij/execution/configurations/GeneralCommandLine.java

Now, do something like:
GeneralCommandLine line= new GeneralCommandLine();
line.[CTRL+SPACE]

..

0

here it is:
intellij_static_bug3.jpg

Anyway, the problem is that my GeneralCommandLine class is not equals to: http://grepcode.com/file/repository.grepcode.com/java/ext/com.jetbrains/intellij-idea/10.0/com/intellij/execution/configurations/GeneralCommandLine.java
Look:
intellij_static_bug4.jpg

Why??? what's happening here??? I mean, if in my code I have that class, with those static, why the IDE is reading the class from grepcode.com? and why when I click Ctrl+B I get "my" version of GeneralCommandLine ??
I'm even more confused now :S

0

IDEA is reading the class file, which may be inconsistent with the source file. Please check that GeneralCommandLine.class contains thie field in question.

0

Why the .class file is different of my java file? how can I fix it? and which of the two versions (the .class and the .java) is correct?

I want to execute a php script, but I want to execute it without any file, the php code directly, with the "-r" option.
I was trying to do that with GeneralCommandLine, but it is escaping my double quotes.
In my GeneralCommandLine.java I see a static var for bypassing the espaing, but apparently that is not present in the .class file.

0

On the runtime the .class version is used, so it's the correct one. Just ensure that the jars and the sources are from the same version of IDEA, I'd suggest to create the library (or IDEA SDK, if you use it) afresh with IDEA 11.1 jars/sources.

0

May you explain me how to check that?
I've installed jIDEA Community Edition 11.0.2 and cloned this repository:


git clone git://git.jetbrains.org/idea/community.git idea

Anyway, I see a big problem here even if I can solve it for me now.
The class GeneralCommandLine seems very unstable, I mean, the code changed a lot from my .class and my .java
Therefore is possible (If I'm understanding it right) that if I develop my plugin following the definition of my GeneralCommandLine.java,
and a user installs my plugin, and it has the IDE with a different GeneralCommandLine class it won't work.

I just need to execute a command and get the output of that command (I need to execute a php script to be more precise).

Maybe there's a better way to do that...

0

Yes, when developing a plugin you should specify which versions of IDEA it's compatible with.

Is it a plugin module you're doing? Then please check its SDK in Project Structure settings, it should be an IntelliJ IDEA SDK. There should be Classpath and Sourcepath tabs on the SDK settings page, and the jars listed there should belong to a single IntelliJ version.

0

Yes, I have the classpath pointing to my installation folder of JIDEA Community Edition 11.0.2 (and I think I should change it to my installation of PHPStorm if I want to develop the plugin for it am I right?). I can see the .jar files there.
And I have the sourcepath pointing to my git clone, which I did the same day I've installed jIDEA so I thought they were the same.
How can I see if both version are equals? and how can I fix it if they are not equal?

Anyway, why they are so different if I've installed both the same day?

I want to develop a plugin for PHPStorm 3.0.2+, maybe PHPStorm 4 too (because I think it will be released soon). Can you help me to configure the best classpath and sourcepath for that?

0

Just compare the build numbers, not the version numbers. First number (111, 117) is a git release branch number and the second (1...100...500...) is the sequental build number in the branch.

the git repos are tagged with labels when installers are built, i.e.

* [new tag]         pycharm/117.124 -> pycharm/117.124
* [new tag]         pycharm/117.131 -> pycharm/117.131
* [new tag]         pycharm/118.123 -> pycharm/118.123
* [new tag]         pycharm/118.124 -> pycharm/118.124
* [new tag]         pycharm/118.129 -> pycharm/118.129
* [new tag]         rubymine/118.127 -> rubymine/118.127
* [new tag]         rubymine/118.132 -> rubymine/118.132
* [new tag]         storm/117.125 -> storm/117.125
* [new tag]         storm/117.128 -> storm/117.128
* [new tag]         storm/118.128 -> storm/118.128
* [new tag]         storm/118.131 -> storm/118.131

so you can reset your working copy to a tag if you want.

You may develop using normal IDEA plugin sdk & CE sources, just dont use anyting that is missing (i.e has JAVA in its module name) and be sure to test everyting with PhpStorm.

Note that there's no open PHP api or extension points.

0

mmm... I'm not sure if I'm looking the build version in the right places.
In my git clone, I see a build.txt, inside it has: 118.SNAPSHOT
And I have another build.txt file inside the /lib/ folder of my jIDEA installation, it says: IC-111.277
Should I interpret that as follow ?:
My IDE is 111, and my source files are 118 ?

Note that there's no open PHP api or extension points.


Yes I'm aware of that :(
Anyway, even if the API is not open, does the IDE helps me with some utilities for example for parsing PHP files? can I use PSI files of PHP files?
For example, if I want to detect if the cursor is over a string or a variable or a function, etc in the PHP code, does the IDE help me with this task or I must write a PHP parser ?

Thanks !

0

Yes, your IDE is WAY too old.
Get latest 11.1 build (117.*)  Also, switch your git to branch "117" to be on the same page.

You may try to use PHP PSI but we are not providing any information here yet.
And your code will break VERY often since our code/PSI is still evolving much.

0

Thanks Alexey !
What is the best way of developing a plugin which needs to add functionalities according to the PHP code in the editor (typically for code completion enhancement, etc, a plugin for a PHP framework for example) ?
I'm debugging the PhpFile, but I'm note getting yet how to use it, or even if I can use it because I can't have a "PhpFile" type in my code I guess (the IDE is not finding that class).

Do you recommend to parse the PHP by ourselves (maybe with regex if it's a simple, and probably not so robust, parser what we need...) ?

0

I can't recommend you work on this at all - this will be a utterly ineffective resource allocation.

0

Please sign in to leave a comment.