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 196599

Summary: Global code completion not working
Product: php Reporter: maghiel <maghiel>
Component: CodeAssignee: pgebauer <pgebauer>
Status: RESOLVED INVALID    
Severity: normal CC: vriha
Priority: P3    
Version: 7.0   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: class screenshot
function
comment

Description maghiel 2011-03-11 16:39:39 UTC
[ BUILD # : 201103100000 ]
[ JDK VERSION : 1.6.23 ]

    Verify global variable code completion.
        Create a PHP function.
        Declare a global variable.
        Type several first symbols of the variable name and invoke code
completion. 
        EXPECTED RESULT: Code completion appears and the variable name is among
suggestions. 

*FAIL* Suggestions don't become available outside the function scope. 

---

    Verify variable from included file code completion.
        Include an other PHP file into PHP source.
        Open that PHP source and create a global variable there.
        Create a PHP function in the first source.
        Inside that function, type several first symbols of the variable name
and invoke code completion.
        Choose that variable in the list and press Enter. 
        EXPECTED RESULT: Code is completed properly. No require or include
directive is auto-generated. 

*FAIL* Result: No suggestions.
Comment 1 Vladimir Riha 2011-03-14 15:22:50 UTC
Created attachment 106984 [details]
class screenshot
Comment 2 Vladimir Riha 2011-03-14 15:23:15 UTC
Created attachment 106985 [details]
function
Comment 3 Vladimir Riha 2011-03-14 15:24:11 UTC
Created attachment 106986 [details]
comment
Comment 4 Vladimir Riha 2011-03-14 15:25:05 UTC
It works for me, see the attached screenshots, folding works for functions,
classes, /* */ comments. Can you give me more details? I tried it in php file
and php web page as well.

Currently I don't have the newest build, I'll try the latest in the evening.


Product Version: NetBeans IDE Dev (Build 201103090000)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Windows 7 version 6.1 running on x86; Cp1250; cs_CZ (nb)
Comment 5 Vladimir Riha 2011-03-14 15:41:29 UTC
Sorry, I have opend bad bug, all my comments don't belongs here...
Comment 6 Vladimir Riha 2011-03-14 15:41:54 UTC
Comment on attachment 106984 [details]
class screenshot

bad issue
Comment 7 Vladimir Riha 2011-03-14 15:42:07 UTC
Comment on attachment 106985 [details]
function

bad issue
Comment 8 Vladimir Riha 2011-03-14 15:42:14 UTC
Comment on attachment 106986 [details]
comment

bad issue
Comment 9 Vladimir Riha 2011-03-14 21:18:19 UTC
Did you use the keyword "global"? I did it kind of automatically (because I'm used to do it that way and I don't know if any other way is possible) and it works in both cases. 

For the first issue:
<?php
function myF(){
    global $justVar;
    $<codeCompletion>
}?>
This works

For the second one:
second.php:
<?php
$foo = 2;
?>

first.php:
<?php
include 'second.php';
function myF(){
    global $f<codeCompletion>
}?>

This works as well. If you tested it differently, could you please attach the source files? Maybe I get it wrong...
Comment 10 maghiel 2011-03-14 22:25:52 UTC
Sorry I didn't close this issue, lot of work on my hands.
It turned out the test suites were wrong, not netbeans itself.