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 211237 - Code completion for objects from included files
Summary: Code completion for objects from included files
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
: 269983 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-16 09:25 UTC by Vladimir Riha
Modified: 2017-03-04 22:03 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-04-16 09:25:14 UTC
To reproduce, in fileA.php type following:

$foo = new DateTime("2012-04-16 10:55:16");

In fileB.php:

include 'fileA.php';
$foo->

And invoke CC for $foo => nothing is offered, but functions from DateTime should be. The same goes for custom classes
Comment 1 Ondrej Brejla 2012-04-16 11:19:45 UTC
It never worked before, am I right? And it can't work in the current infrastructure. Variables are resolved from model and model is built for current file. I can't ask index scope either, because standalone variables can't be resolved from it. So a lot of thing has to be improved and rewritten.

But there is a simple workaround by use of varDoc:

<?php

include 'fileA.php';

/* @var $foo DateTime */
$foo-> 

So it should be an enhancement or maybe P4, but P2/P3 enhancement is OK for me (as it never worked and can't be simply implemented).
Comment 2 Tomas Mysik 2012-04-17 07:55:43 UTC
(In reply to comment #0)
> To reproduce, in fileA.php type following:
> 
> $foo = new DateTime("2012-04-16 10:55:16");
> 
> In fileB.php:
> 
> include 'fileA.php';
> $foo->

Please notice that this is really _bad_ code and IMHO every existing PHP framework discourages from such coding.

Therefore lowering to P3.
Comment 3 alex9099 2017-03-04 22:03:59 UTC
*** Bug 269983 has been marked as a duplicate of this bug. ***