FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

code completion using @var not working

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
cmpscabral



Joined: 17 Mar 2009
Posts: 5

PostPosted: Tue Sep 22, 2009 6:16 pm    Post subject: code completion using @var not working Reply with 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
View user's profile Send private message
Tomasz Slota
Posted via mailing list.





PostPosted: Wed Sep 23, 2009 8:28 am    Post subject: code completion using @var not working Reply with quote

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

PostPosted: Wed Sep 23, 2009 10:13 am    Post subject: Reply with 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
View user's profile Send private message
Petr Pisl
Posted via mailing list.





PostPosted: Wed Sep 23, 2009 1:19 pm    Post subject: code completion using @var not working Reply with quote

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

PostPosted: Wed Sep 23, 2009 1:22 pm    Post subject: Re: code completion using @var not working Reply with quote

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
View user's profile Send private message
Petr Pisl
Posted via mailing list.





PostPosted: Wed Sep 23, 2009 2:01 pm    Post subject: code completion using @var not working Reply with quote

I got it Smile. 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

PostPosted: Wed Sep 23, 2009 2:07 pm    Post subject: Reply with quote

Petr,

It's working, thanks Smile

One last question: if getView() had a return type in its definition/comments would this be unnecessary?
Back to top
View user's profile Send private message
Tomasz Slota
Posted via mailing list.





PostPosted: Wed Sep 23, 2009 2:40 pm    Post subject: code completion using @var not working Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB