2025-07-14 15:34:44 +00:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import * as vscode from 'vscode';
|
2025-07-16 21:03:56 -04:00
|
|
|
import { IDEServer } from './ide-server';
|
|
|
|
|
|
|
|
|
|
let ideServer: IDEServer;
|
|
|
|
|
let logger: vscode.OutputChannel;
|
2025-07-14 15:34:44 +00:00
|
|
|
|
|
|
|
|
export async function activate(context: vscode.ExtensionContext) {
|
2025-07-16 21:03:56 -04:00
|
|
|
logger = vscode.window.createOutputChannel('Gemini CLI IDE Companion');
|
|
|
|
|
logger.appendLine('Starting Gemini CLI IDE Companion server...');
|
|
|
|
|
ideServer = new IDEServer(logger);
|
|
|
|
|
try {
|
|
|
|
|
await ideServer.start(context);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
const message = err instanceof Error ? err.message : String(err);
|
|
|
|
|
logger.appendLine(`Failed to start IDE server: ${message}`);
|
|
|
|
|
}
|
2025-07-14 15:34:44 +00:00
|
|
|
}
|
|
|
|
|
|
2025-07-16 21:03:56 -04:00
|
|
|
export function deactivate() {
|
|
|
|
|
if (ideServer) {
|
|
|
|
|
logger.appendLine('Deactivating Gemini CLI IDE Companion...');
|
|
|
|
|
return ideServer.stop().finally(() => {
|
|
|
|
|
logger.dispose();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (logger) {
|
|
|
|
|
logger.dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|