mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 01:07:46 +00:00
IDE integration Gemini command multi-folder support + bump version (#6265)
Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit is contained in:
@@ -85,21 +85,9 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
|
||||
if (!context.globalState.get(INFO_MESSAGE_SHOWN_KEY)) {
|
||||
void vscode.window
|
||||
.showInformationMessage(
|
||||
'Gemini CLI Companion extension successfully installed. Please restart your terminal to enable full IDE integration.',
|
||||
'Re-launch Gemini CLI',
|
||||
)
|
||||
.then(
|
||||
(selection) => {
|
||||
if (selection === 'Re-launch Gemini CLI') {
|
||||
void vscode.commands.executeCommand('gemini-cli.runGeminiCLI');
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
log(`Failed to show information message: ${String(err)}`);
|
||||
},
|
||||
);
|
||||
void vscode.window.showInformationMessage(
|
||||
'Gemini CLI Companion extension successfully installed.',
|
||||
);
|
||||
context.globalState.update(INFO_MESSAGE_SHOWN_KEY, true);
|
||||
}
|
||||
|
||||
@@ -107,11 +95,33 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
vscode.workspace.onDidChangeWorkspaceFolders(() => {
|
||||
updateWorkspacePath(context);
|
||||
}),
|
||||
vscode.commands.registerCommand('gemini-cli.runGeminiCLI', () => {
|
||||
const geminiCmd = 'gemini';
|
||||
const terminal = vscode.window.createTerminal(`Gemini CLI`);
|
||||
terminal.show();
|
||||
terminal.sendText(geminiCmd);
|
||||
vscode.commands.registerCommand('gemini-cli.runGeminiCLI', async () => {
|
||||
const workspaceFolders = vscode.workspace.workspaceFolders;
|
||||
if (!workspaceFolders || workspaceFolders.length === 0) {
|
||||
vscode.window.showInformationMessage(
|
||||
'No folder open. Please open a folder to run Gemini CLI.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let selectedFolder: vscode.WorkspaceFolder | undefined;
|
||||
if (workspaceFolders.length === 1) {
|
||||
selectedFolder = workspaceFolders[0];
|
||||
} else {
|
||||
selectedFolder = await vscode.window.showWorkspaceFolderPick({
|
||||
placeHolder: 'Select a folder to run Gemini CLI in',
|
||||
});
|
||||
}
|
||||
|
||||
if (selectedFolder) {
|
||||
const geminiCmd = 'gemini';
|
||||
const terminal = vscode.window.createTerminal({
|
||||
name: `Gemini CLI (${selectedFolder.name})`,
|
||||
cwd: selectedFolder.uri.fsPath,
|
||||
});
|
||||
terminal.show();
|
||||
terminal.sendText(geminiCmd);
|
||||
}
|
||||
}),
|
||||
vscode.commands.registerCommand('gemini-cli.showNotices', async () => {
|
||||
const noticePath = vscode.Uri.joinPath(
|
||||
|
||||
Reference in New Issue
Block a user