Expand description
Programming language detection library inspired by GitHub Linguist (and using it’s language and heuristic datasets)
This crate provides fast, accurate programming language detection using:
- File extension matching
- Exact filename matching
- Content-based heuristic disambiguation
- Vendored file detection
All language data is embedded at compile-time for zero-cost lookups.
Re-exports§
pub use error::LinguistError;
Modules§
Structs§
- Detected
Language - Represents a detected programming language.
Functions§
- detect_
language_ by_ extension - Detects programming language(s) by file extension.
- detect_
language_ by_ filename - Detects programming language(s) by exact filename match.
- disambiguate
- Disambiguates between multiple languages for a file using heuristic rules.
- is_
vendored - Checks if a file is a vendored/third-party file that should typically be excluded from statistics.
Type Aliases§
- Result
- Type alias for Results in this crate