bat
bat copied to clipboard
Support Nushell Files
Syntax:
Nushell, a data-driven document language.
The authors of the language provide a syntax definition for VSCode in tmLanguage.json
: https://github.com/nushell/vscode-nushell-lang/tree/main/syntaxes
Guideline Criteria:
None. Maybe, the support should wait for a solution in the syntect
crate so that it can read tmLanguage
files (see here) and Nushell's tmLanguage.json
can be imported as a Git submodule.
The syntax doesn't seem to meet our current criteria for inclusion. Note that there is an easy way to customize your version of bat: https://github.com/sharkdp/bat#adding-new-syntaxes--language-definitions
More than 10,000 downloads at Package Control
That inclusion criteria seems to require publishing a sublime package, which nushell apparently currently does not. However, the official nushell vscode addon is exceeding 10k installs.
If the spirit of your inclusion criteria is about ensuring a certain popularity (for balancing utility vs cost of maintenance), then I'd kindly ask you to reconsider the inclusion of the nushell syntax :pray:.
I would personally say that the criteria are there for multiple (though perhaps interrelated) reasons:
- ensuring it's popular enough to be worth including by default
- ensuring it is of a good enough quality that it is provides useful highlighting (many vscode grammars do a poor job but partially make up for it in vscode with semantic highlighting provided via LSP)
- ensuring we don't waste time maintaining something not many people use
- keeping
bat
s startup speed fast
That inclusion criteria seems to require publishing a sublime package, which nushell apparently currently does not.
There's no law that says it has to be an official grammar, many decent language grammars are entirely community maintained.
Given that we have already said it would require conversation from a vscode format to an ST compatible one and nobody seems to have attempted it or built one from scratch, I think it is fair to say interest by Sublime users and syntect users is low... So at this stage, I believe your options are to do the work and use it yourself, potentially making a PR here if you've created a git repo for it, or to wait and see if anyone will ever add (vscode flavor) tmLanguage support to syntect...
For the next person: I'm aware of 2 implementations of nushell.sublime-syntax
that work as a custom syntax with bat:
- https://github.com/stevenxxiu/sublime_text_nushell
- https://github.com/kurokirasama/nushell_sublime_syntax
NOTE: currently needs manual fix described in this issue for use with bat
Note that imo 2. provided much better highlighting, perhaps because it is more recently updated at time of writing.