Skip to content
Merged
Changes from 2 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
19 changes: 18 additions & 1 deletion packages/vscode-ide-companion/src/diff-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@
constructor(
private readonly log: (message: string) => void,
private readonly diffContentProvider: DiffContentProvider,
) {}
) {
vscode.window.onDidChangeActiveTextEditor((editor) => {

Check failure on line 62 in packages/vscode-ide-companion/src/diff-manager.ts

View workflow job for this annotation

GitHub Actions / Test (macos-latest, 24.x)

src/extension.test.ts > activate > should launch the Gemini CLI when the user clicks the button

TypeError: window.onDidChangeActiveTextEditor is not a function ❯ new DiffManager src/diff-manager.ts:62:19 ❯ Module.activate src/extension.ts:45:23 ❯ src/extension.test.ts:92:11

Check failure on line 62 in packages/vscode-ide-companion/src/diff-manager.ts

View workflow job for this annotation

GitHub Actions / Test (macos-latest, 24.x)

src/extension.test.ts > activate > should not show the info message on subsequent activations

TypeError: window.onDidChangeActiveTextEditor is not a function ❯ new DiffManager src/diff-manager.ts:62:19 ❯ Module.activate src/extension.ts:45:23 ❯ src/extension.test.ts:83:11

Check failure on line 62 in packages/vscode-ide-companion/src/diff-manager.ts

View workflow job for this annotation

GitHub Actions / Test (macos-latest, 24.x)

src/extension.test.ts > activate > should show the info message on first activation

TypeError: window.onDidChangeActiveTextEditor is not a function ❯ new DiffManager src/diff-manager.ts:62:19 ❯ Module.activate src/extension.ts:45:23 ❯ src/extension.test.ts:74:11

Check failure on line 62 in packages/vscode-ide-companion/src/diff-manager.ts

View workflow job for this annotation

GitHub Actions / Test (macos-latest, 22.x)

src/extension.test.ts > activate > should launch the Gemini CLI when the user clicks the button

TypeError: window.onDidChangeActiveTextEditor is not a function ❯ new DiffManager src/diff-manager.ts:62:19 ❯ Module.activate src/extension.ts:45:23 ❯ src/extension.test.ts:92:11

Check failure on line 62 in packages/vscode-ide-companion/src/diff-manager.ts

View workflow job for this annotation

GitHub Actions / Test (macos-latest, 22.x)

src/extension.test.ts > activate > should not show the info message on subsequent activations

TypeError: window.onDidChangeActiveTextEditor is not a function ❯ new DiffManager src/diff-manager.ts:62:19 ❯ Module.activate src/extension.ts:45:23 ❯ src/extension.test.ts:83:11

Check failure on line 62 in packages/vscode-ide-companion/src/diff-manager.ts

View workflow job for this annotation

GitHub Actions / Test (macos-latest, 22.x)

src/extension.test.ts > activate > should show the info message on first activation

TypeError: window.onDidChangeActiveTextEditor is not a function ❯ new DiffManager src/diff-manager.ts:62:19 ❯ Module.activate src/extension.ts:45:23 ❯ src/extension.test.ts:74:11
this.updateDiffContext(editor);
});
this.updateDiffContext(vscode.window.activeTextEditor);
}

/**
* Creates and shows a new diff view.
Expand Down Expand Up @@ -199,6 +204,18 @@
);
}

private async updateDiffContext(editor: vscode.TextEditor | undefined) {
const isVisible =
!!editor &&
editor.document.uri.scheme === DIFF_SCHEME &&
this.diffDocuments.has(editor.document.uri.toString());
await vscode.commands.executeCommand(
'setContext',
'gemini.diff.isVisible',
isVisible,
);
}

private addDiffDocument(uri: vscode.Uri, diffInfo: DiffInfo) {
this.diffDocuments.set(uri.toString(), diffInfo);
}
Expand Down
Loading