Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting when "uses" is on another line #62

Open
fizruk opened this issue Oct 23, 2023 · 1 comment
Open

Syntax highlighting when "uses" is on another line #62

fizruk opened this issue Oct 23, 2023 · 1 comment

Comments

@fizruk
Copy link
Member

fizruk commented Oct 23, 2023

Syntax highlighting currently assumes that uses (...) is on the same line as #define.
The highlighting should be more flexible.

@aabounegm
Copy link
Member

aabounegm commented Oct 23, 2023

This seems to be a limitation of TextMate grammar. According to microsoft/vscode-textmate#41 (comment), RegEx in TextMate will not match across multiple lines, meaning that all \ss in the grammar will also suffer from this problem (and indeed I see the same issue when adding a new line between #define and the definition name). This is further verified in this RegEx playground, where it successfully captured all groups of the Regular Expression.
Edit: this is also mentioned in section 12.2 of the TextMate docs

I believe it should be possible to fix it using begin and end captures, but that would probably be complicated and we might be better off adding it to the semantic highlighter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants