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

bug: Unitful.jl macros break syntax highlighting when applied outside of brackets #160

Open
2 tasks done
Jarrod-Angove opened this issue Nov 15, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@Jarrod-Angove
Copy link

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues of tree-sitter-julia

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.23.2

Describe the bug

Writing a vector or bracketed operation using the unitful u"unit" macro prevents parsing of subsequent lines. Inserting a multiplication operator between the bracket and the macro fixes the issue.

With multiplication operator:
image

Without:
image

Steps To Reproduce/Bad Parse Tree

The bug appears when the unit macro is applied in two subsequent lines. i.e.

R = [10, 20, 30, 40]u"m"
R0 = 50
# everything past here still has syntax highlighting
#...

Whereas

R = [10, 20, 30, 40]u"m"
R0 = [50, 60, 70, 80]u"m"
# everything past here has the same highlight group as regular variables (white in my case)

Expected Behavior/Parse Tree

R = [10, 20, 30, 40]u"m"
R0 = [50, 60, 70, 80]u"m"
...
# Everything still has syntax highlighting

Repro

R0 = [10, 20, 30, 40]u"m"
R1 = [1, 2, 3, 4]u"m"
println("example")
@Jarrod-Angove Jarrod-Angove added the bug Something isn't working label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant