Intelligent Editor does not understand some code tricks

http://www.jetbrains.com/webide/features/index.html#PHP_IDE
Here it says about the editor intelligence:

Thorough source code analysis allows us to provide code completion even to an unannotated code, for example:I
    function return type is deducted from its body and return statements         



I attached a screenshot describing my issue. In a Kernel class that is available from anywhere in the project without instantination there are serveral static methods that return objects of different classes such as:
auth - class to work with user authentification,
dirs - class to manage urls,
db - db class etc. (as seen in the screenshot).

It also has a static method core() whitch returns Kernel object inself in order to access its public methods. WebIDE cannot resolve return types of the objects, so when I type Kernel:: and press Space it shows me the methods, but their return type is undefined, thus the object methods cannot be autocompleted.

It would be great if you could solve this issue.

I have used 2 IDE's that resolved it correctly (in most cases) - Aptana IDE 1.5.x (before they switched to PDT plugin) and NuSphere PHPEd.

NetBeans IDE which I stick to cannot resolve the return types either, and it is a very big drawback for me.

Thanks in advance, you are making a real good product guys!



Attachment(s):
WebIDE.jpg
0

It will help us to reproduce the problem if you attach full Kernel class source and sample reference code (or upload it to ftp.jetbrains.com/.upload and post archive name here to keep code private)

0
Avatar
Permanently deleted user

Sure, I will attach a mini-framework a bit later

0
Avatar
Permanently deleted user

Okay. I made a simplified version of the framework (see the attached archive).

In order to reproduce the problem do the following:
1. Create a new WebIDE project using the sources from the archive.
2. Go to test/kernel/include/Auth.inc class and see the authorization() method (commented lines).

When I type Kernel:: and press Ctrl+space it shows me static methods of Kernel, it works ok. But it does not understand the types of the objects that are returned by the methods!
Thus it does not autocomplete the methods, saying "no suggestions". That is the issue I am concerned about.

Also I'd like to mention the following thing (maybe it is better to make another post for this issue?) - the IDE in no way indicates that a file was modified! And when I close it,
it simply saves the changes without prompting me for what to do.



Attachment(s):
test.tar.gz
0

Okay, the point was that we do not recognized constructor *static* field initialization. This is already done, wait for next EAP.
Also you can just add  

/** @var Kernel */
to before
private static $_core = null;
as easy workaround now.
0
Avatar
Permanently deleted user

Thanks! The IDE is really intelligent to understand types from comments This works as a charm!

Inability of IDEs to autocomplete my custom code made me move from one IDE to another looking for the best out of them all. Yours seems to be the best for now in this way

0
Avatar
Permanently deleted user

Hm, I just tried to define var type of variables and return type of functions in NetBeans like you suggested doing in WebIDE, and it also worked!
Looks like NetBeans does not fall behind in this battle Anyways NetBeans is not that smart, I must admit.

0

We are completely aware that this feature is de-facto standard. The point is that WI is able to deduce type WITHOUT this annotation. We simply have not done it for *static* fields because nobody requested that, and starting from next EAP it will work for static.

0
Avatar
Permanently deleted user

You are doing a great job guys! We'll see what the final product will be like

0

请先登录再写评论。