-
Notifications
You must be signed in to change notification settings - Fork 37
Add string interpolation highlighting #24
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
Conversation
…on't mark $vars as vars to be more consistent with the ${var.other}
Tested locally and verified that multi line strings also work. |
Thank you for this contribution! I am super excited to enjoy this fix since the current syntax highlighting makes it really difficult to work with interpolator strings. I just tried this locally and the quotes I expected the color for quotes |
src/typescript/Scala.tmLanguage.ts
Outdated
const letterOrDigit = `${letter}|${digit}` | ||
const opchar = `[!#%&*+\\-\\/:<>=?@\\\\^|~[\\p{Sm}\\p{So}]]` | ||
const op = `${opchar}+` | ||
const idrest = `${letter}(?:${letterOrDigit})*(?:_${op})?` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one seems unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed unused declarations
Good catch. I reproduced the quotes bug. It looks like I mark the text inside string as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the quotes are now colored correctly, thank you @PanAeon for the fix!
LGTM 👍 I am very excited to use this improvement!
Released as 0.3.1 🎉 https://github.com/scala/vscode-scala-syntax/releases/tag/v0.3.1 |
My take on #11


Dark screenshot:
Light screenshot:
One thing I don't like is that
"${variable}"
and"$variable"
are highlighted differently.I can change it to no highlighting so it would be more consistent.Decided that more consistent syntax is better:
What do you think?