File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,11 @@ async function initializeLuaRocks(): Promise<void> {
306306
307307 // Initialize LuaRocks manager
308308 luaRocksManager = new LuaRocksManager ( workspaceFolder ) ;
309+ let workspace = await luaRocksManager . detectLuaRocksWorkspace ( ) ;
310+ if ( ! workspace . hasRockspec ) {
311+ return ;
312+ }
313+
309314 luaRocksTreeProvider = new LuaRocksTreeProvider ( luaRocksManager ) ;
310315
311316 // Register tree view
@@ -323,11 +328,7 @@ async function initializeLuaRocks(): Promise<void> {
323328 // Check if LuaRocks is installed
324329 const isInstalled = await luaRocksManager . checkLuaRocksInstallation ( ) ;
325330 if ( isInstalled ) {
326- // Auto-detect workspace type
327- const workspace = await luaRocksManager . detectLuaRocksWorkspace ( ) ;
328- if ( workspace . hasRockspec ) {
329- vscode . window . showInformationMessage ( `Found ${ workspace . rockspecFiles . length } rockspec file(s) in workspace` ) ;
330- }
331+ vscode . window . showInformationMessage ( `Found ${ workspace . rockspecFiles . length } rockspec file(s) in workspace` ) ;
331332 }
332333}
333334
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ export class LuaLanguageConfiguration implements LanguageConfiguration {
3636 undefined ,
3737 workspace . workspaceFolders ?. [ 0 ]
3838 ) ;
39- const autoInsertTripleDash = config . get < boolean > ( 'emmylua.misc.autoInsertTripleDash ' , true ) ;
39+ const completeAnnotation = config . get < boolean > ( 'emmylua.language.completeAnnotation ' , true ) ;
4040 // 第二个参数是默认值(当配置不存在时使用)
41- if ( autoInsertTripleDash ) {
41+ if ( completeAnnotation ) {
4242 this . onEnterRules = [
4343 {
4444 action : { indentAction : IndentAction . None , appendText : "--- " } ,
Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ export class LuaRocksManager {
7777 ) ;
7878
7979 workspace . hasRockspec = rockspecFiles . length > 0 ;
80+ if ( ! workspace . hasRockspec ) {
81+ return workspace ;
82+ }
83+
8084 workspace . rockspecFiles = rockspecFiles . map ( uri => uri . fsPath ) ;
8185
8286 // 检查 .luarocks 配置文件
You can’t perform that action at this time.
0 commit comments