Skip to content

Commit f0355cf

Browse files
committed
在 class / struct / extension 中,忽略类函数内部的 local 变量,将 export 变量的 symbol 放置到类后展示
1 parent 8592f90 commit f0355cf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

luahelper-lsp/langserver/check/common/scope_info.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,12 @@ func (scope *ScopeInfo) FindAllLocalVal(gScopes []*ScopeInfo) (allSymbolStruct [
489489
allSymbolStruct = append(allSymbolStruct, oneSymbol)
490490
}
491491

492-
// 分析当前scope中中没有分析的 subscope
493-
for scopeInfo := range scopeInfos {
494-
symbols := scopeInfo.FindAllLocalVal(nil)
495-
allSymbolStruct = append(allSymbolStruct, symbols...)
492+
if scope.ExtMark != "class" {
493+
// 分析当前scope中中没有分析的 subscope
494+
for scopeInfo := range scopeInfos {
495+
symbols := scopeInfo.FindAllLocalVal(nil)
496+
allSymbolStruct = append(allSymbolStruct, symbols...)
497+
}
496498
}
497499

498500
return

0 commit comments

Comments
 (0)