pub struct Loader {
pub parser_lib_path: PathBuf,
/* private fields */
}Fields§
§parser_lib_path: PathBufImplementations§
Source§impl Loader
impl Loader
pub fn new() -> LoaderResult<Self>
pub fn with_parser_lib_path(parser_lib_path: PathBuf) -> Self
pub fn configure_highlights(&mut self, names: &[String])
Available on crate feature
tree-sitter-highlight only.pub fn highlight_names(&self) -> Vec<String>
Available on crate feature
tree-sitter-highlight only.pub fn find_all_languages(&mut self, config: &Config) -> LoaderResult<()>
pub fn languages_at_path( &mut self, path: &Path, ) -> LoaderResult<Vec<(Language, String)>>
pub fn get_all_language_configurations( &self, ) -> Vec<(&LanguageConfiguration<'_>, &Path)>
pub fn language_configuration_for_scope( &self, scope: &str, ) -> LoaderResult<Option<(Language, &LanguageConfiguration<'_>)>>
pub fn language_configuration_for_first_line_regex( &self, path: &Path, ) -> LoaderResult<Option<(Language, &LanguageConfiguration<'_>)>>
pub fn language_configuration_for_file_name( &self, path: &Path, ) -> LoaderResult<Option<(Language, &LanguageConfiguration<'_>)>>
pub fn language_configuration_for_injection_string( &self, string: &str, ) -> LoaderResult<Option<(Language, &LanguageConfiguration<'_>)>>
pub fn language_for_configuration( &self, configuration: &LanguageConfiguration<'_>, ) -> LoaderResult<Language>
pub fn compile_parser_at_path( &self, grammar_path: &Path, output_path: PathBuf, flags: &[&str], ) -> LoaderResult<()>
pub fn load_language_at_path( &self, config: CompileConfig<'_>, ) -> LoaderResult<Language>
pub fn load_language_at_path_with_name( &self, config: CompileConfig<'_>, ) -> LoaderResult<Language>
pub fn load_language(path: &Path, function_name: &str) -> LoaderResult<Language>
pub fn compile_parser_to_wasm( &self, language_name: &str, src_path: &Path, scanner_filename: Option<&Path>, output_path: &Path, ) -> LoaderResult<()>
pub fn highlight_config_for_injection_string<'a>( &'a self, string: &str, ) -> Option<&'a HighlightConfiguration>
Available on crate feature
tree-sitter-highlight only.pub fn get_language_configuration_in_current_path( &self, ) -> Option<&LanguageConfiguration<'_>>
pub fn find_language_configurations_at_path( &mut self, parser_path: &Path, set_current_path_config: bool, ) -> LoaderResult<&[LanguageConfiguration<'_>]>
pub fn select_language( &mut self, path: Option<&Path>, current_dir: &Path, scope: Option<&str>, lib_info: Option<&(PathBuf, &str)>, ) -> LoaderResult<Language>
pub const fn debug_build(&mut self, flag: bool)
pub const fn sanitize_build(&mut self, flag: bool)
pub const fn force_rebuild(&mut self, rebuild: bool)
pub fn use_wasm(&mut self, engine: &Engine)
Available on crate feature
wasm only.pub fn get_scanner_path(&self, src_path: &Path) -> Option<PathBuf>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Loader
impl RefUnwindSafe for Loader
impl Send for Loader
impl Unpin for Loader
impl UnsafeUnpin for Loader
impl UnwindSafe for Loader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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