You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/10/20 09:15:03 UTC

[GitHub] [netbeans] qmegas opened a new issue, #4825: Javascript: global variable is not declared bug

qmegas opened a new issue, #4825:
URL: https://github.com/apache/netbeans/issues/4825

   ### Apache NetBeans version
   
   Apache NetBeans 15
   
   ### What happened
   
   Since version 15 global variables like `window` and `document` were removed from the list of known global variables (PR #4252). So once upgrading to version 15 we got that confusing situation:
   
   <img src="https://user-images.githubusercontent.com/2444896/196906099-4274d0e8-8008-4edc-810e-7261d3f672f5.PNG">
   
   Variables which are really well known as global variables are flagged as "not declared", but at the same time variables like `jQuery` and `$` which are still in the list, but at the same time not necessarily present in the project, are not flagged.
   
   
   ### How to reproduce
   
   Example code:
   
   ```js
   function demo() {
   	window.confirm("Really search?");
   	document.querySelectorAll("textarea");
   	console.log('Test');
   	jQuery('#test');
   	$('#test2');
   }
   ```
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 14
   
   ### Operating System
   
   Windows 10
   
   ### JDK
   
   16.0.1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   I'm not java developer, but I guess that change that caused that done here https://github.com/apache/netbeans/pull/4252/files#diff-8c9ba7db442e02c9ff8534e66cc66c1ce317ed3f3dd8375657d579c4cc2728b4L62
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] qmegas commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
qmegas commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1293282625

   I'm understand why it happens, I also not sure if it's a bug. But one thing for sure: it's absolutely not obvious for user that changing ignoring pattern may impact indexing of built-in list of functions. Something definitely should be changed there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1285931792

   Please show your message log. This is not reproducible on master.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] qmegas commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
qmegas commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1289168254

   After long search succeeded to reproduce the problem... problem appears when changing ignoring files pattern from default one:
   ```
   ^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(git|hg|svn|cache|gradle|DS_Store)$|^Thumbs.db$
   ```
   to one that migrates for me from NB 8:
   ```
   ^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!(htaccess|git.+|hgignore)$).*$
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] qmegas commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
qmegas commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1286747518

   Surprisingly when doing a clean install the problem gone, but when on first run importing settings from previous NB installation (in my case NB 14) then the problem appears.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1288136368

   Still missing an error indicator. I see two further options:
   
   1. You provide detailed steps which I can follow to reproduce the problem starting with an empty userdir
   2. You try to debug the issue by stepping through `org.netbeans.modules.javascript2.editor.hints.GlobalIsNotDefined` - the hint should be generated there and it would be interesting to know the values of `findByFqnOnWindow` and `findByFqnPlain` for the variables `window`, `console` and `document`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] qmegas commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
qmegas commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1285948875

   [messages.log](https://github.com/apache/netbeans/files/9832779/messages.log)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] qmegas commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
qmegas commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1288053750

   In my case I do have additional items in `segments` file, it was added manually by me via "Global includes path" in PHP settings panel. For the experiment I removed these paths and deleted index directory and restarted NB again. The problem still presents however in `segments` file there were only two files `/webcommon/jsstubs/core-stubs.zip` and `/webcommon/jsstubs/dom-stubs.zip` both related to NB 15


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1285993181

   Please run netbeans from commandline with the arguments and test again:
   
   ```
   C:\Program Files\NetBeans-15\bin\netbeans64.exe --userdir C:\Users\Qmegas\AppData\Local\NetBeans\test --cachedir C:\Users\Qmegas\AppData\Local\NetBeans\test
   ```
   
   This will invoke NetBeans with a clean userdir. This should not matter, but ...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1289451747

   Thank you - and this is that happens: The problematic pattern is:
   
   ```
   ^\\.(?!(htaccess|git.+|hgignore)$).*$
   ```
   
   This pattern matches all dot files apart from:
   
   - `.htaccess`
   - `.hgignore`
   - `.git` (followed by any character)
   
   So you are also excluding the file: `._.js`, which holds the global definitions. I'm not sure yet, whether I consider this a bug or "works as designed".


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1288114839

   Sorry, this should generate additional logging - please see if so and if so, get it here. Thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] qmegas commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
qmegas commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1288115724

   [messages.log](https://github.com/apache/netbeans/files/9846692/messages.log)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1287682832

   I now tried to reproduce again and fail. I used NetBeans 14 to create a userdir and imported it into a master build, while JS failed to properly startup on first call (known problem of CSL), after restart all was ok.
   
   Sorry about that as this makes diagnosis very hard. Could you please test import of settings and then remove the "index" directory from the cache directory? In my case the cache was not imported, but maybe this is different for you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] qmegas commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
qmegas commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1288109569

   That didn't helped, still see warning hints.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #4825: Javascript: global variable is not declared bug

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4825:
URL: https://github.com/apache/netbeans/issues/4825#issuecomment-1288102804

   That parts looks sane. Could you please see what you get when running the broken installation with:
   
   ```
   -J-Dorg.netbeans.modules.javascript2.model.api.Index.level=FINEST -J-Dorg.netbeans.modules.parsing.spi.indexing.support.QuerySupport.level=FINEST
   ```
   
   I still don't see a connection between updating and this failure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists