feat(vscode-ide-companion): 更新核心服务和扩展功能

- 增强 extension.ts,集成新增功能
- 优化 ide-server.ts,改进服务端逻辑
- 更新 diff-manager.ts,提升差异管理能力
- 改进 ACP 连接和消息处理
- 更新会话处理器,支持新的交互模式

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
yiliang114
2025-11-21 01:54:24 +08:00
parent ecc6e22002
commit e2beecb9c4
6 changed files with 68 additions and 19 deletions

View File

@@ -177,6 +177,30 @@ export async function activate(context: vscode.ExtensionContext) {
diffManager.cancelDiff(docUri);
}
}),
vscode.commands.registerCommand(
'qwenCode.showDiff',
async (args: { path: string; oldText: string; newText: string }) => {
log(`[Command] showDiff called for: ${args.path}`);
try {
// Convert relative path to absolute if needed
let absolutePath = args.path;
if (!args.path.startsWith('/') && !args.path.match(/^[a-zA-Z]:/)) {
const workspaceFolder = vscode.workspace.workspaceFolders?.[0];
if (workspaceFolder) {
absolutePath = vscode.Uri.joinPath(
workspaceFolder.uri,
args.path,
).fsPath;
}
}
await diffManager.showDiff(absolutePath, args.oldText, args.newText);
} catch (error) {
log(`[Command] Error showing diff: ${error}`);
vscode.window.showErrorMessage(`Failed to show diff: ${error}`);
}
},
),
vscode.commands.registerCommand('qwenCode.openChat', () => {
// Open or reveal the most recent chat tab
if (webViewProviders.length > 0) {