1.0.2 优化打开逻辑
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user