This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 237559

Summary: Inline @var not working in long classes
Product: php Reporter: timmekesegers
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal CC: EdmondX
Priority: P4    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description timmekesegers 2013-10-23 14:09:26 UTC
TL;DR:

I am trying to use the default @var declaration to get code completion in a php class. I don't use namespacing. For example:

$mapper = MyLoader::getSomeMapper();

/* @var $mapper MyMapper */

$mapper->foo();

The code above works and gives code completion from MyMapper, as long as I use it before ~750 lines deep in a large class. If I use it later in the class, it no longer works.



LONG VERSION:

In the code below I construct a ProductMapper that communicates with my database, through a general static method in my loader:

$mapper = MyLoader::getDataObjectMapper('Product');

This method has an @return DataObjectMapper, which is the abstract superclass for all mappers in our framework. Next, I declare it to be a ProductMapper:

/* @var $mapper ProductMapper */

If I type "$mapper->" after this line, it gives me code completion from both the DataObjectMapper superclass and the ProductMapper specifically, unless I put this code quite deep in a large class. In that case I only get code completion from DataObjectMapper. As so, it appears the @return still works at that point, but the @var no longer does.

This has been an issue ever since I started using NetBeans, which was version 6.7 or something. It is thus not specifically related to 7.4 as far as I know.

If you have any questions / need more info -> shoot!
Comment 1 Ondrej Brejla 2013-10-23 14:11:08 UTC
That's an intent, because of performance reasons. P4 as a reminder.
Comment 2 timmekesegers 2013-10-23 14:16:01 UTC
Is it possible to tweak the number of lines somewhere or something, through a setting for example? It is not always possible to shorten classes.