diff --git a/packages/jetbrains-plugin/src/main/kotlin/com/mongodb/jbplugin/observability/probe/InspectionStatusChangedProbe.kt b/packages/jetbrains-plugin/src/main/kotlin/com/mongodb/jbplugin/observability/probe/InspectionStatusChangedProbe.kt index b71563b7..753e0533 100644 --- a/packages/jetbrains-plugin/src/main/kotlin/com/mongodb/jbplugin/observability/probe/InspectionStatusChangedProbe.kt +++ b/packages/jetbrains-plugin/src/main/kotlin/com/mongodb/jbplugin/observability/probe/InspectionStatusChangedProbe.kt @@ -1,7 +1,6 @@ package com.mongodb.jbplugin.observability.probe import com.intellij.codeInspection.ProblemsHolder -import com.intellij.database.util.common.containsElements import com.intellij.openapi.application.readAction import com.intellij.openapi.components.Service import com.intellij.openapi.diagnostic.Logger @@ -162,10 +161,10 @@ class InspectionStatusChangedProbe( psiElement: () -> PsiElement ): Boolean = runCatching { readAction { - elementsWithProblems.containsElements { + elementsWithProblems.find { it.on.get()?.source == psiElement || it.on.get()?.source?.isEquivalentTo(psiElement()) == true - } + } != null } }.getOrDefault(false) diff --git a/packages/mongodb-dialects/spring-@query/src/main/kotlin/com/mongodb/jbplugin/dialects/springquery/SpringAtQueryDialectParser.kt b/packages/mongodb-dialects/spring-@query/src/main/kotlin/com/mongodb/jbplugin/dialects/springquery/SpringAtQueryDialectParser.kt index 8b4a89d6..0a08962b 100644 --- a/packages/mongodb-dialects/spring-@query/src/main/kotlin/com/mongodb/jbplugin/dialects/springquery/SpringAtQueryDialectParser.kt +++ b/packages/mongodb-dialects/spring-@query/src/main/kotlin/com/mongodb/jbplugin/dialects/springquery/SpringAtQueryDialectParser.kt @@ -1,6 +1,5 @@ package com.mongodb.jbplugin.dialects.springquery -import com.intellij.database.util.common.containsElements import com.intellij.lang.injection.InjectedLanguageManager import com.intellij.psi.JavaPsiFacade import com.intellij.psi.PsiAnnotation @@ -272,9 +271,9 @@ object SpringAtQueryDialectParser : DialectParser { private fun findParentMethodWithQueryAnnotation(source: PsiElement): PsiMethod? { return source.findTopParentBy { method -> method as? PsiMethod ?: return@findTopParentBy false - method.annotations.containsElements { + method.annotations.find { it.hasQualifiedName(QUERY_FQN) - } + } != null } as? PsiMethod }