mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 01:07:46 +00:00
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:
@@ -437,7 +437,18 @@ const createMcpServer = (diffManager: DiffManager) => {
|
||||
inputSchema: OpenDiffRequestSchema.shape,
|
||||
},
|
||||
async ({ filePath, newContent }: z.infer<typeof OpenDiffRequestSchema>) => {
|
||||
await diffManager.showDiff(filePath, newContent);
|
||||
// Read old content if file exists, otherwise use empty string
|
||||
let oldContent = '';
|
||||
try {
|
||||
const fileUri = vscode.Uri.file(filePath);
|
||||
const document = await vscode.workspace.openTextDocument(fileUri);
|
||||
oldContent = document.getText();
|
||||
} catch (_error) {
|
||||
// File doesn't exist, use empty string (creating new file)
|
||||
oldContent = '';
|
||||
}
|
||||
|
||||
await diffManager.showDiff(filePath, oldContent, newContent);
|
||||
return { content: [] };
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user