Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(treesitter): follow upstream captures #694

Merged
merged 3 commits into from
Apr 12, 2024
Merged

Conversation

Jint-lzxy
Copy link
Contributor

This PR primarily updated highlight groups related to treesitter captures to comply with the latest specification. Deprecated captures were relocated to the legacy section. All changes are based on the following four commits:

I've attempted to keep the colors consistent for new additions by looking at the definitions of existing captures, but I'm really not sure how to handle colors for documentation-related ones. AFAIU the only relevant existing capture is @markup.raw, but it seems better suited for smaller sections of documentation. Personally, I don't think a large block of greenish-blue would look great for extensive documents that might span multiple lines. Here's a comparison:

  • ["@comment.documentation"] = { link = "Comment" }:
bef
  • ["@comment.documentation"] = { fg = C.teal, style = O.styles.strings or {} }:
aft

Note: Relevant hl groups include @string.documentation, @comment.documentation, and @markup.raw.

Which option are you all leaning towards? Let me know because I really can't make a choice 🥲

Jint-lzxy and others added 3 commits April 11, 2024 23:17
This PR primarily updated highlight groups related to treesitter captures to
comply with the updated specification. Deprecated captures were relocated to the
legacy section. All changes are based on the following four commits:
- nvim-treesitter/nvim-treesitter@99ddf57
- nvim-treesitter/nvim-treesitter@5d75359
- nvim-treesitter/nvim-treesitter@dccf31f
- nvim-treesitter/nvim-treesitter@998b230

I've attempted to keep the colors consistent for new additions by looking at the
definitions of existing captures, but I'm _really_ not sure how to handle colors
for documentation-related ones. AFAIU the only relevant existing capture is
`@markup.raw`, but it seems better suited for smaller sections of documentation.
Personally, I don't think a large block of greenish-blue would look great for
extensive documents that might span multiple lines.

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
@rewhile rewhile merged commit 08c6417 into main Apr 12, 2024
11 checks passed
@rewhile rewhile deleted the feat/follow-ts-captures branch April 12, 2024 17:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants