pub struct Symbol {
pub id: String,
pub name: String,
pub kind: String,
pub is_definition: bool,
pub file: String,
pub line: usize,
pub col: usize,
pub start_byte: usize,
pub end_byte: usize,
pub signature: String,
pub parent: Option<String>,
}Expand description
A definition or reference extracted from a file.
Fields§
§id: StringStable handle: <lang>:<relpath>#<name>@<line> (line is 1-based). Survives across turns.
name: String§kind: Stringe.g. function, method, class, call — from the grammar’s tag query.
is_definition: bool§file: String§line: usize1-based line and column of the name — the editor / grep -n convention,
so a citation printed as “line N” lands on the right line. (tree-sitter’s
own Point is 0-based; we normalize here. The byte range below, not these,
is what source slices.)
col: usize§start_byte: usizeByte range of the whole symbol (what source slices).
end_byte: usize§signature: StringThe trimmed source line containing the name — a compact signature.
parent: Option<String>The owning container — the impl type, trait, class, or module.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnsafeUnpin for Symbol
impl UnwindSafe for Symbol
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more