From 7b4dd06598b6eb095a7b05cb374cf057c0e194db Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Wed, 29 Aug 2018 20:47:48 +0300 Subject: [PATCH] [groovy] binding variables don't have declarations and hence no comments to search injection language (EA-112678) `GrBindingVariable#getTextRange` returns `null`, because it's a light element. --- .../groovy/GrConcatenationAwareInjector.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/GrConcatenationAwareInjector.java b/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/GrConcatenationAwareInjector.java index ef1c3d310124..498b9e554337 100644 --- a/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/GrConcatenationAwareInjector.java +++ b/plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/GrConcatenationAwareInjector.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.intellij.plugins.intelliLang.inject.groovy; import com.intellij.lang.Language; @@ -52,6 +38,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrReturnState import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.*; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrStringInjection; import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement; +import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrBindingVariable; import java.util.Collection; import java.util.LinkedList; @@ -223,7 +210,7 @@ public class GrConcatenationAwareInjector implements ConcatenationAwareInjector public boolean visitReference(GrReferenceExpression expression) { if (myConfiguration.getAdvancedConfiguration().getDfaOption() == Configuration.DfaOption.OFF) return true; final PsiElement e = expression.resolve(); - if (e instanceof PsiVariable) { + if (e instanceof PsiVariable && !(e instanceof GrBindingVariable)) { if (e instanceof PsiParameter) { final PsiParameter p = (PsiParameter)e; final PsiElement declarationScope = p.getDeclarationScope();