| Summary: | Allow case insensitive regex pattern in declarative highlight rules | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> |
| Component: | Editor | Assignee: | Grant Gayed <grant_gayed> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 5.0 | ||
| Target Milestone: | 5.0 M2 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Mark Macdonald
(In reply to Mark Macdonald from comment #0) > This request comes by way of a forum post: > http://www.eclipse.org/forums/index.php/t/576076/ The forum link should be http://www.eclipse.org/forums/index.php/t/504490/#msg_num_2 Fixed > 20140110, uses (?i). Unlike TextMate it's not supported for specific capture groups (?i:...), only for the full match, due to JS's RegExp. Commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=8b8c1b6b38313323add4d96c038513886e0c06ad . The old textMateStyler only attempted to support "(?i)" syntax in order to consume TextMate grammars with minimal modification. If I could do it over again I'd probably allow the grammar to provide regexes as an array of [pattern, flags] in addition to a simple string, like this:
> ["foo|bar", "i"]
Any thoughts on that?
(In reply to Mark Macdonald from comment #3) I'm not opposed to the alternative syntax, but think that it could infer something that's not supported. As a plug-in writer seeing it I would likely assume that any set of valid RegExp flags could be given as the second arg, but allowing this would cause problems (match/begin/end matches should not span multiple lines, 'y' would likely cause matches to be missed). So the doc for this arg would be "the flags to create the RegExp with, but can only be 'i'". For this reason I'm a bit hesitant. |