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 246376 - NetBeans code completion for the global reference but not the local reference
Summary: NetBeans code completion for the global reference but not the local reference
Status: NEW
Alias: None
Product: web
Classification: Unclassified
Component: AngularJS (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-11 01:38 UTC by skomisa
Modified: 2015-09-09 11:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screen shot of code completion for "name" in AngularJS HTML file. (70.46 KB, image/png)
2014-08-11 01:38 UTC, skomisa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description skomisa 2014-08-11 01:38:04 UTC
Created attachment 148625 [details]
Screen shot of code completion for "name" in AngularJS HTML file.

This bug relates to the Synergy test "Code completion in expressions" for AngularJS here:
  http://services.netbeans.org/synergy/client/app/#/assignment/1091/v/1

The expected result for this test is as follows: "Properties like lastName, name or help are offered because they are used in source".

All of that is true, but in the case of "name" it happens to be defined globally as part of the JS Platform in addition to being defined locally as a property of $scope within File.js.

However, when code completion is done on "name" only the global definition of "name" is offered. See the attached screen shot.

In this situation shouldn't NetBeans offer code completion for both the local and global instances, or alternatively, indicate that name exists in multiple scopes? I realize that doesn't matter for the purpose of code completion, but it is still misleading for NetBeans to be reporting that "name" only exists as a global.


Product Version: NetBeans IDE Dev (Build 201408100001)
Java: 1.8.0_20-ea; Java HotSpot(TM) 64-Bit Server VM 25.20-b22
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-ea-b23
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\JohnDoe\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\JohnDoe\AppData\Local\NetBeans\Cache\dev
Comment 1 Vladimir Riha 2014-08-11 06:57:12 UTC
I guess you mean the suite "Completion without controllers" [1], right? I can reproduce it there

If controllers are properly defined, it works for me (both "name" are offered). As written in the suite, without knowing relation between HTML and Controllers, features are limited but I guess IDE could offer name and shows that it comes from the HTML file


[1] http://services.netbeans.org/synergy/client/app/#/suite/1386/v/1
Comment 2 skomisa 2014-08-11 08:25:59 UTC
(In reply to Vladimir Riha from comment #1)
> I guess you mean the suite "Completion without controllers" [1], right? I
> can reproduce it there
> 
> If controllers are properly defined, it works for me (both "name" are
> offered). As written in the suite, without knowing relation between HTML and
> Controllers, features are limited but I guess IDE could offer name and shows
> that it comes from the HTML file
> 
> 
> [1] http://services.netbeans.org/synergy/client/app/#/suite/1386/v/1

Correct. I am referring to the test "Code completion in expressions" within test suite "Completion without controllers".

I did notice somewhere during the testing (I can't recall where) that code completion had identified multiple sources for the same name, so it seemed odd that code completion could not locate the local instance of "name" for this test. 

But no big deal, since the text that gets written by code completion is obviously going to be the same regardless of the context in which a name is found.
Comment 3 Vladimir Riha 2014-08-11 08:36:22 UTC
Yes, it works if IDE is capable of identifying controller for given partial. But in this case, there is no relation between controller function and partial file (no routing, no ng-controller element...)