pub struct SublimeProcessor {
pub scope_mapper: SublimeScopeMapper,
/* private fields */
}Expand description
A stateful .sublime-syntax document processor.
This owns a SublimeScopeMapper so callers can map StyleId -> scope for theming.
Fields§
§scope_mapper: SublimeScopeMapperMaps Sublime scopes to StyleId values (and back) for theming.
Implementations§
Source§impl SublimeProcessor
impl SublimeProcessor
Sourcepub fn new(syntax: Arc<SublimeSyntax>, syntax_set: SublimeSyntaxSet) -> Self
pub fn new(syntax: Arc<SublimeSyntax>, syntax_set: SublimeSyntaxSet) -> Self
Create a new processor for a given syntax definition.
Sourcepub fn syntax(&self) -> &Arc<SublimeSyntax>
pub fn syntax(&self) -> &Arc<SublimeSyntax>
Get the active syntax definition.
Sourcepub fn syntax_set(&self) -> &SublimeSyntaxSet
pub fn syntax_set(&self) -> &SublimeSyntaxSet
Get the current syntax set (used to resolve include references).
Sourcepub fn syntax_set_mut(&mut self) -> &mut SublimeSyntaxSet
pub fn syntax_set_mut(&mut self) -> &mut SublimeSyntaxSet
Mutably access the current syntax set (used to add/update syntaxes).
Sourcepub fn preserve_collapsed_folds(&self) -> bool
pub fn preserve_collapsed_folds(&self) -> bool
Returns whether fold replacement preserves the collapsed state for existing regions.
Sourcepub fn set_preserve_collapsed_folds(&mut self, preserve: bool)
pub fn set_preserve_collapsed_folds(&mut self, preserve: bool)
Control whether fold replacement preserves the collapsed state for existing regions.
Trait Implementations§
Source§impl Debug for SublimeProcessor
impl Debug for SublimeProcessor
Source§impl DocumentProcessor for SublimeProcessor
impl DocumentProcessor for SublimeProcessor
Source§type Error = SublimeSyntaxError
type Error = SublimeSyntaxError
The error type returned by
DocumentProcessor::process.Source§fn process(
&mut self,
state: &EditorStateManager,
) -> Result<Vec<ProcessingEdit>, Self::Error>
fn process( &mut self, state: &EditorStateManager, ) -> Result<Vec<ProcessingEdit>, Self::Error>
Compute derived state updates to apply to the editor. Read more
Auto Trait Implementations§
impl Freeze for SublimeProcessor
impl RefUnwindSafe for SublimeProcessor
impl Send for SublimeProcessor
impl Sync for SublimeProcessor
impl Unpin for SublimeProcessor
impl UnsafeUnpin for SublimeProcessor
impl UnwindSafe for SublimeProcessor
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