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§
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/bash→bash,#!/usr/bin/env -S fish -e→fish. ReturnsNonefor anything that isn’t a shebang line.