Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
CppCXY committed Nov 13, 2024
1 parent c23ce83 commit 3ba4714
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 1,191 deletions.
154 changes: 25 additions & 129 deletions .idea/workspace.xml

Large diffs are not rendered by default.

1,008 changes: 0 additions & 1,008 deletions gen/com/tang/intellij/lua/comment/lexer/_LuaDocLexer.java~

This file was deleted.

43 changes: 9 additions & 34 deletions src/main/java/com/tang/intellij/lua/annotator/LuaAnnotator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@ import com.tang.intellij.lua.psi.*
class LuaAnnotator : Annotator {
private var myHolder: AnnotationHolder? = null
private val luaVisitor = LuaElementVisitor()
private val docVisitor = LuaDocElementVisitor()

// companion object {
// private val STD_MARKER = Key.create<Boolean>("lua.std.marker")
// private val UPVALUE = HighlightSeverity("UPVALUE", HighlightSeverity.INFORMATION.myVal + 1)
// }
companion object {
private val UPVALUE = HighlightSeverity("UPVALUE", HighlightSeverity.INFORMATION.myVal + 1)
}

override fun annotate(psiElement: PsiElement, annotationHolder: AnnotationHolder) {
myHolder = annotationHolder
if (psiElement is LuaDocPsiElement) {
psiElement.accept(docVisitor)
} else if (psiElement is LuaPsiElement) {
if (psiElement is LuaPsiElement) {
psiElement.accept(luaVisitor)
}
myHolder = null
Expand Down Expand Up @@ -76,7 +72,7 @@ class LuaAnnotator : Annotator {
super.visitTableField(o)
val id = o.id
if (id != null) {
newInfoAnnotation(id, null) {
newInfoAnnotation(id, "field") {
it.textAttributes(LuaHighlightingData.FIELD)
}
}
Expand Down Expand Up @@ -123,8 +119,7 @@ class LuaAnnotator : Annotator {
newInfoAnnotation(expr, null) {
it.textAttributes(LuaHighlightingData.INSTANCE_METHOD)
}
}
else if(expr is LuaIndexExpr) {
} else if (expr is LuaIndexExpr) {
val id = expr.id
if (id != null) {
newInfoAnnotation(id, null) {
Expand All @@ -137,7 +132,7 @@ class LuaAnnotator : Annotator {
override fun visitFuncDef(o: LuaFuncDef) {
super.visitFuncDef(o)
val id = o.id
if (id != null){
if (id != null) {
newInfoAnnotation(id, null) {
it.textAttributes(LuaHighlightingData.GLOBAL_FUNCTION)
}
Expand All @@ -157,32 +152,12 @@ class LuaAnnotator : Annotator {
}
}

internal inner class LuaDocElementVisitor : LuaDocVisitor() {
// internal inner class LuaDocElementVisitor : LuaDocVisitor() {
// override fun visitTagClass(o: LuaDocTagClass) {
// super.visitTagClass(o)
// newInfoAnnotation(o.id, null) {
// it.textAttributes(LuaHighlightingData.CLASS_NAME)
// }
// }
//
// override fun visitTagAlias(o: LuaDocTagAlias) {
// super.visitTagAlias(o)
// val id = o.id ?: return
// newInfoAnnotation(id, null) {
// it.textAttributes(LuaHighlightingData.TYPE_ALIAS)
// }
// }

// override fun visitClassNameRef(o: LuaDocClassNameRef) {
// newInfoAnnotation(o, null) {
// it.textAttributes(LuaHighlightingData.CLASS_REFERENCE)
// }
// }

// override fun visitParamNameRef(o: LuaDocParamNameRef) {
// newInfoAnnotation(o, null) {
// it.textAttributes(LuaHighlightingData.DOC_COMMENT_TAG_VALUE)
// }
// }
}
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package com.tang.intellij.lua.codeInsight
import com.intellij.codeInsight.highlighting.ReadWriteAccessDetector
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiReference
import com.tang.intellij.lua.comment.psi.LuaDocTagClass
import com.tang.intellij.lua.comment.psi.LuaDocTagField
import com.tang.intellij.lua.psi.LuaExpr
import com.tang.intellij.lua.psi.LuaIndexExpr
import com.tang.intellij.lua.psi.LuaNameDef
Expand All @@ -24,8 +22,6 @@ class LuaReadWriteAccessDetector : ReadWriteAccessDetector() {
return when (element) {
is LuaNameDef -> Access.Write
is LuaExpr -> Access.Read
is LuaDocTagClass -> Access.Write
is LuaDocTagField -> Access.Write
else -> return Access.ReadWrite
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.tang.intellij.lua.psi.LuaPsiElement;

/**
* 注释接口
* Created by TangZX on 2016/11/25.
*/
public interface LuaDocPsiElement extends LuaPsiElement {
Expand Down
17 changes: 3 additions & 14 deletions src/main/java/com/tang/intellij/lua/lang/LuaParserDefinition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,12 @@ class LuaParserDefinition : ParserDefinition {
LuaTypes.TRUE
)
val DOC_TAG_TOKENS = TokenSet.create(
LuaDocTypes.TAG_NAME_PARAM,
LuaDocTypes.TAG_NAME_RETURN,
LuaDocTypes.TAG_NAME_CLASS,
LuaDocTypes.TAG_NAME_MODULE,
LuaDocTypes.TAG_NAME_TYPE,
LuaDocTypes.TAG_NAME_FIELD,
LuaDocTypes.TAG_NAME,
LuaDocTypes.TAG_NAME_LANGUAGE,
LuaDocTypes.TAG_NAME_OVERLOAD,
LuaDocTypes.TAG_NAME_PRIVATE,
LuaDocTypes.TAG_NAME_PROTECTED,
LuaDocTypes.TAG_NAME_PUBLIC,
LuaDocTypes.TAG_NAME_SEE,
LuaDocTypes.TAG_NAME_GENERIC,
LuaDocTypes.TAG_NAME_VARARG,
LuaDocTypes.TAG_NAME_ALIAS
)
val DOC_KEYWORD_TOKENS = TokenSet.create(
LuaDocTypes.FUN,
LuaDocTypes.VARARG
)
val FILE = IFileElementType(LuaLanguage.INSTANCE)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public LuaElementType(String debugName) {
super(debugName, LuaLanguage.INSTANCE);
}

public static CustomParsingType DOC_COMMENT = new CustomParsingType ("DOC_COMMENT", LuaLanguage.INSTANCE) {
public static CustomParsingType DOC_COMMENT = new CustomParsingType ("DOC_COMMENT", LuaLanguage.INSTANCE) {
@NotNull
@Override
public ASTNode parse(@NotNull CharSequence charSequence, @NotNull CharTable charTable) {
Expand Down

0 comments on commit 3ba4714

Please sign in to comment.