Skip to content

Commit e0d4a08

Browse files
committed
LuaRocks: 只有在第一次打开工作区时才显示提示
1 parent f51f90e commit e0d4a08

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/luarocks/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ export async function initializeLuaRocks(): Promise<void> {
3939
luaRocksTreeProvider
4040
);
4141

42-
// Check if LuaRocks is installed
4342
const isInstalled = await luaRocksManager.checkLuaRocksInstallation();
4443
if (isInstalled) {
4544
let workspace = await luaRocksManager.detectLuaRocksWorkspace();
4645
if (workspace) {
47-
vscode.window.showInformationMessage(`Found ${workspace.rockspecFiles.length} rockspec file(s) in workspace`);
46+
// 只有在第一次打开工作区时才显示提示
47+
const hasShownMessage = extensionContext.vscodeContext.workspaceState.get('luarocks.rockspecMessageShown', false);
48+
if (!hasShownMessage) {
49+
vscode.window.showInformationMessage(`Found ${workspace.rockspecFiles.length} rockspec file(s) in workspace`);
50+
await extensionContext.vscodeContext.workspaceState.update('luarocks.rockspecMessageShown', true);
51+
}
4852
}
4953
}
5054
}

0 commit comments

Comments
 (0)