zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
45.84k stars 2.54k forks source link

Support more syntax tokens for theme configuration #9461

Open zarifpour opened 5 months ago

zarifpour commented 5 months ago

Check for existing issues

Describe the feature

Proposed Solution:

  1. Expand Theme Configuration: Extend the theme's configuration file to include more syntax tokens, enabling granular customization for different code elements.

  2. Language-specific Support: Allow themes to define colors for syntax tokens specific to different programming languages.

This approach will enhance user experience by allowing more detailed and language-specific theme customization.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

maxdeviant commented 5 months ago

@zarifpour Do you have specific examples of things that we don't currently support?

zarifpour commented 5 months ago

I can look for a better example, but here's a quick one. Let me know if it makes sense:

CleanShot 2024-03-18 at 10 50 12 on Zed — GitHub

CleanShot 2024-03-18 at 10 51 41 on Zed — AuctionBot sol — GitHub

I don't think it's possible to color these specific elements, where in VSCode I can target these specifically and configure their colors and font style.

drcongo commented 5 months ago

I've been porting my personal Sublime Text theme to Zed and found a few things that I couldn't seem to set colours for...

Screen Shot 2024-03-19 01 39 02 PM Sublime

Screen Shot 2024-03-19 01 38 38 PM Zed

A quick list of Python tokens (though bear in mind that I may have just failed to find the right keys)...

I think there's probably a few more too, these were just the ones visible in the screenshots of a random page from the Django codebase. Apologies if all these are actually possible and I'm just adding noise to the thread.

pimmee commented 3 months ago

Here's an example issue I created in the VSCode Dark Plus theme extension repo, which looks completely different in Zed vs VSCode.

When I tried to fix the colors and make a PR, I also quickly ran into issues with too few specific syntax tokens, especially for Typescript. Some examples include return or await. When I looked into how VSCode does it I recall seeing they have language specific scopes.

image

Would love if the color theming can be improved!

codeitlikemiley commented 1 month ago

I guess this is the same as my issue https://github.com/zed-industries/zed/issues/13961

I really need to make rust syntax highlighting more noticeable... its hard to work with all types having same color

everdrone commented 1 month ago

Also Rust attributes have inconsistent highlighting zed:

Screenshot 2024-07-27 at 22 22 00

vscode:

Screenshot 2024-07-27 at 22 23 16

And Rust doc comments don't have any special highlighting. In vscode, rust doc comments get some flavor of markdown highlighting (links to crate items, types, functions, constants, with their respective color in the active theme), plus code blocks get rust syntax highlighting vscode:

Screenshot 2024-07-27 at 22 25 24
ehamiter commented 3 days ago

This might also help cover my issue-- I'm unfamiliar with what order new LSPs/treesitters/syntax tokens occur to support colorization. Here's an example of a django template / html file that is in Sublime Text that is being highlighted:

image

...and here is an example of the same django template in Zed that is not being highlighted:

image

https://github.com/zed-industries/extensions/issues/1303