[][src]Enum comment_parser::LanguageError

pub enum LanguageError {
    UnknownLanguage,
    UnsupportedLanguage,
}

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.

Trait Implementations

impl Debug for LanguageError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.