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.
Created attachment 146923 [details] screencast After upgrading NetBeans 8.0 All to patch1: - install NetBeans 8.0 all distro - activate PHP and JavaWeb by creating new projects - update to patch1 using catalog link from [1] code completion in JS file is missing all global objects/methods like window, Date, document etc. If I declare simple variable in JS file var a = new Date(); a. => properties/methods of Dates are not offered. Please check the screencast to see how almost empty completion is. The same happens with embedded JS in HTML file. [1] http://wiki.netbeans.org/NetBeans_80_Patch1_GoNoGo Product Version: NetBeans IDE 8.0 (Build 201403101706) Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 1 Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
Created attachment 146924 [details] IDE log
The same works in Product Version: NetBeans IDE Dev (Build 201404230001) Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
It works in 8.0 daily build as well. So it seems to be caused by the update process. Product Version: NetBeans IDE 8.0 (Build 201404240045) Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
Created attachment 146925 [details] IDE log from 8.0 daily Here's IDE log from the 8.0 daily build, versions of javascript2.* modules seems to be identical...
I have tried the build from releases/release80 and it works as well. Investigating more.
The problem is in the index. The patch of javascript editor increases the version of js index. So when the ide is restarted after update, all the sources and js stabs in folder netbeans/ide/jsstabs should be reindexed and new version of the js index should be created. I don't know the reason, but new index version 12 is not created correctly for the jsstabs zip files. There is only created folder 12 (version of the new index), which is empty. The index for sources of opened projects are created correctly. When you delete the cache dir and start the ide again, the all sources and js stabs file are reindexed again and the indexes are created correctly. Then the editor works as expected. So the question is, why the index is not created for js stabs after the update. Also I had at least two cases, when the index was created correctly during the update.
Tome, do you have an idea, why it behaves in this way?
I have switch on in JsIndexer through the -J-Dorg.netbeans.modules.javascript2.editor.index.level=FINE option, which logs what is indexed. See http://hg.netbeans.org/web-main/file/e2b219b3fab8/javascript2.editor/src/org/netbeans/modules/javascript2/editor/index/JsIndexer.java#l83 where is logged the path for the file that is indexed. In the case, when the reindexing after the update is not done correctly, the log looks INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /home/ppisl/NetBeansProjects/Angular/simpleProject/public_html took: 4,950 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms] INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 2 source roots took: 5,080 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 1 ms] INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Resolving dependencies took: 12 ms INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 0 binary roots took: 0 ms INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /home/ppisl/ide/nb8-all/netbeans/ide/jsstubs/reststubs.zip took: 25 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms] INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /home/ppisl/ide/nb8-all/netbeans/ide/jsstubs/domstubs.zip took: 34 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms] INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /home/ppisl/ide/nb8-all/netbeans/ide/jsstubs/corestubs.zip took: 15 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms] INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 3 source roots took: 74 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms] Notice the time of indexing reststubs.zip took: 25 ms, domstubs.zip took: 34 ms and corestubs.zip took: 15 ms. The times are fast, and the js indexer was not called for the files. In the case when it works correctly the log looks: INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /home/ppisl/NetBeansProjects/Angular/simplePro ject/public_html took: 5,388 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 1 ms] FINE [org.netbeans.modules.javascript2.editor.index.JsIndexer]: Indexing: jsstubs/stub_DOM_Crypto.js, fullPath: jsstubs/stub_DOM _Crypto.js ... INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /home/ppisl/ide/nb8-all/netbeans/ide/jsstubs/reststubs.zip took: 632 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms] FINE [org.netbeans.modules.javascript2.editor.index.JsIndexer]: Indexing: jsstubs/stub_DOM_AbstractView.js, fullPath: jsstubs/stub_DOM_AbstractView.js ... INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /home/ppisl/ide/nb8-all/netbeans/ide/jsstubs/domstubs.zip took: 1,136 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms] FINE [org.netbeans.modules.javascript2.editor.index.JsIndexer]: Indexing: jsstubs/stub_CORE_unescape.js, fullPath: jsstubs/stub_CORE_unescape.js ... INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /home/ppisl/ide/nb8-all/netbeans/ide/jsstubs/corestubs.zip took: 268 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms] INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 5 source roots took: 7,734 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 3 ms] Notice that the time of indexing the stabs are longer reststubs.zip took: 632 ms, domstubs.zip took: 1,136 ms and corestubs.zip took: 268 ms. Also there are fine logs from the JsIndexer, that the files are indexed. So it looks like the RepositoryUpdater doesn't call the JsIndexer in such case. It looks like problem in the RepositoryUpdater.
It's because the stubs.zip timestamp does not changed and also it's not registered in the GPR on when indexer fires its version has changed. The stubs.zip are registered much later when first request on javascript indexer is done.
Thanks Tomas, now I understand. Unfortunately I don't see, what I can do with this except to don't register the stabs lazy. But there is reason, why these stubs are registered lazy.
Ok now we have a workaround. I have created the js stubs zipfiles, where all the stub files have changed timestamps. So the indexer repository will refresh them even if they will not be registered in GPR yet, because it looks lie they are changed. In fact there was changed only the timestemp, no content. The new stub files are uploaded to the external binaries, so the patch only includes change in the binaries-list file. It's committed now to the web-main: http://hg.netbeans.org/web-main/rev/b140e2069538 The stub files are a part of the javascript editor nbm. I attach the nbm that is build from releases/release80 branch and you can test it.
Created attachment 146941 [details] nbm file with the changed timestamps of stub files It
Created attachment 146942 [details] nbm file with the original stub file. This is for testing purposes. When you take NB 80 and install this nbm file (which is a part of the patch) then you should be possible to reproduce the issue. When you install the nbm with the changed timestamps, you should not.
Thank you, I've tried 5 times the "good" nbm (install full distro, activate something, install nbm) and it worked every time. I tried the "bad" nbm as well and reproduced the issue on it every time. Verified. Please integrate to releases. Thanks
Transplanted to the releases/release80
Verified in patch, thank you Product Version: NetBeans IDE 8.0 (Build 201403101706) Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 1 Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)