[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.
This commit is contained in:
Daniil Ovchinnikov
2018-08-29 20:53:40 +03:00
parent 5301013373
commit 7b4dd06598
@@ -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();