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

feat: treesitter highlighter #404

Merged
merged 3 commits into from
Dec 2, 2024
Merged

feat: treesitter highlighter #404

merged 3 commits into from
Dec 2, 2024

Conversation

folke
Copy link
Contributor

@folke folke commented Nov 28, 2024

Quick test of a treesitter highlighter for labels.

Should not be merged yet, since it is currently configured as the default highlighter.

Let me know what you think and if this is something you'd like to have in blink.
Maybe disabled by default and under a config flag somewhere?

image

image

@folke folke marked this pull request as draft November 28, 2024 23:44
@Saghen
Copy link
Owner

Saghen commented Nov 29, 2024

I'd love something like this in the core! Disabled by default like you suggested, with a config flag in the draw config. Also TIL about get_string_parser, would've made my experiments much easier 😄

I had a few ideas months ago on merging the label with the detail, but you'll need to remove detail from resolveSupport.properties in the LSP capaibilities. It might also be interesting to explore using the kind field for adding brackets (blink.cmp.completion.brackets) to help treesitter get the right highlighting. Here's some messy code I had lying around from that experimenting, iirc with rust-analyzer: https://paste.super.fish/p/pLoiVa.lua

@folke folke marked this pull request as ready for review November 29, 2024 18:19
@folke
Copy link
Contributor Author

folke commented Nov 29, 2024

I had a few ideas months ago on merging the label with the detail, but you'll need to remove detail from resolveSupport.properties in the LSP capaibilities. It might also be interesting to explore using the kind field for adding brackets (blink.cmp.completion.brackets) to help treesitter get the right highlighting. Here's some messy code I had lying around from that experimenting, iirc with rust-analyzer: https://paste.super.fish/p/pLoiVa.lua

Interesting idea!

I just updated the code to make treesitter highlights configurable and also added a caching layer just in case.

@Saghen Saghen merged commit 08a0777 into Saghen:main Dec 2, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 2, 2024

Thank you!

mikavilpas added a commit to mikavilpas/dotfiles that referenced this pull request Dec 2, 2024
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

Successfully merging this pull request may close these issues.

2 participants