mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Merge branch 'main' of https://github.com/QwenLM/qwen-code into feat/vscode-ide-companion-borading
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
|||||||
} from '@qwen-code/qwen-code-core/src/ide/detect-ide.js';
|
} from '@qwen-code/qwen-code-core/src/ide/detect-ide.js';
|
||||||
import { WebViewProvider } from './webview/WebViewProvider.js';
|
import { WebViewProvider } from './webview/WebViewProvider.js';
|
||||||
import { registerNewCommands } from './commands/index.js';
|
import { registerNewCommands } from './commands/index.js';
|
||||||
|
import { CliVersionChecker } from './cli/cliVersionChecker.js';
|
||||||
|
|
||||||
const CLI_IDE_COMPANION_IDENTIFIER = 'qwenlm.qwen-code-vscode-ide-companion';
|
const CLI_IDE_COMPANION_IDENTIFIER = 'qwenlm.qwen-code-vscode-ide-companion';
|
||||||
const INFO_MESSAGE_SHOWN_KEY = 'qwenCodeInfoMessageShown';
|
const INFO_MESSAGE_SHOWN_KEY = 'qwenCodeInfoMessageShown';
|
||||||
@@ -103,6 +104,33 @@ async function checkForUpdates(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update status bar item with CLI version information
|
||||||
|
*/
|
||||||
|
async function updateStatusBarItem(
|
||||||
|
statusBarItem: vscode.StatusBarItem,
|
||||||
|
context: vscode.ExtensionContext,
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
// Initialize the version checker
|
||||||
|
const versionChecker = CliVersionChecker.getInstance(context);
|
||||||
|
|
||||||
|
// Get version status for display
|
||||||
|
const versionStatus = await versionChecker.getVersionStatus();
|
||||||
|
|
||||||
|
// Update status bar item
|
||||||
|
statusBarItem.text = versionStatus;
|
||||||
|
statusBarItem.tooltip = 'Qwen Code CLI Version Information';
|
||||||
|
statusBarItem.show();
|
||||||
|
} catch (error) {
|
||||||
|
const message = error instanceof Error ? error.message : String(error);
|
||||||
|
log(`Error updating status bar: ${message}`);
|
||||||
|
statusBarItem.text = 'CLI: Error';
|
||||||
|
statusBarItem.tooltip = 'Failed to get CLI version information';
|
||||||
|
statusBarItem.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export async function activate(context: vscode.ExtensionContext) {
|
export async function activate(context: vscode.ExtensionContext) {
|
||||||
logger = vscode.window.createOutputChannel('Qwen Code Companion');
|
logger = vscode.window.createOutputChannel('Qwen Code Companion');
|
||||||
log = createLogger(context, logger);
|
log = createLogger(context, logger);
|
||||||
@@ -110,6 +138,17 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||||||
|
|
||||||
checkForUpdates(context, log);
|
checkForUpdates(context, log);
|
||||||
|
|
||||||
|
// Create status bar item for CLI version info
|
||||||
|
const versionStatusBarItem = vscode.window.createStatusBarItem(
|
||||||
|
vscode.StatusBarAlignment.Right,
|
||||||
|
100,
|
||||||
|
);
|
||||||
|
versionStatusBarItem.command = 'qwen-code.showCliVersionInfo';
|
||||||
|
context.subscriptions.push(versionStatusBarItem);
|
||||||
|
|
||||||
|
// Update status bar with CLI version info
|
||||||
|
updateStatusBarItem(versionStatusBarItem, context);
|
||||||
|
|
||||||
const diffContentProvider = new DiffContentProvider();
|
const diffContentProvider = new DiffContentProvider();
|
||||||
const diffManager = new DiffManager(
|
const diffManager = new DiffManager(
|
||||||
log,
|
log,
|
||||||
@@ -267,6 +306,26 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||||||
vscode.workspace.onDidGrantWorkspaceTrust(() => {
|
vscode.workspace.onDidGrantWorkspaceTrust(() => {
|
||||||
ideServer.syncEnvVars();
|
ideServer.syncEnvVars();
|
||||||
}),
|
}),
|
||||||
|
vscode.commands.registerCommand(
|
||||||
|
'qwen-code.showCliVersionInfo',
|
||||||
|
async () => {
|
||||||
|
try {
|
||||||
|
const versionChecker = CliVersionChecker.getInstance(context);
|
||||||
|
const versionStatus = await versionChecker.getVersionStatus();
|
||||||
|
|
||||||
|
// Show information message with version details
|
||||||
|
vscode.window.showInformationMessage(
|
||||||
|
`Qwen Code CLI Version: ${versionStatus}`,
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
const message =
|
||||||
|
error instanceof Error ? error.message : String(error);
|
||||||
|
vscode.window.showErrorMessage(
|
||||||
|
`Failed to get CLI version info: ${message}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
vscode.commands.registerCommand(
|
vscode.commands.registerCommand(
|
||||||
'qwen-code.runQwenCode',
|
'qwen-code.runQwenCode',
|
||||||
async (
|
async (
|
||||||
|
|||||||
Reference in New Issue
Block a user