Skip to content
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

Support Nushell Files #2129

Open
schrieveslaach opened this issue Mar 26, 2022 · 5 comments
Open

Support Nushell Files #2129

schrieveslaach opened this issue Mar 26, 2022 · 5 comments

Comments

@schrieveslaach
Copy link

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.

@sharkdp
Copy link
Owner

sharkdp commented May 22, 2022

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

@panicbit
Copy link

panicbit commented Aug 9, 2023

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

@keith-hall
Copy link
Collaborator

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

@remmycat
Copy link

remmycat commented Mar 2, 2024

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.

@melMass
Copy link

melMass commented Nov 27, 2024

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

Awesome thanks for the tip!
I assembled the instructions in a gist here (pre-applying the fix you mentioned): nushell syntax for bat - gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants