pub struct NodeRef {
pub file: RelativePath,
pub start_byte: usize,
pub end_byte: usize,
pub kind: NodeKind,
pub line: usize,
pub column: usize,
pub end_line: usize,
pub end_column: usize,
}Expand description
A self-contained reference to a node in a source file.
Encodes everything needed to locate and re-parse the node: file path + byte range. Each MCP call receives and returns these.
Fields§
§file: RelativePathRelative path to the source file.
start_byte: usizeByte offset of the start of this node.
end_byte: usizeByte offset of the end of this node.
kind: NodeKindtree-sitter node kind (e.g. “function_declaration”, “class_declaration”).
line: usize1-based start line number.
column: usize0-based start column offset.
end_line: usize1-based end line number.
end_column: usize0-based end column offset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeRef
impl<'de> Deserialize<'de> for NodeRef
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeRef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NodeRef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for NodeRef
impl Serialize for NodeRef
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for NodeRef
impl StructuralPartialEq for NodeRef
Auto Trait Implementations§
impl Freeze for NodeRef
impl RefUnwindSafe for NodeRef
impl Send for NodeRef
impl Sync for NodeRef
impl Unpin for NodeRef
impl UnsafeUnpin for NodeRef
impl UnwindSafe for NodeRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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