File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 配置文件
You can’t perform that action at this time.
0 commit comments