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

adding Nushell's syntax #524

Closed
cablehead opened this issue Mar 28, 2024 · 7 comments
Closed

adding Nushell's syntax #524

cablehead opened this issue Mar 28, 2024 · 7 comments

Comments

@cablehead
Copy link

cablehead commented Mar 28, 2024

Hi!

How are new syntaxes added to the syntect crate?

It'd be great to have Nushell’s syntax available. @kurokirasama has a definition here: https://github.com/kurokirasama/nushell_sublime_syntax/blob/main/nushell.sublime-syntax

I'm curious if the mechanism that includes syntax definitions can source the definition directly from nushell_sublime_syntax, so updates are picked up automatically?

@keith-hall
Copy link
Collaborator

#523 (comment)

I'm curious if the mechanism that includes syntax definitions can source the definition directly from nushell_sublime_syntax, so updates are picked up automatically?

typically syntaxes are included as git submodules, so dependabot can easily create PRs to bump them automatically

@cablehead
Copy link
Author

Thanks for the info! 🙏🏻 I still can't work out the mechanic to include a new syntax. e.g. if I search the syntect repo for erlang, I don't find anything...

@keith-hall
Copy link
Collaborator

did you checkout submodules? Erlang is in testdata/Packages/Erlang

@cablehead
Copy link
Author

cablehead commented Apr 15, 2024

I think I see. It looks like if testdata/Packages/*/*.sublime-syntax is present, then it will become available as a SyntaxSet.

In which case, my next step is to try to get https://github.com/kurokirasama/nushell_sublime_syntax added to https://github.com/sublimehq/Packages

ah, but sublimehq/Packages isn't accepting new packages

@cablehead
Copy link
Author

would it be reasonable to add https://github.com/kurokirasama/nushell_sublime_syntax as an additional submodule, perhaps to: testdata/MoarPackages, and to update the build to load syntax from testdata/Packages + testdata/MoarPackages? .. or something roughly along those lines?

@keith-hall
Copy link
Collaborator

It may be reasonable, but I'm not yet convinced it's something we want in syntect as then we'll open the floodgates for requests for getting all sorts of packages added to syntect by default. (see #523 (comment) for example.) Please help me to understand for what reason do you want it in this repository as opposed to in your consumer codebase?

@cablehead
Copy link
Author

cablehead commented Apr 17, 2024

I'm not yet convinced it's something we want in syntect as then we'll open the floodgates for requests for getting all sorts of packages added to syntect by default.

Ah gotcha. Yeah, that would quickly become impractical.

Please help me to understand for what reason do you want it in this repository as opposed to in your consumer codebase?

Right, I don't think I've been appreciating how straightforward it would be to just add the nushell schema to my consumer codebase.

Beyond my own immediate use case, my motivation to have the schema included upstream is to help the nushell project become more mainstream, tooling-wise. It's a shame sublimehq/Packages isn't accepting PRs, but it also makes sense. They would be in a similar floodgate position.

I'll close this issue for now. Thanks Keith 🙏🏻 syntect is a tremendous asset to the whole community.

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

No branches or pull requests

2 participants