-
Notifications
You must be signed in to change notification settings - Fork 55
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
fix: Incorrect string interpolation highlighting group #196
Conversation
@@ -141,9 +141,9 @@ class Copier: | |||
|
|||
export scanUnit.scan | |||
// ^ include | |||
// ^namespace | |||
// ^variable |
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.
Nice.
@@ -57,7 +57,7 @@ object Hello { | |||
// ^ keyword | |||
// ^ type | |||
self: X => | |||
// ^type | |||
// ^parameter |
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 is also great.
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.
overall LGTM
CI is failing though:
✗ basics.scala
Failure - row: 58, column: 4, expected highlight 'parameter', actual highlights: 'type'
Indeed, that new query file had to be added in couple different places. But the build still fails 🤔 |
This is because we have a check to make sure our queries match the queries in nvim-treesitter just to warn us if they go out of sync. Since you're introducing more queries here that's sort of expected to fail. No worries on that. After we merge this I'll sync the queries here with those. |
@ckipp01 hmm, I modified slightly the build process and it passes now :D |
This syncs the queries that were updated in tree-sitter/tree-sitter-scala#196.
This syncs the queries that were updated in tree-sitter/tree-sitter-scala#196. Co-authored-by: ghostbuster91 <[email protected]>
This syncs the queries that were updated in tree-sitter/tree-sitter-scala#196. Co-authored-by: ghostbuster91 <[email protected]>
This syncs the queries that were updated in tree-sitter/tree-sitter-scala#196. Co-authored-by: ghostbuster91 <[email protected]>
I noticed that values from interpolated strings are not highlighted correctly:
In order to have correct hl (highlight) group assigned I had to introduce scope tracking feature from the treesitter. After that some hl tests started failing.
Since some of the changes might be controversial I breakdown them here:
in
self: X =>
self
had atype
hl group previously. I dunno why. I changed it toparameter
in
export scanUnit.scan
scanUnit
was anamespace
but it is declared few lines above as a variable hence it should has the same hl group as its definition.According to the treesitter documentation:
(interpolation) @none
was too wide and I couldn't get it to work with the rest of the changes, so I narrowed it.