You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TextMate grammar regexes able to only match a single line #32
Uh, that's unfortunate. So I guess making really good TextMate grammars is impossible for certain languages. I encountered this issue when trying to develop a grammar for CMake, where commands are often long and are split onto many lines.
Would it be maybe possible to consider supporting a special value or property to allow multiline regexes? Ie. multiline: true would enable multiline regex matching in the current and sub-scopes, unless explicitly disabled again.
This would prove very useful in languages that may have commands on multiple lines and for making better highlighting through grammar files. Ie. some languages have special constants that are only accepted by a single command, so you wouldn't want to highlight them anywhere else, except when they're being passed to that command.
Monarch definitely seems more flexible and usable than TextMate for such grammars. Though an actual API for parsing and highlighting would be even better.
There does seem to be a feature requests for this in microsoft/vscode#216. I guess I'll have to wait and live until someone actually implements a better way to do this.
Activity
tambry commentedon Jan 3, 2017
Uh, that's unfortunate. So I guess making really good TextMate grammars is impossible for certain languages. I encountered this issue when trying to develop a grammar for CMake, where commands are often long and are split onto many lines.
Would it be maybe possible to consider supporting a special value or property to allow multiline regexes? Ie.
multiline: truewould enable multiline regex matching in the current and sub-scopes, unless explicitly disabled again.This would prove very useful in languages that may have commands on multiple lines and for making better highlighting through grammar files. Ie. some languages have special constants that are only accepted by a single command, so you wouldn't want to highlight them anywhere else, except when they're being passed to that command.
tambry commentedon Jan 4, 2017
Monarch definitely seems more flexible and usable than TextMate for such grammars. Though an actual API for parsing and highlighting would be even better.
There does seem to be a feature requests for this in microsoft/vscode#216. I guess I'll have to wait and live until someone actually implements a better way to do this.