File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
src/main/java/com/tang/intellij/lua/stubs/index Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,10 @@ import com.intellij.psi.stubs.IndexSink
2222import com.intellij.psi.stubs.IntStubIndexExtension
2323import com.intellij.psi.stubs.StubIndex
2424import com.intellij.util.Processor
25- import com.tang.intellij.lua.comment.psi.LuaDocPsiElement
25+ import com.tang.intellij.lua.comment.psi.LuaDocFieldDef
2626import com.tang.intellij.lua.psi.LuaClassMember
2727import com.tang.intellij.lua.psi.LuaClassMethod
28+ import com.tang.intellij.lua.psi.LuaTableField
2829import com.tang.intellij.lua.search.SearchContext
2930import com.tang.intellij.lua.ty.ITyClass
3031
@@ -69,10 +70,26 @@ class LuaClassMemberIndex : IntStubIndexExtension<LuaClassMember>() {
6970
7071 fun find (type : ITyClass , fieldName : String , context : SearchContext ): LuaClassMember ? {
7172 var perfect: LuaClassMember ? = null
73+ var docField: LuaDocFieldDef ? = null
74+ var tableField: LuaTableField ? = null
7275 processAll(type, fieldName, context, Processor {
73- perfect = it
74- it !is LuaDocPsiElement
76+ when (it) {
77+ is LuaDocFieldDef -> {
78+ docField = it
79+ false
80+ }
81+ is LuaTableField -> {
82+ tableField = it
83+ true
84+ }
85+ else -> {
86+ perfect = it
87+ true
88+ }
89+ }
7590 })
91+ if (docField != null ) return docField
92+ if (tableField != null ) return tableField
7693 return perfect
7794 }
7895
You can’t perform that action at this time.
0 commit comments