| Summary: | Improved CSS syntax highlighting | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mihai Sucan <mihai.sucan> |
| Component: | Editor | Assignee: | Mark Macdonald <mamacdon> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, john.arthorne, mamacdon, mihai.sucan, Silenio_Quarti, simon_kaegi |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Mihai Sucan
This is a cross-post from: https://bugzilla.mozilla.org/show_bug.cgi?id=680465 Our basic syntax highlighter should be fixed ASAP but we're also looking at deeper tools here. e.g. validation would be nice... I think Mark owns the CSS content assist component. The CSS syntax highlight belongs to SSQ and FH (it is part of examples.textview.TextStyler). Reassigning to SSQ. If Simon is asking to Mark to provide a new CSS syntax highlighter then please reassign this back to Mark. The main focus for this bug should be providing a CSS syntax highlighter that works better. Would a TextMate grammar work for this? Or is that a performance problem? I released a band-aid in the sample styler to stop highlighting single line comments, but the long term solution here is to replace this styler with either a textmate styler or one based in the code mirror modes. Changes mentioned above http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=090b7255ae9cde277721acd404dfaa2158bdd9e8 Found a case where the styler would not highlight a multiline comment. I believe this is what this comment talks about. https://bugzilla.mozilla.org/show_bug.cgi?id=680465#c0 Steps: 1) Start with an empty file (or type at the end of a file) 2) Type "/*" to start a comment 3) Type ENTER 4) Type some chars The chars in step 4) should be highlight but are not. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=be372554f725dcac2fabc46ebd10ea58a063831b Silenio: thanks for your fixes! (In reply to comment #8) > Silenio: thanks for your fixes! Can we close this bug as fixed or reassign it to Mark (for the new css syntax highlighter) ? (In reply to comment #9) > (In reply to comment #8) > > Silenio: thanks for your fixes! > > Can we close this bug as fixed or reassign it to Mark (for the new css syntax > highlighter) ? I assume reassigning to Mark makes sense. The current fixes are workarounds to get us forward a bit with Orion in Firefox 11 - for which we are grateful - thank you! Another stop-gap patch: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=b318c3a8d5abde2d1c9d2dd2bb0dd16c76a6240d (until the the new CSS syntax highlighter will become available) This time we really needed to highlight the majority of known CSS keywords, in the Style Editor we are shipping in Firefox 11. This patch has already landed downstream (in the Mozilla Firefox codebase). I hope this is fine. I landed it in the Orion repository because we are going for another Orion upstream update - this time we are taking in the code for the debugger ruler (new feature for us). We try to keep away forking our Orion copy. Thank you! Thank you Mihai Mark are we planning anything more here for 0.4? I'm guessing the CodeMirror styler is the direction to go here. (In reply to comment #13) > Mark are we planning anything more here for 0.4? I'm guessing the CodeMirror > styler is the direction to go here. Nothing more here for 0.4. And yes: you can get pretty good CSS highlighting today by using a CodeMirrorStyler in conjunction with css.js from CodeMirror. (In reply to comment #14) > (In reply to comment #13) > > Mark are we planning anything more here for 0.4? I'm guessing the CodeMirror > > styler is the direction to go here. > > Nothing more here for 0.4. > > And yes: you can get pretty good CSS highlighting today by using a > CodeMirrorStyler in conjunction with css.js from CodeMirror. Has CodeMirrorStyler landed in the Orion repository? Are there any known performance concerns with the CodeMirrorStyler? Is the code license compatible with BSD? (In reply to comment #15) > Has CodeMirrorStyler landed in the Orion repository? Are there any known > performance concerns with the CodeMirrorStyler? Is the code license compatible > with BSD? No it hasn't. it is currently still on GitHub: https://github.com/mamacdon/orion-codemirror The license is compatible, but Eclipse Foundation is concerned about provenance because the project doesn't keep track of who the contributors were (prior to its move to GitHub). We're trying to work that out. Whether that is acceptable to Mozilla is a separate question I guess. (In reply to comment #16) > (In reply to comment #15) > > Has CodeMirrorStyler landed in the Orion repository? Are there any known > > performance concerns with the CodeMirrorStyler? Is the code license compatible > > with BSD? > > No it hasn't. it is currently still on GitHub: > > https://github.com/mamacdon/orion-codemirror > > The license is compatible, but Eclipse Foundation is concerned about provenance > because the project doesn't keep track of who the contributors were (prior to > its move to GitHub). We're trying to work that out. Whether that is acceptable > to Mozilla is a separate question I guess. To be clear, the CodeMirrorStyler has landed in Orion (see mirror.js) -- but it does not include any code from the CodeMirror project for the reason John explained. The CodeMirrorStyler is just a driver. To make it useful you'd need to combine it with one of the language modes from the CodeMirror project (see [1]). > Are there any known > performance concerns with the CodeMirrorStyler? Nothing known, although CodeMirrorStyler hasn't yet been as thoroughly performance tested as TextStyler. [1] https://github.com/marijnh/CodeMirror2/tree/master/mode Thanks for your answers. I will contact the right people within Mozilla to check if we can integrate code from CodeMirror2 into the Firefox codebase. I hope we can, so we can use their syntax highlighter for CSS. If we can do that, do you guys recommend we switch to CM2-based syntax highlighters for JS and HTML as well? (In reply to comment #18) > Thanks for your answers. > > I will contact the right people within Mozilla to check if we can integrate > code from CodeMirror2 into the Firefox codebase. I hope we can, so we can use > their syntax highlighter for CSS. > > If we can do that, do you guys recommend we switch to CM2-based syntax > highlighters for JS and HTML as well? CM2's HTML mode is worth trying -- it's much more comprehensive than the sample htmlGrammar. As for JS, the TextStyler currently provides a few unique features: coloring of JSDoc tags and HTML markup within comments, comment folding and TODOs (if AnnotationModel is used), and brace/paren matching. If those are important to you, you'll want to stick with TextStyler for the time being. Changing title because original reported problem with comments was addressed. This has been addressed by bug#421274. *** This bug has been marked as a duplicate of bug 421274 *** |