1.0.2 优化打开逻辑
This commit is contained in:
10
dist/extension.js
vendored
10
dist/extension.js
vendored
@@ -112,6 +112,8 @@ function activate(context) {
|
||||
vscode.workspace.registerFileSystemProvider('squirrel', fileSystemProvider, {
|
||||
isCaseSensitive: true
|
||||
});
|
||||
// 将 fileSystemProvider 添加到 context 以便在 commands 中使用
|
||||
global.fileSystemProvider = fileSystemProvider;
|
||||
// 注册所有命令
|
||||
console.log('正在注册命令...');
|
||||
(0, commands_1.registerCommands)(context, model, provider, functionExtractor, output);
|
||||
@@ -139,7 +141,13 @@ function activate(context) {
|
||||
}
|
||||
}
|
||||
});
|
||||
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