Skip to main content

Module icons

Module icons 

Source
Expand description

Renderer-agnostic file-type icon resolver (DESIGN.md §5.6.7).

Returns a glyph + renderer-neutral IconColor for any file or directory path. The glyph is plain text – the lattice-file-tree render path embeds it directly in the rope so the model stays usable from any renderer. The colour is mapped to the renderer’s native style at draw time (ratatui Color, GPUI Hsla, etc.).

Two glyph palettes, picked by the nerd_fonts argument:

  • nerd_fonts == true – Nerd Fonts v3 glyphs (Private Use Area codepoints, require a patched font installed in the terminal).
  • nerd_fonts == false – BMP-block fallback (Geometric Shapes, Misc Symbols). These render in any modern monospace font – DejaVu, JetBrains Mono, Fira, Cascadia, Consolas – without needing a special install. Same six-bucket categorisation colour-tinted by language so a .rs and a .py still look different at a glance.

Resolution order: exact filename → extension → default.

Enums§

IconColor
Renderer-neutral colour. Concrete renderers (ratatui, GPUI, …) map the named variants to their own palette and Rgb straight through.

Functions§

entry_visual
Resolve (glyph, colour) for a directory or file entry.
glyph_for_entry
Glyph-only resolver. Used by the file-tree / oil rope renderers that embed the glyph in editable text and let the renderer apply styling spans. Equivalent to the first half of entry_visual.