feat:对本地文件进行修改

- 对某一行进行修改
- 将文件中的某些词进行替换
- 将文件重命名
This commit is contained in:
Roe-xin
2025-12-12 09:57:33 +08:00
parent 8af5976501
commit 94225a3525
4 changed files with 552 additions and 61 deletions

View File

@ -1,6 +1,13 @@
import * as vscode from "vscode";
import { getWebviewContent } from "../views/webviewContent";
import { handleUserMessage, insertCodeToEditor, handleReadFile } from "../utils/messageHandler";
import {
handleUserMessage,
insertCodeToEditor,
handleReadFile,
handleUpdateFile,
handleRenameFile,
handleReplaceInFile
} from "../utils/messageHandler";
/**
* 创建并显示 IC 助手面板
@ -39,6 +46,15 @@ export function showICHelperPanel(context: vscode.ExtensionContext) {
case "readFile":
handleReadFile(panel, message.filePath);
break;
case "updateFile":
handleUpdateFile(panel, message.filePath, message.content);
break;
case "renameFile":
handleRenameFile(panel, message.oldPath, message.newPath);
break;
case "replaceInFile":
handleReplaceInFile(panel, message.filePath, message.searchText, message.replaceText);
break;
case "insertCode":
insertCodeToEditor(message.code);
break;