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 213492

Summary: Incorrect variable origin in code completion
Product: php Reporter: Vladimir Riha <vriha>
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal CC: vriha
Priority: P4    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: sample project

Description Vladimir Riha 2012-06-04 08:17:53 UTC
Created attachment 120282 [details]
sample project

When I declare some variable in fileA and include this file in 2 other files: fileB and fileC then code completion for the variable in fileB shows that the variable is declared in fileC


Check the sample project, 
- open file "index.php" 
- type "$" and invoke cc
- type "f" => cc list is reduced to 1 item but it shows that fooBar is declared in  "newEmptyPHP1.php" which is wrong

Notice the line with "$fooBar=1;" where cc for the variable shows correct origin.


Product Version: NetBeans IDE Dev (Build 201206040001)
Java: 1.7.0_04; Java HotSpot(TM) Client VM 23.0-b21
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
Comment 1 Ondrej Brejla 2012-06-04 08:33:57 UTC
I see right origin everywhere in index.php. But there is a problem, because you have it declared in newEmptyPHP1 too (and in index and in newEmptyPHP too). 

In every file there is some $fooBar assignment in a global context. Netbeans really don't know what will be the first declaration in runtime, so it takes some occurence during file scanning and handles it as "declaration".

I will leave it as P4 as a reminder, but it's a common won't fix.
Comment 2 Vladimir Riha 2012-06-04 08:44:05 UTC
OK, thanks