Skip to content

Commit 71d90f1

Browse files
committed
default hide luarocks
1 parent 11eb48e commit 71d90f1

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/extension.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,18 @@ async function initializeLuaRocks(): Promise<void> {
304304
return;
305305
}
306306

307-
// Initialize LuaRocks manager
308-
luaRocksManager = new LuaRocksManager(workspaceFolder);
309-
let workspace = await luaRocksManager.detectLuaRocksWorkspace();
310-
if (!workspace.hasRockspec) {
307+
const rockspecFiles = await vscode.workspace.findFiles(
308+
new vscode.RelativePattern(workspaceFolder, '*.rockspec'),
309+
null,
310+
10
311+
);
312+
313+
if (rockspecFiles.length === 0) {
311314
return;
312315
}
313316

317+
// Initialize LuaRocks manager
318+
luaRocksManager = new LuaRocksManager(workspaceFolder);
314319
luaRocksTreeProvider = new LuaRocksTreeProvider(luaRocksManager);
315320

316321
// Register tree view
@@ -328,7 +333,10 @@ async function initializeLuaRocks(): Promise<void> {
328333
// Check if LuaRocks is installed
329334
const isInstalled = await luaRocksManager.checkLuaRocksInstallation();
330335
if (isInstalled) {
331-
vscode.window.showInformationMessage(`Found ${workspace.rockspecFiles.length} rockspec file(s) in workspace`);
336+
let workspace = await luaRocksManager.detectLuaRocksWorkspace();
337+
if (workspace) {
338+
vscode.window.showInformationMessage(`Found ${workspace.rockspecFiles.length} rockspec file(s) in workspace`);
339+
}
332340
}
333341
}
334342

src/luarocks/LuaRocksManager.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ export class LuaRocksManager {
7777
);
7878

7979
workspace.hasRockspec = rockspecFiles.length > 0;
80-
if (!workspace.hasRockspec) {
81-
return workspace;
82-
}
83-
8480
workspace.rockspecFiles = rockspecFiles.map(uri => uri.fsPath);
8581

8682
// 检查 .luarocks 配置文件

0 commit comments

Comments
 (0)