pub struct CodeMatch<'tree, D: Doc> {
pub node_match: NodeMatch<'tree, D>,
pub context: MatchContext,
pub relationships: Vec<CrossFileRelationship>,
}Expand description
A pattern match that extends ast-grep NodeMatch with codebase-level context.
Preserves all NodeMatch functionality while adding cross-file relationship information needed for graph intelligence.
Fields§
§node_match: NodeMatch<'tree, D>The underlying ast-grep NodeMatch - preserves all matching functionality
context: MatchContextAdditional context for codebase-level analysis
relationships: Vec<CrossFileRelationship>Cross-file relationships (calls, imports, inheritance, etc.)
Implementations§
Source§impl<'tree, D: Doc> CodeMatch<'tree, D>
impl<'tree, D: Doc> CodeMatch<'tree, D>
Sourcepub fn new(node_match: NodeMatch<'tree, D>) -> Self
pub fn new(node_match: NodeMatch<'tree, D>) -> Self
Create a new CodeMatch wrapping an ast-grep NodeMatch
Sourcepub fn ast_node_match(&self) -> &NodeMatch<'tree, D>
pub fn ast_node_match(&self) -> &NodeMatch<'tree, D>
Get the underlying NodeMatch for full ast-grep access
Sourcepub fn add_relationship(&mut self, relationship: CrossFileRelationship)
pub fn add_relationship(&mut self, relationship: CrossFileRelationship)
Add cross-file relationship information
Sourcepub fn relationships(&self) -> &[CrossFileRelationship]
pub fn relationships(&self) -> &[CrossFileRelationship]
Get all cross-file relationships
Trait Implementations§
Auto Trait Implementations§
impl<'tree, D> Freeze for CodeMatch<'tree, D>
impl<'tree, D> RefUnwindSafe for CodeMatch<'tree, D>where
D: RefUnwindSafe,
impl<'tree, D> Send for CodeMatch<'tree, D>where
D: Sync,
impl<'tree, D> Sync for CodeMatch<'tree, D>where
D: Sync,
impl<'tree, D> Unpin for CodeMatch<'tree, D>
impl<'tree, D> UnsafeUnpin for CodeMatch<'tree, D>
impl<'tree, D> UnwindSafe for CodeMatch<'tree, D>where
D: RefUnwindSafe,
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