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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user