Skip to content

Commit bf6cc42

Browse files
committed
refactor(webview): use openFile utility for file opening
- Replaced direct `vscode.commands.executeCommand("vscode.open")` call with the `openFile` utility. - Centralizes file opening logic, improving reusability and maintainability within the webview provider.
1 parent 1d8e86a commit bf6cc42

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import { ShadowCheckpointService } from "../../services/checkpoints/ShadowCheckp
5252
import { CodeIndexManager } from "../../services/code-index/manager"
5353
import type { IndexProgressUpdate } from "../../services/code-index/interfaces/manager"
5454
import { fileExistsAtPath, safeReadFile } from "../../utils/fs"
55+
import { openFile } from "../../integrations/misc/open-file"
5556
import { setTtsEnabled, setTtsSpeed } from "../../utils/tts"
5657
import { ContextProxy } from "../config/ContextProxy"
5758
import { ProviderSettingsManager } from "../config/ProviderSettingsManager"
@@ -1018,11 +1019,7 @@ export class ClineProvider
10181019
return
10191020
}
10201021

1021-
const uri = vscode.Uri.file(filePath)
1022-
await vscode.commands.executeCommand("vscode.open", uri, {
1023-
preview: false,
1024-
preserveFocus: true,
1025-
})
1022+
await openFile(filePath, { create: true })
10261023
await vscode.commands.executeCommand("workbench.action.files.revert")
10271024
}
10281025

0 commit comments

Comments
 (0)