pub struct SublimeSyntaxSet { /* private fields */ }Expand description
A collection of compiled Sublime syntax definitions, with support for resolving extends and include.
Implementations§
Source§impl SublimeSyntaxSet
impl SublimeSyntaxSet
Sourcepub fn add_search_path(&mut self, path: impl Into<PathBuf>)
pub fn add_search_path(&mut self, path: impl Into<PathBuf>)
Adds a filesystem search path used to resolve Packages/... references.
Sourcepub fn get_by_scope(&self, scope: &str) -> Option<Arc<SublimeSyntax>>
pub fn get_by_scope(&self, scope: &str) -> Option<Arc<SublimeSyntax>>
Get a compiled syntax by its scope (e.g. "source.rust").
Sourcepub fn load_from_str(
&mut self,
yaml: &str,
) -> Result<Arc<SublimeSyntax>, SublimeSyntaxError>
pub fn load_from_str( &mut self, yaml: &str, ) -> Result<Arc<SublimeSyntax>, SublimeSyntaxError>
Loads a syntax from a YAML string and returns the compiled result.
If the syntax uses extends: ..., it will be resolved via search_paths.
Sourcepub fn load_from_path(
&mut self,
path: impl AsRef<Path>,
) -> Result<Arc<SublimeSyntax>, SublimeSyntaxError>
pub fn load_from_path( &mut self, path: impl AsRef<Path>, ) -> Result<Arc<SublimeSyntax>, SublimeSyntaxError>
Loads a syntax from a filesystem path and returns the compiled result.
Sourcepub fn load_by_reference(
&mut self,
reference: &str,
) -> Result<Arc<SublimeSyntax>, SublimeSyntaxError>
pub fn load_by_reference( &mut self, reference: &str, ) -> Result<Arc<SublimeSyntax>, SublimeSyntaxError>
Loads (or returns a cached) compiled syntax by a Sublime reference string.
Supported forms:
scope:source.rust(lookup by scope)Packages/JavaScript/JavaScript.sublime-syntax(filesystem search)- absolute or relative filesystem paths
Trait Implementations§
Source§impl Debug for SublimeSyntaxSet
impl Debug for SublimeSyntaxSet
Source§impl Default for SublimeSyntaxSet
impl Default for SublimeSyntaxSet
Source§fn default() -> SublimeSyntaxSet
fn default() -> SublimeSyntaxSet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SublimeSyntaxSet
impl RefUnwindSafe for SublimeSyntaxSet
impl Send for SublimeSyntaxSet
impl Sync for SublimeSyntaxSet
impl Unpin for SublimeSyntaxSet
impl UnsafeUnpin for SublimeSyntaxSet
impl UnwindSafe for SublimeSyntaxSet
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