-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
E-has-instructionsIssue has some instructions and pointers to code to get startedIssue has some instructions and pointers to code to get startedE-medium
Description
The highlight function currently returns a Vec<HighlightedRange>. However, those highlighting ranges can be nested. I believe that for something like #[cfg(feature = "foo")] we produce the range for the whole attribute, and then, separately, a range for a string literal.
It seems like all the clients of syntax highlighting actually want a flat list of highlights. We should refactor highlight so that it produces such flat list. One obvious way to do this is to post-process the current return type, but, given that internally we walk the tree in dfs manner, perhaps we can just not produce nested things in the first place?
The relevant code is here:
Metadata
Metadata
Assignees
Labels
E-has-instructionsIssue has some instructions and pointers to code to get startedIssue has some instructions and pointers to code to get startedE-medium