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 231923 - ExtJS: Class could break resolving of previously defined class
Summary: ExtJS: Class could break resolving of previously defined class
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks: 237939 237938
  Show dependency tree
 
Reported: 2013-06-27 11:49 UTC by Vladimir Riha
Modified: 2013-11-15 09:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (46.01 KB, text/x-log)
2013-06-27 11:49 UTC, Vladimir Riha
Details
test case (2.50 KB, text/plain)
2013-11-04 06:33 UTC, mikecar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2013-06-27 11:49:24 UTC
Created attachment 136404 [details]
IDE log

Please try this:


Ext.define('My.app.Panel', {
    constructor: function(config) {
    }
});

Ext.define('My.app.PanelPart2', {
    override: 'My.app.Panel',
    constructor: function(config) {
    }
});


I think this should be valid code, but:
- Navigator shows only My.app.PanelPart2
- My.app.Panel is not recognized at all (string 'app.Panel' on first line is plain string and 'My.' is purple, no code completion..)

The workaround it to split to files or use My.app.Panel and My.app2.Panel or omit the "app" middle part at all


Product Version: NetBeans IDE Dev (Build web-main-10912-on-20130626)
Updates: Updates available
Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Linux version 3.2.0-45-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 mikecar 2013-10-23 16:23:05 UTC
This is affecting me as well, and since my projects uses 3-part class names,
the workaround is not an option. This should be easy to fix, as long as someone decides to spend some time on it....
Comment 2 Vladimir Riha 2013-10-29 07:15:19 UTC
I don't think this is P1, perhaps P2
Comment 3 Petr Pisl 2013-11-01 09:08:39 UTC
Fixed in web-main: http://hg.netbeans.org/web-main/rev/3ae7c1a6e63b

You can test it in the next daily build. Thanks.
Comment 4 mikecar 2013-11-04 06:33:09 UTC
Created attachment 141811 [details]
test case

not quite fixed. see attachment case, the first Ext.define declaration is not parsed.
Comment 5 Vladimir Riha 2013-11-04 08:03:04 UTC
I can confirm, first class is now visible in Navigator, but code completion does not fully work, e.g. with code from description

My.app.

does not offer Panel and "app" in 2nd definition is orange.

Product Version: NetBeans IDE Dev (Build 201311040001)
Product Version: NetBeans IDE Dev (Build web-main-11890-on-20131102)

Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 6 Petr Pisl 2013-11-04 10:40:38 UTC
I have looked at the problem closer and there are more problems. The coloring I have separated into issue #237938. The problem with cc is tracked here and there is one more problem with occurrences - issue #237939.
Comment 7 Vladimir Riha 2013-11-04 11:21:28 UTC
Thank you, I noticed some automated tests [1] started to fail as well, basically code completion for "obj." or "My." and its members does not work in following code. Should I report it as well or is it covered by these issues?

[1] http://test4u.cz.oracle.com/view/NetBeans%20Trunk/job/JavaScript.Editor-trunk/lastCompletedBuild/testReport/


Sample code:
====================
function SubClass() {
    this.parent = "MyAwesome";
    this.init = function() {
    };
}

Ext.define('My.awesome.Class', {
    child: new SubClass(),
    someProperty: 'something',
    someMethod: function(s) {
        alert(s + this.someProperty);
    }


});
var obj = new My.awesome.Class();
Comment 8 Petr Pisl 2013-11-04 13:30:48 UTC
The cc should be fixed now: http://hg.netbeans.org/web-main/rev/b77653893db2

The latest fix, should also fix the case that Vlada mentioned.
Comment 9 Quality Engineering 2013-11-05 03:31:29 UTC
Integrated into 'main-silver', will be available in build *201311050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b77653893db2
User: Petr Pisl <ppisl@netbeans.org>
Log: #231923 - ExtJS: Class could break resolving of previously defined class
Comment 10 Vladimir Riha 2013-11-05 09:28:38 UTC
Thank you, verified in trunk

Product Version: NetBeans IDE Dev (Build 201311050001)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 11 Petr Pisl 2013-11-12 15:16:25 UTC
The changes transplanted to the releases:
http://hg.netbeans.org/releases/rev/9647f9f34536
http://hg.netbeans.org/releases/rev/2f652956b20c
Comment 12 Vladimir Riha 2013-11-15 09:50:04 UTC
Case from description, comment #5 and comment #7 are OK in patch, verified 

Product Version: NetBeans IDE 7.4 (Build 201311142201)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)