Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347486 - Syntax highlighter does not apply all relevant rules per line
Summary: Syntax highlighter does not apply all relevant rules per line
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Mark Macdonald CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 13:20 EDT by Karol Gusak CLA
Modified: 2011-09-01 11:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karol Gusak CLA 2011-05-27 13:20:39 EDT
textMateStyler.js seems to not color some keywords it should. Initially I thought that it applies only one distinct rule per line, but it's more complicated.

Steps to reproduce:
1. Open / create .html file
2. Start typing "<!-- test --> <test />"
3. As soon as the test tag is picked up, the comment coloring disappears
4. Start typing "<test attr="val" attr2="val" />"
5. The attr2 is never colored, while val2 is at first, but disappears after closing the test tag
Comment 1 Mark Macdonald CLA 2011-05-30 17:26:03 EDT
The styler is always trying the subrules in order, and then choosing the first subrule that matches, regardless of the match's position in the line. Instead it should apply all the subrules and take the rule with the leftmost match.
Comment 3 Karol Gusak CLA 2011-06-02 13:08:03 EDT
Ahh, I was just preparing a patch - but the committed solution is way better!

PS: Are the begin/end patterns supported already? Did you forgot to update the doc comment?
Comment 4 Mark Macdonald CLA 2011-06-02 13:52:39 EDT
(In reply to comment #3)
> PS: Are the begin/end patterns supported already? Did you forgot to update the
> doc comment?

Yes, begin/end are supported now. I just marked Bug 345191 as 'fixed'. (As I mentioned in that bug: there are still issues with the repairer which I will be fixing over the next few days.)

>  Did you forgot to update the doc comment?

Opened Bug 348115 for updating TextMateStyler JSDoc. For now, most of it is removed. (Also, note that the docs on orion.eclipse.org are only updated when a good I-build is pushed to that server, so they will always lag behind the latest code in Git.)

In the meantime, I'll add comments to the bugs as I fix more stuff. I'm now marking them with [textmatestyler] so a search like this will show relevant open bugs:

https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;short_desc=textmatestyler;bug_status=UNCONFIRMED;bug_status=NEW;bug_status=ASSIGNED;bug_status=REOPENED;short_desc_type=allwordssubstr;component=Orion;product=e4