-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
pub enum Detection {
Filename(&'static str),
Extension(&'static str),
Shebang(&'static str),
Heuristics(&'static str),
Classifier(&'static str),
}From the docs it's not clear which values this string can have!
It would be a nicer & more idiomatic & stable API if the set of possible languages was represented as an enum.
Then we could easily match on that, to map it to syntax highlighters, markdown codeblock-language-indicator-abbreviations etc.
And it would also be more ergonomic if Detection had separate fields for language and detection method. E.g.:
pub struct Detection {
pub language: Language, // The new enum
pub method: DetectionMethod, // Separate enum
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels