Trait syntastica::language_set::LanguageSet
pub trait LanguageSet {
type Language: SupportedLanguage;
// Required method
fn get_language(
&self,
language: Self::Language
) -> Result<&HighlightConfiguration, Error>;
}
Expand description
Describes a type that is able to provide tree-sitter parsers and queries.
All official syntastica parser collections provide a type called LanguageSetImpl
which
implements this trait. See
the project overview
for more information on that.
Required Associated Types§
type Language: SupportedLanguage
type Language: SupportedLanguage
A type identifying a language that is included in this set.
The given type should usually be an enum of all included languages.
Required Methods§
fn get_language(
&self,
language: Self::Language
) -> Result<&HighlightConfiguration, Error>
fn get_language( &self, language: Self::Language ) -> Result<&HighlightConfiguration, Error>
Get the language with the given name.
The returned HighlightConfiguration
must be
configured with
THEME_KEYS
.
The function is given an instance of Self::Language
and as such should not need to
return an Error::UnsupportedLanguage
error.