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 256471 - JSHint is having issues when 'Generate JsHint global directive'
Summary: JSHint is having issues when 'Generate JsHint global directive'
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-09 20:31 UTC by luislobo
Modified: 2016-02-03 12:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
JSHint is having issues when 'Generate JsHint global directive' (576.06 KB, application/octet-stream)
2015-11-09 20:31 UTC, luislobo
Details
Another Profile. (723.29 KB, application/octet-stream)
2015-11-09 21:09 UTC, luislobo
Details
Video of what I see happening (2.50 MB, video/ogg)
2015-11-09 21:10 UTC, luislobo
Details
Same thing does not happen in 8.0.2 (1.15 MB, video/ogg)
2015-11-09 21:45 UTC, luislobo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description luislobo 2015-11-09 20:31:16 UTC
Created attachment 157237 [details]
JSHint is having issues when 'Generate JsHint global directive'

JSHint is having issues when 'Generate JsHint global directive'

It does not take into account that /* global */ already exists.

The file is a new file, copied from an existing other (a unit test).

In a single file, there were two "global" variables. Both variables are "added" to the global directive, using the menu on the light bulb. The file is not saved between adding one and the other.

A profile is attached.
Comment 1 luislobo 2015-11-09 21:09:19 UTC
Created attachment 157238 [details]
Another Profile.
Comment 2 luislobo 2015-11-09 21:10:55 UTC
Created attachment 157239 [details]
Video of what I see happening
Comment 3 luislobo 2015-11-09 21:12:00 UTC
I found out that if I wait, the global hint is detected. May be it has to do with my other issue, about formatting being slow (#256057). Looks like something is making everything be slow.
Comment 4 luislobo 2015-11-09 21:45:12 UTC
Created attachment 157240 [details]
Same thing does not happen in 8.0.2

Same thing does not happen in 8.0.2. Check second video
Comment 5 Petr Pisl 2015-11-10 09:35:59 UTC
Thanks for reporting. I'm going to look at this. Just strange thing is that probably nobody touch the between 8.0.2 and 8.1 and the behavior is different. I will evaluate.
Comment 6 luislobo 2015-11-13 14:14:58 UTC
Thank you. It became really unusable on my side, and just reverted back to 8.0
Comment 7 Petr Pisl 2015-12-28 14:19:29 UTC
I cannot reproduce this in either trunk  neither in NB 8.1. Anyway I have improved the possible fix description to be clear global variable will be added to the global directive. 

This change is here: http://hg.netbeans.org/web-main/rev/e0c4c367620d

Both attached snapshot shows that the ide spend significant time to recognize prototype chain. From the video it looks like the file is not parsed, when the file is changed. And from your comment #3 it really looks like the parsing is not finished yet. I need to look at the method ModelUtils.findPrototypeChain
Comment 8 Petr Pisl 2015-12-28 14:55:45 UTC
http://hg.netbeans.org/web-main/rev/5e7f30c40904

These change the golden test files to reflect the last change in description.

and this http://hg.netbeans.org/web-main/rev/069741e89d68

should speed up the counting prototype chain. It will not work correctly if there will be many types. Then the another fix should be added. 

Because I'm not able to reproduce it, could I ask to verify the fixes in dev build? You can try it to download from NetBeans.org.

Thanks
Comment 9 luislobo 2015-12-28 18:08:00 UTC
OK, I'll give it a try, thanks
Comment 10 luislobo 2015-12-28 21:51:33 UTC
Wow, it is Much faster. Thank you!
Comment 11 Quality Engineering 2015-12-29 02:25:11 UTC
Integrated into 'main-silver', will be available in build *201512290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e0c4c367620d
User: Petr Pisl <ppisl@netbeans.org>
Log: #256471 - JSHint is having issues when 'Generate JsHint global directive'
Comment 12 Jiri Kovalsky 2016-01-13 10:25:01 UTC
Luis, can we consider the fix verified by you? Thanks!
Comment 13 luislobo 2016-01-13 12:57:19 UTC
Yes, I've checked it and verified it's been fixed. Thank you!
Comment 14 Petr Pisl 2016-01-22 23:23:05 UTC
Transplanted to the releases / release81:

http://hg.netbeans.org/releases/rev/c8c62ac67540
http://hg.netbeans.org/releases/rev/a812cefbb167