Add differenciation between keywords and storage keywords #51206
Shimadakunn
started this conversation in
Feature Requests
Replies: 2 comments
-
|
I was looking for the exact same thing I hope it will be added |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Syntax token granularity gaps prevent 1:1 VS Code theme porting
Summary
Zed's syntax token types are coarser than VS Code's TextMate scopes, making it impossible to faithfully port VS Code themes. Several distinct VS Code scopes are merged into a single Zed token, forcing theme authors to choose one color and lose visual distinctions that users expect. This affects every VS Code theme port.
Problem
Gap 1:
keywordvsstorageVS Code distinguishes between control flow keywords and declaration/storage keywords. Most themes color them differently — this is one of the most visible distinctions in any codebase.
VS Code scopes:
keywordif,else,return,throw,for,while,switch,case,break,import,export,fromstorage,storage.typeclass,function,interface,type,enum,const,let,varstorage.modifierstatic,readonly,async,abstract,public,private,protected,extends,implementsZed today: All of these map to
keyword. Theme authors cannot assign different colors toclass/const/functionvsif/else/return.Suggested solution: Add
storage(orkeyword.storage) and optionallystorage.modifiersyntax token types.Gap 2: User-defined types vs built-in types
VS Code distinguishes between user-defined types and language-provided built-in types. Most themes use this to make primitives visually distinct from custom types.
VS Code scopes:
entity.name.type,entity.name.classUser,Point,ApiResponse,EventEmittersupport.type,support.classnumber,string,boolean,void,Promise,Array,Map,Set,DateZed today: Both map to
type. A user-definedUserand the built-innumberare visually identical.Suggested solution: Add a
type.builtinsyntax token type for language-provided/primitive types.Gap 3: Dedicated bracket pair colorization colors
VS Code provides dedicated theme keys for bracket nesting:
Zed today: Bracket pair colorization colors are derived from the
playersarray, which is shared with multiplayer cursor/selection colors. Theme authors must compromise between optimal bracket nesting colors and appropriate multiplayer colors.Suggested solution: Add dedicated bracket colorization keys to the theme schema, e.g.:
With a fallback to
playersif unset, for backward compatibility.Impact
These gaps affect all VS Code theme ports. Themes that rely heavily on these distinctions include (non-exhaustive): Solarized, One Dark Pro, Dracula, Catppuccin, Nord, Gruvbox, Tokyo Night, GitHub Theme, Monokai Pro, Ayu.
The
keywordvsstoragegap is the most impactful — in a typical file,class,const,function,interfaceappear on nearly every line and are visually distinct fromif/else/returnin VS Code. Losing this distinction makes ported themes feel subtly wrong without users being able to identify why.Reproduction
Open this TypeScript snippet in both VS Code and Zed with the same theme colors:
In VS Code, most themes show:
class,static,readonly,const,function,asyncin color A (storage)if,throw,return,exportin color B (keyword)Userin color C (user type)number,stringin color D (built-in type)In Zed, the best possible result is:
class,static,readonly,if,throw,returnall in one color (keyword)User,number,stringall in one color (type)Proposed additions
storageorkeyword.storagestorage,storage.typeclass,function,const,let,interface,type,enumstorage.modifierstorage.modifierstatic,readonly,async,abstract,public,private,protectedtype.builtinsupport.type,support.classnumber,string,boolean,void,Promise,Arrayeditor.bracket_pair_colorization.color1-6editorBracketHighlight.foreground1-6playersAll new tokens should be optional with sensible fallbacks (
storagefalls back tokeyword,type.builtinfalls back totype, bracket colors fall back toplayers) to avoid breaking existing themes.Current vs. Expected behavior
I want to have differenciation and granualirity just like in vs code to have better readibility
Zed version and system specs
Zed 0.225.12
8f51e07
0.225.12+stable.191.8f51e075bdf969725ce8fa2a032a19cdb821b9fb
Mac OS
Attach Zed log file
Zed.log
Relevant Zed settings
settings.json
Relevant Keymap
keymap.json
(for AI issues) Model provider details
No response
If you are using WSL on Windows, what flavor of Linux are you using?
None
Beta Was this translation helpful? Give feedback.
All reactions