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

Tree Sitter colors contradict standard colors #128

Open
jdugan6240 opened this issue Nov 3, 2023 · 3 comments
Open

Tree Sitter colors contradict standard colors #128

jdugan6240 opened this issue Nov 3, 2023 · 3 comments

Comments

@jdugan6240
Copy link

In palette.md, the Tree Sitter colors sometimes do not agree with the regular colors. For example, aqua is the constants color normally, but fg is the Tree Sitter constants color. Similarly, green is normally the string color, but under Tree Sitter it's aqua.

Are these inconsistencies intended? Or should everforest ports default to the original colors in case of a conflict?

@jdugan6240 jdugan6240 changed the title Tree Sitter Colors Contradict Standard Colors Tree Sitter colors contradict standard colors Nov 3, 2023
@antoineco
Copy link
Collaborator

I also got confused by this when I started contributing to Everforest, but sainnhe explained in some other issue that those differences are indeed by design.
It's been on my to-do list to document some of the design decisions around the color scheme, but I never took the time to properly do it.

Here is the rationale:

The Vim syntax mechanism is not as expressive as Tree-sitter, and can't achieve the same granularity of syntax highlighting as Tree-sitter (in most languages). For that reason, you often end up with less nuances to work with in the Vim syntax compared to Tree-sitter.
Instead of trying to perfectly mirror the semantics across Vim syntax and Tree-sitter—which is in a lot of cases impossible—the choice was made to try designing both with a certain independence so that:

  • Tree-sitter doesn't have to suffer from the limitations of Vim's core highlight groups (in some cases the Tree-sitter capture groups aren't even equivalent to Vim's highlight groups)
  • Vim syntax doesn't have to look weird or inconsistent in languages that do not have syntax rules which match well to Tree-sitter

Besides the colors which are sometimes distributed differently, you will also notice that the usage of italics doesn't follow the same rules between Vim syntax and Tree-sitter, otherwise in some cases the Vim syntax would be overly italicized, etc.

I hope I managed to answer your question accurately :)

@jdugan6240
Copy link
Author

Ok, fair enough. That answers my question quite nicely.

Do you want to keep this issue open, so others can more easily see the answer to this question instead of writing another issue about it?

@antoineco
Copy link
Collaborator

Yes please. This will also be a reminder for me to finally push this documentation to the palette doc.

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

No branches or pull requests

2 participants