Skip to content

Commit d91dbdc

Browse files
committed
Replace VS Code text document reading with direct filesystem read for performance
1 parent 58b6948 commit d91dbdc

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • packages/vscode/src/commands/apply-chat-response-command/utils/preview

‎packages/vscode/src/commands/apply-chat-response-command/utils/preview/file-preparer.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ export const prepare_files_from_original_states = async (params: {
3535
let current_content = ''
3636
try {
3737
if (fs.existsSync(sanitized_file_path)) {
38-
const document =
39-
await vscode.workspace.openTextDocument(sanitized_file_path)
40-
current_content = document.getText()
38+
current_content = fs.readFileSync(sanitized_file_path, 'utf8')
4139
}
4240
} catch (error) {
4341
continue

0 commit comments

Comments
 (0)