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 - Inline @var not working in long classes
Summary: Inline @var not working in long classes
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: All All
: P4 normal with 1 vote (vote)
Assignee: Ondrej Brejla
Depends on:
Reported: 2013-10-23 14:09 UTC by timmekesegers
Modified: 2013-10-28 09:03 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description timmekesegers 2013-10-23 14:09:26 UTC

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 */


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.


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.