bat icon indicating copy to clipboard operation
bat copied to clipboard

Support Nushell Files

Open schrieveslaach opened this issue 2 years ago • 4 comments

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.

schrieveslaach avatar Mar 26 '22 08:03 schrieveslaach

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

sharkdp avatar May 22 '22 09:05 sharkdp

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:.

panicbit avatar Aug 09 '23 13:08 panicbit

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 bats 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...

keith-hall avatar Aug 09 '23 14:08 keith-hall

For the next person: I'm aware of 2 implementations of nushell.sublime-syntax that work as a custom syntax with bat:

  1. https://github.com/stevenxxiu/sublime_text_nushell
  2. 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.

remmycat avatar Mar 02 '24 12:03 remmycat