pub struct SyntaxSnapshot {
pub tokens: Vec<LexToken>,
pub parse: ParseResult,
}Expand description
Immutable syntax snapshot shared by semantic analysis and editor hosts.
Args: None.
Returns: Token stream and parsed CST for a single in-memory source snapshot.
Fields§
§tokens: Vec<LexToken>§parse: ParseResultImplementations§
Source§impl SyntaxSnapshot
impl SyntaxSnapshot
Sourcepub fn document(&self) -> DocumentNode
pub fn document(&self) -> DocumentNode
Returns the typed document CST root.
Args: None.
Returns: Typed document wrapper for the snapshot root.
Sourcepub fn root(&self) -> &SyntaxNode
pub fn root(&self) -> &SyntaxNode
Returns the CST root node for this snapshot.
Args: None.
Returns: Parsed rowan root node.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Returns collected syntax diagnostics.
Args: None.
Returns: Borrowed parse diagnostics for this snapshot.
Trait Implementations§
Source§impl Clone for SyntaxSnapshot
impl Clone for SyntaxSnapshot
Source§fn clone(&self) -> SyntaxSnapshot
fn clone(&self) -> SyntaxSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SyntaxSnapshot
impl !RefUnwindSafe for SyntaxSnapshot
impl !Send for SyntaxSnapshot
impl !Sync for SyntaxSnapshot
impl Unpin for SyntaxSnapshot
impl UnsafeUnpin for SyntaxSnapshot
impl !UnwindSafe for SyntaxSnapshot
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