feat: Enhance symbol search with co-location boosting and receiver type support

Improves search accuracy by boosting results when multiple query symbols appear in the same file, addressing cases where common names like "run" return too many results. Adds Go method receiver type extraction to qualified names for better searchability (e.g., "scrapeLoop.run"). Optimizes database queries with two-pass approach to handle distinctive vs common symbol names efficiently.
This commit is contained in:
Colby McHenry
2026-04-06 11:16:56 -05:00
parent d256af3a23
commit 7a3afc9124
16 changed files with 466 additions and 877 deletions
+6 -6
View File
@@ -216,12 +216,12 @@ function resolveControllerMethod(
}
}
// Try subdirectories (namespaced controllers)
const allFiles = context.getAllFiles();
for (const file of allFiles) {
if (file.endsWith(`${controller}.php`) && file.includes('Controllers')) {
const nodes = context.getNodesInFile(file);
const methodNode = nodes.find(
// Try name-based lookup for namespaced controllers
const controllerCandidates = context.getNodesByName(controller);
for (const ctrl of controllerCandidates) {
if (ctrl.kind === 'class' && ctrl.filePath.includes('Controllers')) {
const nodesInFile = context.getNodesInFile(ctrl.filePath);
const methodNode = nodesInFile.find(
(n) => n.kind === 'method' && n.name === method
);
if (methodNode) {