diff --git a/plugin/src/main/java/org/jetbrains/plugins/gradle/service/resolve/dsl/GradleDslAnnotator.java b/plugin/src/main/java/org/jetbrains/plugins/gradle/service/resolve/dsl/GradleDslAnnotator.java index f8b8ad4..9498d0a 100644 --- a/plugin/src/main/java/org/jetbrains/plugins/gradle/service/resolve/dsl/GradleDslAnnotator.java +++ b/plugin/src/main/java/org/jetbrains/plugins/gradle/service/resolve/dsl/GradleDslAnnotator.java @@ -18,6 +18,7 @@ import com.intellij.java.language.psi.PsiClass; import com.intellij.java.language.psi.PsiType; import com.intellij.java.language.psi.util.InheritanceUtil; +import consulo.annotation.access.RequiredReadAction; import consulo.language.editor.annotation.AnnotationHolder; import consulo.language.editor.annotation.Annotator; import consulo.language.editor.annotation.HighlightSeverity; @@ -41,6 +42,7 @@ */ public class GradleDslAnnotator implements Annotator { @Override + @RequiredReadAction public void annotate(@Nonnull PsiElement element, @Nonnull AnnotationHolder holder) { if (element instanceof GrReferenceExpression referenceExpression) { final GrExpression qualifier = ResolveUtil.getSelfOrWithQualifier(referenceExpression); @@ -71,7 +73,8 @@ public void annotate(@Nonnull PsiElement element, @Nonnull AnnotationHolder hold PsiElement nameElement = referenceExpression.getReferenceNameElement(); if (nameElement != null) { holder.newSilentAnnotation(HighlightSeverity.INFORMATION) - .textAttributes(GroovySyntaxHighlighter.MAP_KEY); + .textAttributes(GroovySyntaxHighlighter.MAP_KEY) + .create(); } } }