| Summary: | Syntax highlighter should be moved to a common place. | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | libing wang <libingw> |
| Component: | Client | Assignee: | Mark Macdonald <mamacdon> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mamacdon |
| Version: | 0.3 | ||
| Target Milestone: | 0.4 RC1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
libing wang
Bug 370126 may also require this. One more thing not sure : If there are 1000 lines in the file but I only use 5 lines, will the syntax highlight work ? (In reply to comment #1) > Bug 370126 may also require this. > One more thing not sure : > If there are 1000 lines in the file but I only use 5 lines, will the syntax > highlight work ? In the general case, no -- you won't get a correct result with just a snippet of the file. But it might be good enough for a preview. I moved the 'syntaxHighlighter' object that was declared in setup.js (and copied in a few other places) into its own class. That class is shared between setup, search, and compare-container. This should allow the latter 2 places to automatically pick up additional language grammars that are plugged in or new content types that are registered. At the moment it's very simple: it picks an appropriate styler for a content type, taking into account registered highlight provider services. (Note however, that you can't currently use the orion-codemirror plugin to style anything but the file editor on the coding page, see bug 370286.) [1] http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6bcb13d0739b534c47f4f77104b268afc90bfa4e [2] http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=cabea058a81517f5b111acf53adeac47528d1016 |