Skip to main content

Module languages

Module languages 

Source
Expand description

The curated language registry (0002 §2.2: statically linked, always). All highlight queries are Helix-vendored (queries/ per language, MPL-2.0) — one upstream, one review surface, divergence watched weekly (0002 §7). Adding a language is one row here plus one crate in Cargo.toml — never a download, never a dlopen. C++ included specifically: its scanner is C++, the musl static-libstdc++ path the release gate guards (0002 §5).

Detection for a file path goes: exact basename → extension → shebang (first line, only consulted when the extension is unknown or absent). detect is pure over (path, first_line) so callers own the one cheap read; Highlighter::for_path does exactly that.

Structs§

LanguageSpec

Functions§

detect
Path → spec, pure in first_line: exact basename first, then the extension table, then — only when the extension is unknown or absent — whatever the (already-read) first line shebangs to.
for_extension
Extension (with dot) → spec. First match wins.
for_shebang
Shebang line → spec.
interpreter_of
First shebang token as a bare interpreter name: #!/bin/bashbash, #!/usr/bin/env -S fish -efish. Returns None for anything that isn’t a shebang line.