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.
Build: NetBeans IDE Dev (Build javascript2-frameworks-1960-on-20160603) VM: Java HotSpot(TM) 64-Bit Server VM, 25.91-b14, Java(TM) SE Runtime Environment, 1.8.0_91-b14 OS: Windows 8.1 User Comments: jskrivanek: I did: - create new java project - create new JSON file from template Stacktrace: java.lang.NullPointerException at org.netbeans.modules.javascript2.editor.JsStructureScanner.foldsJson(JsStructureScanner.java:351) at org.netbeans.modules.javascript2.editor.JsStructureScanner.folds(JsStructureScanner.java:296) at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.scan(GsfFoldManager.java:528) at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.access$100(GsfFoldManager.java:268) at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask$1.run(GsfFoldManager.java:434) at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:609)
Created attachment 159979 [details] stacktrace
In this case the javascript features are not enabled yet. The question is, whether the javascript and json templates should be available at this moment. I have find out that org.netbeans.lib.lexer.LanguageManager, creates in such case NO_LANG language and store it to the cache for the text/x-json mimetype. This no language is created before the javascript functionality is enabled and because the LanguageManger cache is not cleared, the no language is keep until you will restart the ide. After enabling the js features, the other languages are created correctly. If you create new javascript file before enabling js features, then json works correctly, but javascript editor does not work until restart. So IMHO the problem is that LanguageManager is asked for the text/x-json too early and it cannot find the right provider, so it creates NO_LANG, which stores to the cache, which is not refreshed, when the enabling features is done. The problem appears now, because I have moved javascript functionality from IDE cluster to the webcommon cluster. Svato, Milo: Any ideas?
Apologies; wrong categorization. While the situation could be possibly handled in Lexer API (lexer Mime provider does not listen on Language/LanguagesEmbeddingMap changes and does not refire events), I believe the proper place to fix the issue is ergonomics: the first Lookup for e.g. Language on a MimePath should be consistent with the subsequent ones - so the lookup for the Language should trigger loading of the appropriate cluster. Jardo - please advise.
Created attachment 160369 [details] stacktrace create json file
Created attachment 160371 [details] stacktrace swith editor with empty json file
Created attachment 160372 [details] stacktrace type char in empty json file
This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=224383
Created attachment 162351 [details] stacktrace opening an empty 'JSON' file
Created attachment 163616 [details] stacktrace I was selecting a opened file form the dropdown at the top right of the editor panel
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=224383