fix: Fix callers/callees for Liquid templates and improve context relevance
Three issues discovered testing CodeGraph against a Shopify Liquid theme:
1. Callers/callees only traversed 'calls' edges, missing 'references' and
'imports' edges that Liquid extraction creates for {% render %} and
{% section %} tags. Expanded edge filter in getCallers/getCallees.
2. Context builder only ran text search as a fallback when semantic search
returned nothing. For template-heavy codebases, semantic search returns
irrelevant results (e.g., "Toast" for a header navigation query) while
text/path-based matching would find the right files. Now always runs
text search alongside semantic search with multi-term boosting.
3. MCP findAllSymbols only matched nodes by exact name, missing file nodes
whose basename (without extension) matched the symbol. This caused
callers to find zero results even with correct edges, since references
edges point to file nodes (e.g., "product-card.liquid") not component
nodes (e.g., "product-card").
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
47ed47bf04
commit
68ec482bf4
@@ -248,7 +248,7 @@ export class GraphTraverser {
|
||||
}
|
||||
visited.add(nodeId);
|
||||
|
||||
const incomingEdges = this.queries.getIncomingEdges(nodeId, ['calls']);
|
||||
const incomingEdges = this.queries.getIncomingEdges(nodeId, ['calls', 'references', 'imports']);
|
||||
|
||||
for (const edge of incomingEdges) {
|
||||
const callerNode = this.queries.getNodeById(edge.source);
|
||||
@@ -287,7 +287,7 @@ export class GraphTraverser {
|
||||
}
|
||||
visited.add(nodeId);
|
||||
|
||||
const outgoingEdges = this.queries.getOutgoingEdges(nodeId, ['calls']);
|
||||
const outgoingEdges = this.queries.getOutgoingEdges(nodeId, ['calls', 'references', 'imports']);
|
||||
|
||||
for (const edge of outgoingEdges) {
|
||||
const calleeNode = this.queries.getNodeById(edge.target);
|
||||
|
||||
Reference in New Issue
Block a user