-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Bug: Syntax highlighting breaks in rust file #206
Comments
For the video, I've noticed that and I think it's an issue with multiple cursors, the edits sent to tree sitter aren't generated with the right offsets for subsequent cursors: helix/helix-core/src/syntax.rs Lines 541 to 652 in aebdef8
(note, that TODO might be easier to address now that For the second example can you give me a copy-pastable example so I can inspect it on https://tree-sitter.github.io/tree-sitter/playground ? I suspect we might be taking the wrong scope out here, it could be that helix/helix-term/src/ui/editor.rs Lines 154 to 167 in aebdef8
The best behavior might be to iter over all the scopes and merge styles. |
The image is from some toy-code of mine that is from here byte-match. |
Ah okay, I see it now, |
"{" @punctuation.bracket (identifier) @variable I added these in my own |
We likely want to port some of these punctuation/operator rules: https://github.com/nvim-treesitter/nvim-treesitter/blob/3b516c8e2b29dc2f8bfa5425a1b9369496918884/queries/rust/highlights.scm#L213 I probably never noticed because I don't highlight those. We do definitely accept these types of query improvements to |
Resolved by #430 |
Helix was build with the current git/master branch.
hx_syntax.mp4
I have noticed that in some of my code, methods get highlighted with the color for variables.
In this case,
TokenStream::form_iter
and.set_span
should also be green.I tried to look into the issue and ended up in
helix-core/src/syntax.rs +1309
HighlightIter::next
.At this point I have no desire to try to understand whats going on in there and where the problem could be originating form.
I ende my search at
layer.captures
.I tried the default theme.toml and it also breaks, but it is less legible (in my opinion).
The text was updated successfully, but these errors were encountered: