Slight coding issue...

I started using WebStorm a couple of days ago while looking for an IDE that was light on resources and was fast.  I love the program.  Though I am still using phpDesigner, I think WebStorm is definitely a good addition to any web developer's set of tools.

WebStorm easily picks up the CodeIgniter framework which is my framework of choice.  I do have one small issue.  Consider these 2 examples:

$this->load->model('test_model');
$entries = $this->test_model->get_all_entries;
echo $entries;

and

$this->load->model('test_model');
$TModel = new Test_model;
$entries =  $TModel->get_all_entries;
echo $entries;

In the first example, when I use $this->test_model-> and hit CTRL+Space, I get no suggestions whatsoever yet if I use $TModel-> and hit CTRL+Space, I get suggestions.  Yet both lines of code return the same result.  Why isnt WebStorm giving me suggestions on $this->test_model?


Also wanting to know the differences between PHPStorm and WebStorm?  Do both of them do the same thing? or is PHPStorm more php centric?


Thanks

Emmanuel

0
2 comments

First about distros: WebStorm will NOT include PHP & SQL support - its actually there for only for couple of EAP builds while we working on our new build process. So if you do PHP - you'll need the PhpStorm. You can look at the diagram at http://www.jetbrains.com/webide/ to quickly imagine the scope of each tool.

Now about completion. Member completion relies on the ability of IDE to deduce correct type of the object on the left side of '->'. The CI dynamic style case is simply not supported yet. It will be at some point in the future, but now it requires PHPDOC type annotation to work. Just add /** @var Test_model */ right before test_model field declaration in class body. To check type inference invoke Ctrl-Q on any variable, method, property, etc. If any type was inferred the first line will list it.

IDE also understands for most other PHPDOC type-related annotations (i.e. @param, @return for functions and methods)

We'll work on improving annotation-less type inference for such a dynamic approach later as either part of general PHP support or as framework specific support, however the exact roadmap is not available.

0
Avatar
Permanently deleted user

Hi Alexey,

Thanks for the very clear reply.  I will certainly be keeping an eye developments with regards to PHPStorm and WebStorm as both do have potential.  Meanwhile, keep up the good work.

0

Please sign in to leave a comment.