Open jpfeuffer opened 3 months ago
ah it works if you always set a shebang. Maybe setting a default would be nice.
The text within recipe blocks without explicit shebangs can contain just
syntax like the quiet operator @
or interpolations {{ ... }}
that will not necessarily highlight correctly in another language's syntax (ex. bash). As such I'm not sure there is a great solution here.
One option could be to explore making this non-default configurable behavior in the extension settings but I'm not sure if that is possible.
Hmm although I understand that mixing scripting language syntax highlighting with additional just interpolations is hard, after some research it seems that the default syntax is actually clearly defined as shell
https://github.com/casey/just?tab=readme-ov-file#shell. (With just-specific additions, as in any other recipe language).
To make it even more complicated, you can actually set the default shell in just with the "shell" just variable. Not sure if one could parse this in the beginning and set it accordingly.
Oh interesting I guess that does make this more complicated. Since we're already using shell as the default backtick language maybe making this consistent is a good idea and we forgo any highlighting on just specific syntax.
I'm not sure it is possible or performant to parse the shell type from setting at the top of the script but that is definitely something to investigate as well.
Seems like this highlighter does not even highlight variables. Is this intended?