Skip to content

Commit 79be73e

Browse files
committed
refactor(core): Simplify file path handling in openFile
- Remove workspace root path resolution - Use direct file paths for custom provider configuration files - Clean up error handling formatting
1 parent 1365e67 commit 79be73e

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/integrations/misc/open-file.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,7 @@ interface OpenFileOptions {
2727

2828
export async function openFile(filePath: string, options: OpenFileOptions = {}) {
2929
try {
30-
// Get workspace root
31-
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath
32-
if (!workspaceRoot) {
33-
throw new Error("No workspace root found")
34-
}
35-
36-
// If path starts with ./, resolve it relative to workspace root
37-
const fullPath = filePath.startsWith("./") ? path.join(workspaceRoot, filePath.slice(2)) : filePath
38-
39-
const uri = vscode.Uri.file(fullPath)
40-
30+
const uri = vscode.Uri.file(filePath)
4131
// Check if file exists
4232
try {
4333
await vscode.workspace.fs.stat(uri)

0 commit comments

Comments
 (0)