Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions extensions/vscode/src/diff/vertical/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ export class VerticalDiffManager {
// Get the current editor fileUri/range
let editor = vscode.window.activeTextEditor;
if (!editor) {
// Emit closed status so the tool call doesn't hang
void this.webviewProtocol.request("updateApplyState", {
streamId,
status: "closed",
numDiffs: 0,
toolCallId,
});
return;
}
const fileUri = editor.document.uri.toString();
Expand Down Expand Up @@ -254,6 +261,15 @@ export class VerticalDiffManager {

if (!diffHandler) {
console.warn("Issue occurred while creating new vertical diff handler");
// Emit closed status so the tool call doesn't hang
void this.webviewProtocol.request("updateApplyState", {
streamId,
status: "closed",
numDiffs: 0,
fileContent: editor.document.getText(),
filepath: fileUri,
toolCallId,
});
return;
}

Expand Down Expand Up @@ -305,6 +321,13 @@ export class VerticalDiffManager {

const editor = vscode.window.activeTextEditor;
if (!editor) {
// Emit closed status so the tool call doesn't hang
void this.webviewProtocol.request("updateApplyState", {
streamId,
status: "closed",
numDiffs: 0,
toolCallId,
});
return;
}

Expand Down Expand Up @@ -333,6 +356,15 @@ export class VerticalDiffManager {

if (!diffHandler) {
console.warn("Issue occurred while creating vertical diff handler");
// Emit closed status so the tool call doesn't hang
void this.webviewProtocol.request("updateApplyState", {
streamId,
status: "closed",
numDiffs: 0,
fileContent: editor.document.getText(),
filepath: fileUri,
toolCallId,
});
return;
}

Expand Down
Loading
Loading