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 171185 - Code completion does not suggest names for overrided attributes and functions
Summary: Code completion does not suggest names for overrided attributes and functions
Status: RESOLVED WONTFIX
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-31 15:35 UTC by Alexandr Scherbatiy
Modified: 2011-05-16 13:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2009-08-31 15:35:01 UTC
Steps to reproduce:

- Copy the code to the editor:
---------------------------------------------------------
public class A{
    public var attr: Number;

    public function f () {  }
}

public class C extends A{


}

---------------------------------------------------------

- Position the cursor to the scope of C class and type 'override var'
---------------------------------------------------------
public class C extends A{

    override var 
}
---------------------------------------------------------

- Press <Ctrl + space>

The 'attr' attribute is not suggested

The same is for the function name:

---------------------------------------------------------
public class C extends A{

    override function
}
---------------------------------------------------------
Comment 1 Anton Chechel 2009-08-31 15:40:26 UTC
Reassigned to Petr Nejedly, owner of code completion.
Please assign all further code completion issues to him.
Comment 2 Petr Nejedly 2009-10-14 11:14:52 UTC
Overriden vars (currently) have different AST tree kind (not a VariableTree). This is a known issue with the compiler.
We've been promised a possibility of parser change that would get the overriden variables in line with normal variables,
but the target milestone for such a change is open.
Comment 3 Petr Nejedly 2009-11-11 05:59:47 UTC
Updated compiler now makes overriden variable a VariableTree, but it caused NPE in completion code (as the overriden variable tree can't have a Type tree associated). The NPE is fixed in http://hg.netbeans.org/javafx/rev/b7e3787b5b3d
so that it now partially works in case the identifier is at least started:

public class C extends A{
    override var a|
}
Comment 4 Petr Nejedly 2009-11-11 06:16:28 UTC
Added a test covering both NPE and the already working subcase to prevent regressions.
http://hg.netbeans.org/javafx/rev/19664d6168b4
Comment 5 Petr Nejedly 2009-11-13 03:50:50 UTC
The remaining part is rather P3. What is missing is filtering the identifiers to the things that could really be overriden (i.e. superclass members). And also recognizing the construct in case there's no identifier yet, but that may be covered by some work Jan did yesterday (there was a bug in sanitization).
Comment 6 Petr Nejedly 2010-09-24 11:45:00 UTC
Reassigning javafx bugs to Adam.
Comment 7 David Strupl 2011-05-16 13:49:34 UTC
Closing all bugs filed against JavaFX 1.x as wontfix. We will support JavaFX 2.0 - please keep opened only bugs against the new release. Thanks.