sainnhe / everforest

🌲 Comfortable & Pleasant Color Scheme for Vim
MIT License
2.94k stars 131 forks source link

Tree Sitter colors contradict standard colors #128

Open jdugan6240 opened 1 year ago

jdugan6240 commented 1 year ago

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?

antoineco commented 1 year ago

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:

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 commented 1 year ago

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 commented 1 year ago

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

Daydreamer-riri commented 3 months ago

‌‌‌‌‌Hi @antoineco, in TypeScript, turning Treesitter on and off can cause inconsistencies in the color of the optional property '?', making it difficult to find them. Here are the comparison images:

Treesitter on: image

Treesitter off: image

Is there a way to maintain good visibility even when Treesitter is turned on?

jdugan6240 commented 3 months ago

Does this issue show up in other tree-sitter aware color schemes, or just Everforest?

The reason I ask is to isolate whether the issue is with Everforest or the Typescript grammar you're using.

Daydreamer-riri commented 3 months ago

Gruvbox: image

image

Other color schemes are working fine. The same issue occurs with gruvbox-material.

antoineco commented 3 months ago

@Daydreamer-riri I created a new issue ☝️ Thanks for reporting!