tree-sitter-supercollider
tree-sitter-supercollider copied to clipboard
Block-local variables with single letter names are highlighted as interpreter variables
With highlighting enabled, {|x| x } results in the second x (in the body of the function) being highlighted as if it were a single-letter interpreter variable, whereas {|foo| foo } highlights both foo correctly.
I'm on the current commit, per nvim-treesitter's lockfile.json:
"supercollider": {
"revision": "a7201b61779be59ac0fc0d118746c886dbc3edbd"
},
Thanks ! Will look into it
This is actually a harder one to fix than one would think. I'll have to think about this some more since those one letter interepreter variables are kind of magic. hmm...
No worries! Work has me pretty busy right now or I'd have taken a deeper look at it myself. Just wanted to leave a note here as I turned highlighting back on after the last update to see how things had progressed and noticed the issue with single-letter variable names. iirc it's been present all along and is not a regression. Would be nice to fix eventually as foo.do({|x, i| ... }) is such a common idiom.
This is indeed tricky. I guess we can probably treat interpreter variable as a regular variable here. It seems that the C tree-sitter parser doesn't distinguish between global and local variables either. IMO, doing this is good enough for a syntax parser.