| View previous topic :: View next topic |
| Author |
Message |
cmpscabral
Joined: 17 Mar 2009 Posts: 5
|
Posted: Tue Sep 22, 2009 6:16 pm Post subject: code completion using @var not working |
|
|
Hi,
I'm using /* @var $view Zend_View */ to get code completion on vars created with factory classes but it's not working.
Am I'm missing something?
Thanks |
|
| Back to top |
|
 |
Tomasz Slota Posted via mailing list.
|
Posted: Wed Sep 23, 2009 8:28 am Post subject: code completion using @var not working |
|
|
Please tell us what exact version of NB you are using and provide
complete example of code with marked caret position at the time you are
calling code completion.
Also you may wanna try
/** @var $view Zend_View */
-TS
cmpscabral wrote:
| Quote: | Hi,
I'm using /* @var $view Zend_View */ to get code completion on vars created with factory classes but it's not working.
Am I'm missing something?
Thanks
|
|
|
| Back to top |
|
 |
cmpscabral
Joined: 17 Mar 2009 Posts: 5
|
Posted: Wed Sep 23, 2009 10:13 am Post subject: |
|
|
Tomasz,
I tried /** but didn't work either. Here's my details:
Product Version: NetBeans IDE 6.7.1 (Build 200907230233)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
System: Linux version 2.6.28-15-generic running on amd64; UTF-8; en_US (nb)
here's a sample of my code:
/** @var $view Zend_View */
$view=getView();
$view->(this is where I hit ctrl+space and get "no suggestions")
thanks |
|
| Back to top |
|
 |
Petr Pisl Posted via mailing list.
|
Posted: Wed Sep 23, 2009 1:19 pm Post subject: code completion using @var not working |
|
|
Hi,
the right form for defining a variable type in comment is what you wrote
at fits time. See
http://blogs.sun.com/netbeansphp/entry/defining_a_variable_type_in
This works for me. Is the class Zend_View on the project path? Is it
available in your project?
Regards,
Petr
| Quote: | Tomasz,
I tried /** but didn't work either. Here's my details:
Product Version: NetBeans IDE 6.7.1 (Build 200907230233)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
System: Linux version 2.6.28-15-generic running on amd64; UTF-8; en_US (nb)
here's a sample of my code:
/** @var $view Zend_View */
$view=getView();
$view->(this is where I hit ctrl+space and get "no suggestions")
thanks
|
|
|
| Back to top |
|
 |
cmpscabral
Joined: 17 Mar 2009 Posts: 5
|
Posted: Wed Sep 23, 2009 1:22 pm Post subject: Re: code completion using @var not working |
|
|
| Petr Pisl wrote: |
This works for me. Is the class Zend_View on the project path? Is it
available in your project?
|
Petr,
Yes, Zend_View is on the project path. For instance, if I write:
| Code: |
$v= new Zend_View();
|
the code completion works as expected. |
|
| Back to top |
|
 |
Petr Pisl Posted via mailing list.
|
Posted: Wed Sep 23, 2009 2:01 pm Post subject: code completion using @var not working |
|
|
I got it . This looks like a bug.
I think that the function assignment replace the type of the variable.
In this case NetBeans are not able to find out for the function
getView() the return type. The solution for you can be simple. Just move
one line down the comment variable type definition.
$view=getView();
/** @var $view Zend_View */
$view->(this is where I hit ctrl+space and get "no suggestions")
Does it work for you?
Regards,
Petr
| Quote: | Petr Pisl wrote:
| Quote: | This works for me. Is the class Zend_View on the project path? Is it
|
| Quote: | available in your project?
|
Petr,
Yes, Zend_View is on the project path. For instance, if I write:
Code:
$v= new Zend_View();
the code completion works as expected.
|
|
|
| Back to top |
|
 |
cmpscabral
Joined: 17 Mar 2009 Posts: 5
|
Posted: Wed Sep 23, 2009 2:07 pm Post subject: |
|
|
Petr,
It's working, thanks
One last question: if getView() had a return type in its definition/comments would this be unnecessary? |
|
| Back to top |
|
 |
Tomasz Slota Posted via mailing list.
|
Posted: Wed Sep 23, 2009 2:40 pm Post subject: code completion using @var not working |
|
|
Yes, it would be good idea to use the @return tag in getView()'s PHPDoc
to indicate the return type.
-TS
cmpscabral wrote:
| Quote: | Petr,
It's working, thanks :)
One last question: if getView() had a return type in its definition/comments would this be unnecessary?
|
|
|
| Back to top |
|
 |
|