[][src]Struct taplo::analytics::SyntaxInfo

pub struct SyntaxInfo {
    pub range: Option<TextRange>,
    pub text: Option<String>,
    pub element: Option<SyntaxElement>,
    pub syntax_kinds: Vec<SyntaxKind>,
    pub key_path: Option<Path>,
}

Information about a position query only based on the syntax tree.

The information might also contain incomplete and invalid nodes, even if its syntax kind is valid.

Fields

range: Option<TextRange>

The range of the relevant area.

Note that this is not the range of the syntax token, but rather a helper for keys and values.

text: Option<String>

The text inside of relevant area.

element: Option<SyntaxElement>

The syntax element if any.

syntax_kinds: Vec<SyntaxKind>

The syntax kids relevant to the position (e.g. SyntaxKind::KEY and SyntaxKind::TABLE_HEADER for inside table headers).

key_path: Option<Path>

The path of a single dotted key.

Implementations

impl SyntaxInfo[src]

pub fn is_kind(&self, kind: SyntaxKind) -> bool[src]

pub fn first_token_before(&self) -> Option<(TextRange, SyntaxToken)>[src]

First non-whitespace (or newline) syntax token before the element.

Trait Implementations

impl Debug for SyntaxInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.