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

Adding semantic token support #159

Merged
merged 6 commits into from
Apr 29, 2023
Merged

Conversation

chomosuke
Copy link
Contributor

@chomosuke chomosuke commented Apr 15, 2023

Fixes #156.
Fixes #140.

I wouldn't say I've made semantic tokens look good on every languages out there, but I do think this is good enough to be merged for now and be slowly improved later on. I do also think it is a significant improvement over how semantic tokens currently looks with nvim 0.9.

Here's how rust looks with treesitter only highlighting:
without semantic token

Here's how the same piece of rust looks with semantic token but before this PR, as you can see, it's quite unsightly:
before this PR

Here's how the same piece of rust looks with semantic token after this PR, notice how the doc test got syntax highlighting as it has been labeled by rust-analyzer:
with semantic token

BTW, I don't think parameters should be red but I can't think of any better color other than white so I'm opened to suggestions.

@jhossbach
Copy link

BTW, I don't think parameters should be red but I can't think of any better color other than white so I'm opened to suggestions.

Maybe something like jetbrain's one dark theme?

@chomosuke
Copy link
Contributor Author

@jhossbach not bad, I'll take that suggestion for now.

@jhossbach
Copy link

hey @navarasu, can we get this reviewed&pushed? I would love to use this colorscheme again!

@DoumanAsh
Copy link

DoumanAsh commented Apr 24, 2023

@chomosuke Just for your information, I noticed string highlighting may not behave well with inline variables (in this example I have variable member_id)
1682319825
Not sure if it bug in rust-analyzer or neovim cannot handle well variable inside string

@navarasu
Copy link
Owner

navarasu commented Apr 29, 2023

@chomosuke Can you please revert parameter colour change alone as it is not this PR scope? So that I can merge this code

This reverts commit f7bf697.
@chomosuke
Copy link
Contributor Author

@navarasu Done, shall I open param orange in another PR?

@chomosuke
Copy link
Contributor Author

@DoumanAsh you can use :Inspect to check how are each char labeled. I highly suspect this is rust-analyzer or treesitter not updating or labeling the wrong thing.

@navarasu
Copy link
Owner

navarasu commented Apr 29, 2023

If we are changing the color, we need to check all language. I have handpicked all these color by checking look and feel on multiple languages. Raise it an issue, I will check it

@navarasu navarasu merged commit 82cad74 into navarasu:master Apr 29, 2023
@chomosuke chomosuke deleted the semantic-token branch April 29, 2023 12:55
ellsclytn added a commit to ellsclytn/dotfiles that referenced this pull request Mar 24, 2024
This reverts commit 3755c1c as it
appears semantic token support has been added to onedark.

navarasu/onedark.nvim#159
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.

Support for Semantic Highlighting? Doesn't look very good on Rust with semantic tokens from NeoVim 0.9
4 participants