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

Highlight tree-sitter queries #5746

Open
ObserverOfTime opened this issue Jan 22, 2022 · 2 comments · May be fixed by #7243
Open

Highlight tree-sitter queries #5746

ObserverOfTime opened this issue Jan 22, 2022 · 2 comments · May be fixed by #7243
Labels
Add Language Good First Issue This is a great opportunity to start contributing to Linguist

Comments

@ObserverOfTime
Copy link
Contributor

ObserverOfTime commented Jan 22, 2022

Language name

Keeping "Scheme" should be fine but "Tree-sitter" or "Tree Query" could be used instead.

Tree-sitter’s syntax highlighting system is based on tree queries,
which are a general system for pattern-matching on Tree-sitter’s syntax trees.

URL of example repository

https://github.com/nvim-treesitter/nvim-treesitter/tree/master/queries

URL of syntax highlighting grammar

https://github.com/nvim-treesitter/tree-sitter-query (for tree-sitter)

Most popular extensions

Uses the same extension as Scheme (.scm) so some heuristic would be required.

Detected language

Scheme

@ObserverOfTime ObserverOfTime added Add Language Good First Issue This is a great opportunity to start contributing to Linguist labels Jan 22, 2022
@SamB
Copy link

SamB commented Aug 5, 2023

Huh, unfortunately, these files are made of actual s-expressions, just like normal Scheme or Lisp code.

Possibly the idiosynchratic use of symbols starting with @, including sometimes at the top level, can help?

If that doesn't work out, I guess https://github.com/github-linguist/linguist/blob/master/docs/overrides.md might still help?

@clason
Copy link

clason commented Jan 14, 2024

I think it would suffice to simply add query as an alias for scheme, so editors with better support (Neovim) can leverage that while still getting basic scheme syntax highlighting on Github.

(To be clear, the main goal here is codeblock injections in markdown.)

If you want to go the extra mile and this is possible for linguist, you can distinguish by file path: any **/queries/*/*.scm file is very likely a query. (This is how Neovim decides, but the convention is of course global across the tree-sitter ecosystem.)

@mkatychev mkatychev linked a pull request Feb 18, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add Language Good First Issue This is a great opportunity to start contributing to Linguist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants