Skip to content

Commit 8707528

Browse files
committed
Enable tracking of untitled documents in the workspace text document change listener
1 parent 0b31962 commit 8707528

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/editor/src/commands/apply-chat-response-command/utils/preview/workspace-listener.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ export const setup_workspace_listeners = (params: {
9898

9999
const text_document_change_listener =
100100
vscode.workspace.onDidChangeTextDocument(async (event) => {
101+
if (
102+
event.document.uri.scheme != 'file' &&
103+
event.document.uri.scheme != 'untitled'
104+
)
105+
return
106+
101107
const changed_doc_path = event.document.uri.fsPath
102108
const changed_file_in_preview = params.prepared_files.find(
103109
(pf) => pf.sanitized_path == changed_doc_path
@@ -130,7 +136,6 @@ export const setup_workspace_listeners = (params: {
130136
})
131137
} else {
132138
const doc = event.document
133-
if (doc.uri.scheme != 'file') return
134139
const workspace_folder = vscode.workspace.getWorkspaceFolder(doc.uri)
135140
if (!workspace_folder) return
136141

0 commit comments

Comments
 (0)