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.
Created attachment 105453 [details] sample project Code completion for methods from parent class doesn't work, if used namespaces. If namespaces removed, CC works. UserInterface UserAbstract abstract implements UserInterface User extends UserAbstracts All classes have namespace User; Methods defined in UserAbstract aren't shown in Code Completion for User $user = User() $user-> //shows only methods defined in User but no methods from parent UserAbstract see example project UserTest.php and screenshot
Created attachment 105454 [details] screenshot
I can confirm this bug
Created attachment 105931 [details] This is a patch to fix the broken code completion
how can I use this patch? Will it be integrated into official dev build?
Clone the main-golden repository hg clone http://hg.netbeans.org/main-golden netbeans-dev (1-2 hours) Apply it there cd netbeans; patch -p1 < saved.patchfile Compile the editor refer to http://wiki.netbeans.org/WorkingWithNetBeansSources This is an ugly fix and will certainly not be integrated, but it works as expected (In the auto completion window all classes will be shown with their fully qualified name: Eg: \Package\Subpackage\User.php).
Created attachment 106123 [details] This is a screenshot of how the autocompletion works now
Fixed in the web-main.
Integrated into 'main-golden', will be available in build *201102230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/5b646712b0f2 User: Petr Pisl <ppisl@netbeans.org> Log: #194836 - Code completion with namespaces for parent methods doesn't work
In the project you attached, there should be NO completion...and why? Because in your index.php file is no "namespace" or "use" clause...if you try to run that code you get "PHP Fatal error: Class 'User' not found in...". But it should work in your UserTest file (in screenshot), because there you have a right namespace declared. Now I'm fixing that behaviour...you will get NO completion if you are using a namespaced class without its namespace, but you WILL GET completion, if you do that right (with namespace).
(In reply to comment #9) > In the project you attached, there should be NO completion...and why? Because > in your index.php file is no "namespace" or "use" clause...if you try to run > that code you get "PHP Fatal error: Class 'User' not found in...". But it > should work in your UserTest file (in screenshot), because there you have a > right namespace declared. Now I'm fixing that behaviour...you will get NO > completion if you are using a namespaced class without its namespace, but you > WILL GET completion, if you do that right (with namespace). I didn't say, it should work in index.php. Wasn't this bug already resolved? See Note #8
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/d2ca240c108d User: Ondrej Brejla <obrejla@netbeans.org> Log: #194836 - Updating tests
That was just a note for myself and Petr, because he solved that "real" bug, but another bug occured, so I made some changes in tests and in behaviour, so that's why I commented this issue.