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.
In HTML editor I update the syntax coloring based on HTML parser results. The parser currently finds <script>...</script> tag and creates custom javascript embedding for this part by tokenSequence.createEmbedding(javascriptLanguage, 0, 0); The embedding is created (the token contains the sub-tokens) but the editor coloring stays unchanged. Please look at EmbeddingUpdater class in html/editor module to find more and possibly debug. Please try to fix the problem ASAP or let me know how I can handle it. Thanks.
I've done some investigation and found the following. First, the javascript snippets in html are colored, but their coloring is not accurate. The problem is not in the syntax highlighting layer nor it is in your code that creates the custom embedding. The problems are two: 1. As per the general concept text/javascript defines only a few colorings (js_regularExpression, s_p, method, localVariable) and the definitions are only partial (eg. +bold or fgColor). That's exactly how it should be and all works fine for standalone .js files. With embedded javascript the problem is that the defaults for its colorings are not inherited from 'All Languages', but from text/html. That's why, for example, all operators (eg. =()@) are green, because they are green in HTML. Although I am not sure about the solution, the problem here is in the inheritance hierarchy I think. I have an odd feeling that the deep inheritance hierarchy as it is defined today is not very practical. Perhaps we should stick to something as simple as: text/html/text/javascript text/javascript / On the other hand this would break the use of trivial embeddings like java strings, javadocs, etc that people got already used to. 2. Second problem is that some of the colorings in javascript are based on the shliemann parser and the javascript grammar (eg. bold function names or brown function parameters). Since the schliemann parser ignores html files these colorings do not work in embedded javascripts. I am affraid that the scope of this problem and its solution is out of my understanding. I'll leave this defect with editor to fix the inheritance hierarchy, but I would suggest to file another one for #2 against the languages module.
The change in the MimeLookup hierarchy as described in issue #108173 is pretty much what I suggested here in #1. *** This issue has been marked as a duplicate of 108173 ***