Struct Loader

Source
pub struct Loader {
    pub parser_lib_path: PathBuf,
    /* private fields */
}

Fields§

§parser_lib_path: PathBuf

Implementations§

Source§

impl Loader

Source

pub fn new() -> Result<Self>

Source

pub fn with_parser_lib_path(parser_lib_path: PathBuf) -> Self

Source

pub fn configure_highlights(&mut self, names: &[String])

Available on crate feature tree-sitter-highlight only.
Source

pub fn highlight_names(&self) -> Vec<String>

Available on crate feature tree-sitter-highlight only.
Source

pub fn find_all_languages(&mut self, config: &Config) -> Result<()>

Source

pub fn languages_at_path( &mut self, path: &Path, ) -> Result<Vec<(Language, String)>>

Source

pub fn get_all_language_configurations( &self, ) -> Vec<(&LanguageConfiguration<'_>, &Path)>

Source

pub fn language_configuration_for_scope( &self, scope: &str, ) -> Result<Option<(Language, &LanguageConfiguration<'_>)>>

Source

pub fn language_configuration_for_first_line_regex( &self, path: &Path, ) -> Result<Option<(Language, &LanguageConfiguration<'_>)>>

Source

pub fn language_configuration_for_file_name( &self, path: &Path, ) -> Result<Option<(Language, &LanguageConfiguration<'_>)>>

Source

pub fn language_configuration_for_injection_string( &self, string: &str, ) -> Result<Option<(Language, &LanguageConfiguration<'_>)>>

Source

pub fn language_for_configuration( &self, configuration: &LanguageConfiguration<'_>, ) -> Result<Language>

Source

pub fn compile_parser_at_path( &self, grammar_path: &Path, output_path: PathBuf, flags: &[&str], ) -> Result<()>

Source

pub fn load_language_at_path( &self, config: CompileConfig<'_>, ) -> Result<Language>

Source

pub fn load_language_at_path_with_name( &self, config: CompileConfig<'_>, ) -> Result<Language>

Source

pub fn compile_parser_to_wasm( &self, language_name: &str, root_path: Option<&Path>, src_path: &Path, scanner_filename: Option<&Path>, output_path: &Path, force_docker: bool, ) -> Result<(), Error>

Source

pub fn highlight_config_for_injection_string<'a>( &'a self, string: &str, ) -> Option<&'a HighlightConfiguration>

Source

pub fn get_language_configuration_in_current_path( &self, ) -> Option<&LanguageConfiguration<'_>>

Source

pub fn find_language_configurations_at_path( &mut self, parser_path: &Path, set_current_path_config: bool, ) -> Result<&[LanguageConfiguration<'_>]>

Source

pub fn select_language( &mut self, path: &Path, current_dir: &Path, scope: Option<&str>, ) -> Result<Language>

Source

pub fn debug_build(&mut self, flag: bool)

Source

pub fn sanitize_build(&mut self, flag: bool)

Source

pub fn force_rebuild(&mut self, rebuild: bool)

Source

pub fn use_wasm(&mut self, engine: &Engine)

Available on crate feature wasm only.
Source

pub fn get_scanner_path(&self, src_path: &Path) -> Option<PathBuf>

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T