Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit d1c72e2

Browse files
committed
Fix path handling in VSCode extension findReferences
- Use Node.js path.isAbsolute() and path.resolve() for proper cross-platform path handling - Convert to vscode.Uri.file() instead of using vscode.Uri.joinPath() with absolute paths - Fixes path duplication bug that was causing findReferences to fail Resolves path resolution issues in IDE interface MCP tool.
1 parent d73536b commit d1c72e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

extension/src/extension.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,13 @@ class DaemonClient implements vscode.Disposable {
521521
}
522522

523523
// Find all references using LSP
524+
this.outputChannel.appendLine(`workspaceFolder.uri: ${workspaceFolder.uri}`);
525+
this.outputChannel.appendLine(`symbol.definedAt.path: ${symbol.definedAt.path}`);
524526
const locations = await vscode.commands.executeCommand<vscode.Location[]>(
525527
'vscode.executeReferenceProvider',
526-
vscode.Uri.joinPath(workspaceFolder.uri, symbol.definedAt.path),
528+
vscode.Uri.file(path.isAbsolute(symbol.definedAt.path)
529+
? symbol.definedAt.path
530+
: path.resolve(workspaceFolder.uri.fsPath, symbol.definedAt.path)),
527531
new vscode.Position(symbol.definedAt.start.line - 1, symbol.definedAt.start.column - 1)
528532
);
529533

0 commit comments

Comments
 (0)