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

Extended highlight queries #84

Open
omentic opened this issue Feb 25, 2024 · 4 comments
Open

Extended highlight queries #84

omentic opened this issue Feb 25, 2024 · 4 comments

Comments

@omentic
Copy link

omentic commented Feb 25, 2024

Hi alaviss: I just finished porting Helix's old highlight queries to your grammar. You might be interested in them, they're about 150 lines longer but highlight significantly more accurately. I'd make a PR, but I'm not actually sure what scope standard your highlights are based off of...

They're available here: https://github.com/omentic/helix/blob/master/runtime/queries/nim/highlights.scm

@omentic
Copy link
Author

omentic commented Feb 25, 2024

before/after

@aMOPel
Copy link
Contributor

aMOPel commented Feb 25, 2024

Be sure to have a look at the highlight queries (and others like injection) I wrote for Neovim for inspiration. A load of effort went into these so I'm sure you'll find something useful.

https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/nim/highlights.scm

@alaviss
Copy link
Owner

alaviss commented Feb 25, 2024

I'd make a PR, but I'm not actually sure what scope standard your highlights are based off of...

It's whatever that tree-sitter highlight supports so that we can run tests on them.

Ideally the queries should be something that could work with most editors, but as far as I can tell there aren't any concrete standards accepted by all editors. Neovim is adopting some Helix stuff but not all of them (nvim-treesitter/nvim-treesitter#4799), so I'm not sure which standard to follow.

@aMOPel
Copy link
Contributor

aMOPel commented Feb 26, 2024

@omentic

Also make sure to look at my (manual) test cases which include many edge cases, to test your queries.

https://github.com/aMOPel/nvim-treesitter-nim/blob/main/tests/highlights.nim

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

3 participants