Search in sources :

Example 1 with LanguageReference

use of org.intellij.plugins.intelliLang.inject.java.LanguageReference in project intellij-community by JetBrains.

the class GrLanguageReferenceProvider method registerReferenceProviders.

@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    final Configuration configuration = Configuration.getInstance();
    registrar.registerReferenceProvider(GroovyPatterns.groovyLiteralExpression().annotationParam(StandardPatterns.string().with(isLanguageAnnotation(configuration)), "value").and(GroovyPatterns.groovyLiteralExpression().with(isStringLiteral())), new PsiReferenceProvider() {

        @NotNull
        @Override
        public PsiReference[] getReferencesByElement(@NotNull final PsiElement element, @NotNull final ProcessingContext context) {
            return new PsiReference[] { new LanguageReference((PsiLiteral) element) };
        }
    });
}
Also used : LanguageReference(org.intellij.plugins.intelliLang.inject.java.LanguageReference) ProcessingContext(com.intellij.util.ProcessingContext) Configuration(org.intellij.plugins.intelliLang.Configuration) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ProcessingContext (com.intellij.util.ProcessingContext)1 Configuration (org.intellij.plugins.intelliLang.Configuration)1 LanguageReference (org.intellij.plugins.intelliLang.inject.java.LanguageReference)1 NotNull (org.jetbrains.annotations.NotNull)1