Skip to content

Commit 565f2f7

Browse files
committed
初步允许多重接口继承的形式
1 parent eb2bae6 commit 565f2f7

File tree

15 files changed

+558
-278
lines changed

15 files changed

+558
-278
lines changed

EmmyLua-Common/src/main/ext/com/tang/intellij/lua/editor/completion/LuaCompletionContributor.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ class LuaCompletionContributor : CompletionContributor() {
9191
extend(CompletionType.BASIC, SHOW_CALLBACK, CallbackCompletionProvider())
9292

9393
extend(CompletionType.BASIC, SHOW_STRING_INNER, StringInnerTypeCompletionProvider())
94+
95+
extend(CompletionType.BASIC, SHOW_CONST_EXPR, ConstExprProvider())
9496
}
9597

9698
/*override fun fillCompletionVariants(parameters: CompletionParameters, result: CompletionResultSet) {
@@ -182,6 +184,12 @@ class LuaCompletionContributor : CompletionContributor() {
182184
psiElement(LuaTypes.ID).withParent(LuaTableField::class.java)
183185
)
184186

187+
private val SHOW_CONST_EXPR = psiElement(LuaTypes.ID)
188+
.withParent(
189+
psiElement(LuaNameExpr::class.java)
190+
.withParent(psiElement(LuaArgs::class.java))
191+
)
192+
185193
private val IN_TABLE_STRING_INDEX = psiElement().andOr(
186194
// psiElement(LuaTypes.LITERAL_EXPR).withParent(
187195
// psiElement(LuaIndexExpr::class.java)

EmmyLua-Common/src/main/gen/com/tang/intellij/lua/comment/lexer/_LuaDocLexer.java

Lines changed: 248 additions & 234 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmmyLua-Common/src/main/gen/com/tang/intellij/lua/comment/parser/LuaDocParser.java

Lines changed: 42 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmmyLua-Common/src/main/gen/com/tang/intellij/lua/comment/psi/LuaDocClassNameRefList.java

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmmyLua-Common/src/main/gen/com/tang/intellij/lua/comment/psi/LuaDocTagClass.java

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmmyLua-Common/src/main/gen/com/tang/intellij/lua/comment/psi/LuaDocTypes.java

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmmyLua-Common/src/main/gen/com/tang/intellij/lua/comment/psi/LuaDocVisitor.java

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmmyLua-Common/src/main/gen/com/tang/intellij/lua/comment/psi/impl/LuaDocClassNameRefListImpl.java

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmmyLua-Common/src/main/gen/com/tang/intellij/lua/comment/psi/impl/LuaDocTagClassImpl.java

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EmmyLua-Common/src/main/java/com/tang/intellij/lua/doc.bnf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
TAG_NAME_OVERLOAD = 'overload'
7373
TAG_NAME_MODULE = 'module'
7474
TAG_NAME_ENUM = 'enum'
75+
TAG_NAME_INTERFACE = 'interface'
7576
TAG_NAME_SEE = 'see'
7677
TAG_NAME_GENERIC = 'generic'
7778
TAG_NAME_ALIAS = 'alias'
@@ -243,7 +244,13 @@ tag_return ::= TAG_NAME_RETURN type_list comment_string? {
243244
class_name_ref ::= ID {
244245
methods = [getReference resolveType]
245246
}
246-
tag_class ::= (TAG_NAME_CLASS|TAG_NAME_MODULE|TAG_NAME_ENUM) ID (EXTENDS class_name_ref)? comment_string? {
247+
248+
class_name_ref_list ::= class_name_ref (',' class_name_ref)* {
249+
pin = 1
250+
methods = [getClasses]
251+
}
252+
253+
tag_class ::= (TAG_NAME_CLASS|TAG_NAME_MODULE|TAG_NAME_ENUM|TAG_NAME_INTERFACE) ID (EXTENDS class_name_ref_list)? comment_string? {
247254
pin = 2
248255
implements = [
249256
"com.tang.intellij.lua.comment.psi.LuaDocPsiElement"
@@ -262,9 +269,10 @@ tag_class ::= (TAG_NAME_CLASS|TAG_NAME_MODULE|TAG_NAME_ENUM) ID (EXTENDS class_n
262269
toString
263270
isDeprecated
264271

265-
superClassNameRef = 'class_name_ref'
272+
superClassNameRef = 'class_name_ref_list'
266273
module = 'TAG_NAME_MODULE'
267274
enum = 'TAG_NAME_ENUM'
275+
interface = 'TAG_NAME_INTERFACE'
268276
]
269277
}
270278

0 commit comments

Comments
 (0)