pub enum LanguageError {
UnknownLanguage,
UnsupportedLanguage,
}
Expand description
LanguageError
is an error that can be returned by
get_syntax_from_path
and get_syntax_from_extension
.
Variants§
UnknownLanguage
The language could not be identified.
If you get UnknownLanguage
that means the language is not supported,
by the sister crate detect-lang.
Feel free to submit an issue on the issue tracker, or add it
to languages.rs and submit a pull request.
UnsupportedLanguage
The language was identified by detect-lang, but syntax rules are not included and predefined in comment-parser for the language.
§Supported Languages
If syntax rules for a language does not exist, then consider
trying another language, which has similar syntax rules when
it comes to comments and strings. For instance c
vs cpp
or
css
vs scss
.
Click here to see all predefined languages.
§Custom Syntax Rules
Go to SyntaxRule
for an example on defining
custom syntax rules.
If you implement syntax rules for an unsupported language, then feel free to submit
your rules
on the issue tracker, or add it to
languages.rs and submit a pull request.