FallenAngel97 / tree-sitter-rego

https://decodeapps.pp.ua/blog/post/rego-treesitter
MIT License
11 stars 6 forks source link

fix: highlight keyword 'with' on newline #15

Closed sspaink closed 5 months ago

sspaink commented 5 months ago

Replacing literal with with_modifier fixes the highlighting of the with keyword on newlines that don't have an expression in front of with.

Screenshot showing an example of this change being used in the Zed editor:

Currently:

image

With this change:

image

FallenAngel97 commented 5 months ago

Hello, @sspaink and thanks for the contribution!

I see that the tests are failing, I guess, it's due to them being written without considering your use case. Can you please, update them, so that I can merge them? Thanks!

sspaink commented 5 months ago

@FallenAngel97 updated my change to fix the tests, query was being used in more places then I realized so luckily the tests caught that. The tests run successfully locally. I also added a test for this scenario and the resulting syntax tree seems correct. Thanks!

FallenAngel97 commented 5 months ago

Thanks, can confirm, that locally they work for me as well. Merging