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

Incorrect syntax highlighting after sample opcode #1

Open
dozius opened this issue Apr 2, 2021 · 0 comments · May be fixed by #6
Open

Incorrect syntax highlighting after sample opcode #1

dozius opened this issue Apr 2, 2021 · 0 comments · May be fixed by #6

Comments

@dozius
Copy link

dozius commented Apr 2, 2021

This is what the issue looks like. The opcodes following the sample path are not highlighted correctly.

2021-04-02 16_21_48-SalamanderGrandPianoV3Retuned sfz - Visual Studio Code

"end": "(?=(\\s\/\/|$))",

This line seems to be the source of the trouble. The regex only accounts for line comments or line end after the path. The spec for sample paths makes it fairly tricky to parse correctly. The only condition is that the path can't contain the "=" character. If you change this regex to "(?=(\\s\/\/|\\s\/\\*|\\s\\w*\\=|$))", it will additionally handle the cases where the path is followed by another opcode or a block comment. This covers all the cases I've run into where the highlighting was broken.

The result of this change is the opcodes are highlighted correctly.

2021-04-02 16_22_40-SalamanderGrandPianoV3Retuned sfz - Visual Studio Code

@jcurtis-cc jcurtis-cc linked a pull request Jun 18, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant