-
Notifications
You must be signed in to change notification settings - Fork 24
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
Capture group for module names #38
Comments
Yes: which captures to use are arbitrary for any tree-sitter consumer (editors, difftastic, tree-sitter-cli, GitHub, etc). Typically a consumer will map the name of a capture to some color. For example, tree-sitter-cli maps capture names to a terminal 256-color https://github.com/tree-sitter/tree-sitter/blob/3739b7794e381582c8f4a37b2ccec756c3504984/cli/src/highlight.rs#L145-L177. Different consumers may have different conventions. I know nvim and helix use |
Also note that we do provide highlight captures as part of this repo and it is used by GitHub, so we try to keep it in line with GitHub and tree-sitter-cli. The consumer can define their own captures to define whatever groups and names they see fit (e.g. nvim-treesitter) :) |
ok thx guys, I'll use |
Not sure where to ask this, but let's start small.
Here #16 modules were given
@module
capture group. IIUC that was done basically to cater Github TS highlighter, which somehow has color for@module
but not for@type
. Again, correct me if I'm wrong, nothing really stops, for example, proprietary IDE's TS plugin to recognize only@class
as capture group for classes, namespaces, modules etc. At the same time, nvim-treesitter could recognize only@namespace
as capture group for the same entites.tree-sitter docs to me reads like you're entitled to have arbitrary capture groups, which is kinda reasonable, given that each language has its own set of entities. So there's no fixed set of capture group names for related entities, and I don't know whether there might be any consensus at all?
The text was updated successfully, but these errors were encountered: