I've noticed that some of the themes in helix are using undocumented highlight selectors. Well that's no surprise, these are comming from highlight.scm files in tree-sitter grammars, while the least terrible reference to these classes seems to be https://docs.helix-editor.com/themes.html
We can do better. So first I'm going to just start collecting notes from existing grammars. Two main things will be here: references to "standard" classes, and also guidance for how to change "non-standard" classes.
Current doc source: https://github.com/helix-editor/helix/blob/master/book/src/themes.md
-
attribute- Class attributes, HTML tag attributes -
type- Typesbuiltin- Primitive types provided by the language (int,usize)parameter- Generic type parameters (T)enumvariant
-
constructor -
constant(TODO: constant.other.placeholder for%v)builtinSpecial constants provided by the language (true,false,niletc)boolean
characterescape
numeric(numbers)integerfloat
-
string(TODO: string.quoted.{single, double}, string.raw/.unquoted)?regexp- Regular expressionsspecialpathurlsymbol- Erlang/Elixir atoms, Ruby symbols, Clojure keywords
-
comment- Code commentsline- Single line comments (//)block- Block comments (e.g. (/* */)documentation- Documentation comments (e.g.///in Rust)
-
variable- Variablesbuiltin- Reserved language variables (self,this,super, etc.)parameter- Function parametersothermember- Fields of composite data types (e.g. structs, unions)
-
label -
punctuationdelimiter- Commas, colonsbracket- Parentheses, angle brackets, etc.special- String interpolation brackets.
-
keywordcontrolconditional-if,elserepeat-for,while,loopimport-import,exportreturnexception
operator-or,indirective- Preprocessor directives (#ifin C)function-fn,funcstorage- Keywords describing how things are storedtype- The type of something,class,function,var,let, etc.modifier- Storage modifiers likestatic,mut,const,ref, etc.
-
operator-||,+=,> -
functionbuiltinmethodmacrospecial(preprocessor in C)
-
tag- Tags (e.g.<body>in HTML)builtin
-
namespace -
special -
markupheadingmarker- the1,2,3,4,5,6- heading text for h1 through h6
listunnumberednumberedcheckedunchecked
bolditalicstrikethroughlinkurl- URLs pointed to by linkslabel- non-URL link referencestext- URL and image descriptions in links
quoteraw- verbatim code or equationsinlineblock
-
diff- version control changesplus- additionsgutter- gutter indicator UNUSED
minus- deletionsgutter- gutter indicator UNUSED
delta- modificationsmoved- renamed or moved files/changesgutter- gutter indicator UNUSED
boolean->constant.builtin.booleanrepeat->keyword.control.repeat, or possiblyfunction.builtin