-
Notifications
You must be signed in to change notification settings - Fork 11
Parameters break syntax highlighting by capturing punctuation #134
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
Comments
Your analysis seems good, but note that your lookahead version should be Another option is And a pedantic note: |
Thanks for catching the typo, I edited the initial comment. Re: the pedantic note, as far as I can tell they're just called "groups" (e.g. on MDN) but I agree that there could be better terms to describe how the different types of groups overlap with their effects. |
Uh oh!
There was an error while loading. Please reload this page.
Required information for this issue:
Steps to Reproduce:
Snippet of note:
VS Code doesn't properly highlight the line after a parameter is used:

I think what is happening is that on the final group of the regex on this line, the semicolon punctuation is being captured and then not being parsed as punctuation.
vscode-nginx-conf-hint/src/syntax/repository.ts
Line 46 in 5d5c43b
(Same line but in the XML)
vscode-nginx-conf-hint/src/syntax/nginx.tmLanguage
Line 3268 in 5d5c43b
You can see it work correctly if you add a space before the semicolon like this:
This can be fixed by changing the final group from being a non-capturing group to a lookahead.
Current final group:
(?:\s|;|$)
As a lookahead:
(?=\s|;|$)
(notice the=
instead of:
)I can open a pull request for this if you'd like.
Full sample file
The text was updated successfully, but these errors were encountered: