Syntax highlighting for javascript file looks off when opening stylesheets before
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(Not tracked)
People
(Reporter: ochameau, Unassigned)
Details
STR
- open http://techno-barje.fr/
- with stylesheets enabled, open document.css in the debugger => the css syntax highlighting looks correct
- now, open loader.js => the syntax highlighting is wrong, may be using css one?
If you open loader.js right away, on debugger opening, the syntax highlighting is correct.
Comment 1•2 days ago
|
||
| frontend-triage | ||
setText() in Editor/index.js calls editor.setMode(SourceEditor.modes.css) for stylesheets but never switches back for other sources. The single shared editor from create-editor.js therefore keeps the CSS language compartment for every source opened after a stylesheet. This regressed in bug 2011550.
Fix: Always call setMode() with selectedSource.isStyleSheet ? modes.css : modes.javascript, and extend browser_dbg-stylesheets.js to select a .css source and then a .js source, asserting getEditorFileMode(dbg) after each.
Suggested severity: S3. Every JS source opened after a stylesheet gets the wrong highlighting until the toolbox is reopened, which hurts readability but does not stop debugging.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.
Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.
Updated•1 day ago
|
Comment 2•1 day ago
|
||
This is going to be fixed by Bug 2083536
Description
•