com.itangcent.intellij.jvm.scala.ScalaAnnotationHelper.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of intellij-scala-support Show documentation
Show all versions of intellij-scala-support Show documentation
Help for developing plugins for JetBrains products.
support kotlin feature
The newest version!
package com.itangcent.intellij.jvm.scala
import com.intellij.psi.PsiAnnotationOwner
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiModifierListOwner
import com.itangcent.common.utils.GsonUtils
import com.itangcent.common.utils.notNullOrEmpty
import com.itangcent.intellij.jvm.AnnotationHelper
import com.itangcent.intellij.jvm.scala.adaptor.ScAdaptor
import com.itangcent.intellij.jvm.scala.adaptor.tryCast
import com.itangcent.intellij.jvm.scala.compatible.ScCompatibleAnnotation
import com.itangcent.intellij.jvm.scala.compatible.ScCompatibleAnnotationExpr
import com.itangcent.intellij.jvm.scala.compatible.ScCompatibleAnnotationsHolder
import com.itangcent.intellij.jvm.scala.compatible.ScCompatibleAssignment
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
import java.util.*
class ScalaAnnotationHelper : AnnotationHelper {
override fun hasAnn(psiElement: PsiElement?, annName: String): Boolean {
return findScAnnotation(psiElement, annName) != null
}
override fun findAnnMap(psiElement: PsiElement?, annName: String): Map? {
if (psiElement == null) {
return null
}
if (ScPsiUtils.isScPsiInst(psiElement)) {
val scAnnotation = findScAnnotation(psiElement, annName)
if (scAnnotation != null) {
return annToMap(scAnnotation)
}
}
return null
}
override fun findAnnMaps(psiElement: PsiElement?, annName: String): List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy