Skip to main content

Themes and decorations

Two theme layers​

LayerStylesWho can change it
Application theme (AppTheme)Panels, tabs, menus, status bar, bannersBuilt-in light and dark only
Editor theme (EditorTheme)Text background, foreground, gutter, current line, selection, caret, syntax classes, decoration stylesBuilt-ins and extensions

An extension theme declares a kind (light or dark) and overrides editor colours on top of the matching built-in. It cannot restyle IDE chrome, so it cannot hide trust or conflict banners. Unknown keys are reported, not fatal.

Editor keys: background, foreground, gutter_background, gutter_foreground, line_highlight, selection, caret, info, warning, error, highlight. Syntax keys: attribute, comment, constant, constructor, function, keyword, label, number, operator, property, punctuation, string, escape, tag, type, variable, variable.builtin, macro, module. Colours are #rrggbb or #rrggbbaa.

The choice is saved in settings.toml; Toggle Light/Dark Theme switches between the built-ins.

Decoration layers​

Decorations are styled ranges the editor paints around the text. Providers return data; only the editor draws.

  • Layers are painted in ascending order, so diagnostics remain visible over extension highlights.
  • A provider implements DecorationProvider (id, layer, applies_to(language), decorate(document, visible_lines, out)).
  • Providers see only the visible lines, are capped at 2 000 decorations per call and skip lines over 4 096 chars.
  • Decorations are Background(style) or Underline(style), with an optional tooltip.

Today the providers are extension pattern rules and LSP diagnostics. Future decorations (indentation guides, inlay hints, search matches) fit the same interface as new layers or kinds without changes to the text engine.