1.0.2 优化打开逻辑

This commit is contained in:
睿 安
2025-09-17 12:57:41 +08:00
parent a2a77558bd
commit 0502a9ddb8
11 changed files with 267 additions and 61 deletions

View File

@@ -116,6 +116,9 @@ export function activate(context: vscode.ExtensionContext) {
isCaseSensitive: true
});
// 将 fileSystemProvider 添加到 context 以便在 commands 中使用
(global as any).fileSystemProvider = fileSystemProvider;
// 注册所有命令
console.log('正在注册命令...');
registerCommands(context, model, provider, functionExtractor, output);
@@ -147,7 +150,14 @@ export function activate(context: vscode.ExtensionContext) {
}
});
context.subscriptions.push(configChangeListener, saveListener);
// 注册文件关闭事件以清理缓存
const closeListener = vscode.workspace.onDidCloseTextDocument((doc) => {
if (doc.uri.scheme === 'squirrel') {
fileSystemProvider.clearFileCache(doc.uri);
}
});
context.subscriptions.push(configChangeListener, saveListener, closeListener);
output.appendLine('[Squirrel] 扩展激活完成');
output.show();