-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
feat(treesitter): follow upstream captures #630
Conversation
For the legacy highlights, instead of setting a separate highlight, |
I think If the upstream does not do this, the downstream should not add it either, and for the legacy branch users, the highlights be linked to mean nothing because they should not exist yet. For me recording a macro to assign again is simpler than linking them. :D However, I will consider it carefully again before the PR gets merged. |
421da4a
to
06a04be
Compare
There are two extra highlight groups added:
One highlights group was split:
|
Updates here :) Edit: |
06a04be
to
775e18b
Compare
6a693fe
to
023ca05
Compare
023ca05
to
ff32733
Compare
The refactor is merged into nvim-treesitter experimental branch |
Some of the plugins I often use rely on the nvim-treesitter module system, so I cannot use this branch in daily use, it may need some review. |
nvim-treesitter/nvim-treesitter#5895 is the PR that will backport the changes to |
LGTM. |
["@property"] = { fg = C.lavender, style = O.styles.properties or {} }, -- Same as TSField. | ||
["comment.error"] = { fg = C.base, bg = C.red }, | ||
["comment.warning"] = { fg = C.base, bg = C.yellow }, | ||
["comment.note"] = { fg = C.base, bg = C.blue }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing comment.todo
. Also they should be @comment.*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The former @text.todo
has two different meanings,
- one for todo in comments, now
@comment.warning
- one for todo lists, now
@markup.list.checked
/@markup.list.unchecked
So the comment.todo
is a new capture, I think it's better not to add new highlights for now, especially since this highlight hasn't been utilized.(it's not exists in nvim-treesitter now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used though. text.todo
in comments is replaced with comment.todo
. As of now it's current a subset of the old text.todo
, so it should get some highlighting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continue on #645
nvim-treesitter may be updated soon, still in discussion but it is planned, see nvim-treesitter/nvim-treesitter#4799 (comment). The purpose is to follow the treesitter common core to share queries, so some captures will be redefined.
I created this PR to follow upstream changes to avoid highlights break by the breaking change.
There are some highlights defined in treesitter common core but not mentioned in nvim-treesitter
@carriage-return
@comment.documentation
@embedded
@escape
@markup.link
@markup.quote
@property.builtin
@variable.member
And not sure all helix captures will be applied. This PR only follow the common core, need to continue to follow the implementation.