-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Use latest tree-sitter-bicep, support bicepparams #11525
Conversation
Updates to the latest tree-sitter-bicep and adds support for .bicepparam files, which can replace .parameters.json files.
As recommended in Sjord/tree-sitter-bicep#2 since the current grammar is 3 years old and quite a bit behind. Mainly I wanted to add .bicepparam file support, which also required a couple new keywords. Based on thread in #11412 I didn't install nixos on this machine so didn't run grammars.nix. I did try running |
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.
It looks like the new grammar is basically a rewrite so the queries will need to be redone. The repository has these which we can start from: https://github.com/tree-sitter-grammars/tree-sitter-bicep/blob/master/queries/highlights.scm but need their captures to be adapted to the ones we use: https://docs.helix-editor.com/master/themes.html#syntax-highlighting
To test this locally, is there a less costly way than installing nixOS to build the modified grammar? I remember from the previous PR I don't have to install the nixShell at least, but I still need to run grammar.nix? Also seems I could just run the same commands it ends up computing. |
You can manually test as long as you have a recent enough cargo/rust (I would recommend using rustup for that), |
This may not be ready yet. The highlights should be right, but when I try to test with I'm working on a Dockerfile based on nixOS so maybe that will help. |
After installing nixOS and starting with So this appears ready now. |
Since the new grammar handles more keywords, would you like me to add more to the corpus as well? There's no regressions, at least. |
Yeah if the grammar handles new keywords let's add them to the highlights. Otherwise the highlight queries are looking good now 👍 |
Never mind. I was incorrectly remembering the corpus test data was in this repo - not the tree-sitter repos. This PR should be good to go, then. Unless you wanted to wait and see if tree-sitter-grammars/tree-sitter-bicep#32 is merged and sync to that commit. |
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Updates to the latest tree-sitter-bicep and adds support for .bicepparam
files, which can replace .parameters.json files.