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 258213 - Autocompletion in a php class declaration does not work on "use traitName"
Summary: Autocompletion in a php class declaration does not work on "use traitName"
Status: RESOLVED DUPLICATE of bug 248884
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
Depends on:
Reported: 2016-03-02 14:00 UTC by xprt64
Modified: 2016-03-14 04:55 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

IDE log (382.36 KB, text/plain)
2016-03-02 14:00 UTC, xprt64

Note You need to log in before you can comment on or make changes to this bug.
Description xprt64 2016-03-02 14:00:17 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Linux version 4.2.0-32-generic running on amd64
Java; VM; Vendor = 1.8.0_60
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.60-b23

Reproducibility: Happens every time

  * Create a PHP class
  * Create a PHP trait
  * In the PHP class, type 'use' then start to type the trait name
 * The autocompletion does not contain the trait name, only other PHP classes

  * The autocompletion should contain all the traits that start with the typed string
Comment 1 xprt64 2016-03-02 14:00:22 UTC
Created attachment 158714 [details]
IDE log
Comment 2 junichi11 2016-03-05 05:23:26 UTC
I cannot reproduce it if it means the following case:

trait MyTrait {
    public function traitMethod() {

class MyClass {
    use | // here: contains a trait(MyTrait) in the CC list

my envirionment:
Product Version: NetBeans IDE 8.1 (Build 201510222201)
Java: 1.8.0_74; Java HotSpot(TM) 64-Bit Server VM 25.74-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_74-b02
System: Linux version 3.13.0-79-generic running on amd64; UTF-8; 

Can you attach/write a simple reproducible project/code? (also a screenshot if possible)

Comment 3 xprt64 2016-03-08 08:18:32 UTC
I figured out how to reproduce BUT what I wanted is not *legal* from the point of view.
To reproduce, one must type a second use statement inside the class:

class MyClass
    use MyTrait1; //the auto-completion for this works fine
    use MyTrait2;//the auto-completion for this does not contain the available traits declared throughout the project

The PHP code compiles fine with multiple use trait statements but states that multiple traits go all in one line: "Multiple Traits can be inserted into a class by listing them in the use statement, separated by commas."

So this is not a bug/defect, the IDE is just conforming the PHP documentation.
Comment 4 junichi11 2016-03-09 03:09:46 UTC
It's reproducible. Thanks!
Comment 5 junichi11 2016-03-14 04:55:21 UTC

*** This bug has been marked as a duplicate of bug 248884 ***