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 194836 - Code completion with namespaces for parent methods doesn't work
Summary: Code completion with namespaces for parent methods doesn't work
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: PC Windows 7
: P2 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-29 10:46 UTC by nbphpuser
Modified: 2011-09-12 08:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project (4.15 KB, application/octet-stream)
2011-01-29 10:46 UTC, nbphpuser
Details
screenshot (141.93 KB, image/png)
2011-01-29 10:49 UTC, nbphpuser
Details
This is a patch to fix the broken code completion (959 bytes, patch)
2011-02-12 15:36 UTC, catacgc
Details | Diff
This is a screenshot of how the autocompletion works now (64.84 KB, image/png)
2011-02-17 17:49 UTC, catacgc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nbphpuser 2011-01-29 10:46:54 UTC
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
Comment 1 nbphpuser 2011-01-29 10:49:59 UTC
Created attachment 105454 [details]
screenshot
Comment 2 catacgc 2011-02-11 11:55:36 UTC
I can confirm this bug
Comment 3 catacgc 2011-02-12 15:36:25 UTC
Created attachment 105931 [details]
This is a patch to fix the broken code completion
Comment 4 nbphpuser 2011-02-16 18:06:12 UTC
how can I use this patch? Will it be integrated into official dev build?
Comment 5 catacgc 2011-02-17 17:44:28 UTC
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).
Comment 6 catacgc 2011-02-17 17:49:45 UTC
Created attachment 106123 [details]
This is a screenshot of how the autocompletion works now
Comment 7 Petr Pisl 2011-02-22 13:05:58 UTC
Fixed in the web-main.
Comment 8 Quality Engineering 2011-02-23 05:29:50 UTC
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
Comment 9 Ondrej Brejla 2011-09-09 10:31:12 UTC
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).
Comment 10 nbphpuser 2011-09-09 21:40:01 UTC
(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
Comment 11 Quality Engineering 2011-09-10 14:27:41 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/d2ca240c108d
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #194836 - Updating tests
Comment 12 Ondrej Brejla 2011-09-12 08:02:29 UTC
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.