开始修复的备份
This commit is contained in:
17
dist/extension.js
vendored
17
dist/extension.js
vendored
@@ -49,6 +49,7 @@ const onTypeFormattingProvider_1 = require("./providers/onTypeFormattingProvider
|
||||
const documentFormattingProvider_1 = require("./providers/documentFormattingProvider");
|
||||
const codeErrorProvider_1 = require("./providers/codeErrorProvider");
|
||||
const apiParser_1 = require("./providers/apiParser");
|
||||
const localClient_1 = require("./localClient");
|
||||
function activate(context) {
|
||||
console.log('Squirrel NUT Explorer 正在激活...');
|
||||
// 初始化API解析器
|
||||
@@ -132,12 +133,26 @@ function activate(context) {
|
||||
const saveListener = vscode.workspace.onDidSaveTextDocument(async (doc) => {
|
||||
if (doc.uri.scheme === 'squirrel') {
|
||||
const filePath = doc.uri.path.substring(1); // 去掉开头的 '/'
|
||||
const success = await model.saveFileContent(filePath, doc.getText());
|
||||
const fileContent = doc.getText();
|
||||
const success = await model.saveFileContent(filePath, fileContent);
|
||||
if (success) {
|
||||
output.appendLine(`[Squirrel] 文件 ${filePath} 保存成功`);
|
||||
provider.refresh();
|
||||
// 更新函数缓存
|
||||
await functionExtractor.updateFileCache(model, filePath);
|
||||
// 发送文件内容到本地C++服务
|
||||
try {
|
||||
const sendSuccess = await (0, localClient_1.sendFileToCppService)(filePath, fileContent);
|
||||
if (sendSuccess) {
|
||||
output.appendLine(`[Squirrel] 文件 ${filePath} 已发送到C++服务`);
|
||||
}
|
||||
else {
|
||||
output.appendLine(`[Squirrel] 文件 ${filePath} 发送到C++服务失败`);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
output.appendLine(`[Squirrel] 发送文件到C++服务时发生错误: ${error}`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
output.appendLine(`[Squirrel] 文件 ${filePath} 保存失败`);
|
||||
|
||||
2
dist/extension.js.map
vendored
2
dist/extension.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user