Skip to main content

SublimeProcessor

Struct SublimeProcessor 

Source
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: SublimeScopeMapper

Maps Sublime scopes to StyleId values (and back) for theming.

Implementations§

Source§

impl SublimeProcessor

Source

pub fn new(syntax: Arc<SublimeSyntax>, syntax_set: SublimeSyntaxSet) -> Self

Create a new processor for a given syntax definition.

Source

pub fn syntax(&self) -> &Arc<SublimeSyntax>

Get the active syntax definition.

Source

pub fn syntax_set(&self) -> &SublimeSyntaxSet

Get the current syntax set (used to resolve include references).

Source

pub fn syntax_set_mut(&mut self) -> &mut SublimeSyntaxSet

Mutably access the current syntax set (used to add/update syntaxes).

Source

pub fn preserve_collapsed_folds(&self) -> bool

Returns whether fold replacement preserves the collapsed state for existing regions.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DocumentProcessor for SublimeProcessor

Source§

type Error = SublimeSyntaxError

The error type returned by DocumentProcessor::process.
Source§

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§

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, 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.