Detects a file's language from its path and content.
Detection priority follows Neovim-style behavior:
- Runtime exact filename overrides from
Minga.Language.Filetype.Registry - Source-owned exact filename entries from
Minga.Language.Registry - Runtime extension overrides from
Minga.Language.Filetype.Registry - Source-owned extension entries from
Minga.Language.Registry .env*/.envrc*pattern when:bashis still registered- Shebang line from the first line of content
- Fall back to
:text
Built-in language mappings come from registered language definitions in Minga.Language.Registry. Runtime overrides stay separate so config and extensions can temporarily redirect a pattern without owning a full language definition.
Summary
Types
A language identifier atom.
Functions
Detects the language of a file from its path alone.
Detects the language from a file path and the first line of content.
Returns runtime extension overrides. Registered language definitions live in Minga.Language.Registry, so this map is empty in normal builds.
Returns runtime filename overrides. Registered language definitions live in Minga.Language.Registry, so this map is empty in normal builds.
Returns runtime shebang overrides. Registered language definitions live in Minga.Language.Registry, so this map is empty in normal builds.
Types
@type filetype() :: atom()
A language identifier atom.
Functions
Detects the language of a file from its path alone.
Checks runtime filename overrides, bundled exact filenames, runtime extension overrides, bundled extensions, and .env*/.envrc* patterns in that order. Returns :text if nothing matches.
Detects the language from a file path and the first line of content.
Tries detect/1 first. If that returns :text, attempts shebang detection from first_line. Returns :text if nothing matches.
Returns runtime extension overrides. Registered language definitions live in Minga.Language.Registry, so this map is empty in normal builds.
Returns runtime filename overrides. Registered language definitions live in Minga.Language.Registry, so this map is empty in normal builds.
Returns runtime shebang overrides. Registered language definitions live in Minga.Language.Registry, so this map is empty in normal builds.