-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(languages): update just
grammar and queries
#11306
Conversation
In trying to make sure the shebang injections worked properly I went through an added some from The syntax highlighting for the actual language seems correct? But the way the shebang is not greyed out the same for all of them is odd. I though it might have something to do with the |
I have questions because the tree-sitter-just grammar helix uses is quite wonky around triple quoted strings and interpolations, so does the following highlight correctly now: a := """a string with a " inside"""
b := '''a string with a ' inside'''
c := ```a string with a ` inside```
recipe1:
echo "{{ a + b }}" {{ c }}
recipe2:
#!/usr/bin/env bash
echo "{{ a + b }}" {{ c }}
if [[ {{ a }} != "string" ]]; then echo "{{ b }}" '{{ c }}'; fi |
It's sad the I suppose the following also fails: recipe:
echo {{ shell("abc", "def") }} Another thing I found while testing the current grammar and queries:
Another one: [private]
r: dep
[private] # The last `]` is not highlighted correctly currently
r: dep |
I have made my own tree sitter grammar to work around most of these issues in the past: https://github.com/poliorcetics/tree-sitter-just, I cleaned it up recently and notably strings with
|
@poliorcetics if you want, it might be easier if you made your own pr for the grammar/queries using your tree-sitter. Just remember to put a license for it. And you will need to the fix for the shebang from 8e05c35 |
Not yet, mostly because the grammar is not complete yet! I would be very glad to have an helix with the improvements you made already 👍 |
This will also fix injection for some Nix cases. For example: {
foo = ''
#!/bin/sh
echo -n "Hello, world!"
'';
} on master doesn't highlight the shell at all, it's just a string |
Hello @RoloEdits, made the MR in #11380 :) |
* feat(languages): update `just` grammar and queries Bump the * refactor(syntax): inject shebang by id not name --------- Co-authored-by: Trevor Gross <[email protected]>
* feat(languages): update `just` grammar and queries Bump the * refactor(syntax): inject shebang by id not name --------- Co-authored-by: Trevor Gross <[email protected]>
* feat(languages): update `just` grammar and queries Bump the * refactor(syntax): inject shebang by id not name --------- Co-authored-by: Trevor Gross <[email protected]>
Updates the queries and grammar for just. This includes support for shebang syntax highlighting in the commands.
Part of this pr also includes a change in how
language_configuration_for_injection_string
works, with instructions from @the-mikedavis.Supersedes: #9850
Fixes: #8226