diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/arguments/GrArgumentLabelImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/arguments/GrArgumentLabelImpl.java
index 6449e508b9c6..d98cfc1b3557 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/arguments/GrArgumentLabelImpl.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/arguments/GrArgumentLabelImpl.java
@@ -19,6 +19,8 @@ package org.jetbrains.plugins.groovy.lang.psi.impl.statements.arguments;
import com.intellij.lang.ASTNode;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
+import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference;
import com.intellij.psi.util.PropertyUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.IncorrectOperationException;
@@ -55,7 +57,9 @@ public class GrArgumentLabelImpl extends GroovyPsiElementImpl implements GrArgum
}
public PsiReference getReference() {
- return this;
+ PsiReference[] otherReferences = ReferenceProvidersRegistry.getReferencesFromProviders(this, GrArgumentLabel.class);
+ PsiReference[] thisReference = {this};
+ return new PsiMultiReference(otherReferences.length == 0 ? thisReference : ArrayUtil.mergeArrays(thisReference, otherReferences, PsiReference.class), this);
}
public String getName() {
@@ -166,6 +170,7 @@ public class GrArgumentLabelImpl extends GroovyPsiElementImpl implements GrArgum
}
+ @NotNull
public Object[] getVariants() {
return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/GroovyResolveTestCase.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/GroovyResolveTestCase.java
index f151918d5fca..817ebe847f69 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/GroovyResolveTestCase.java
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/GroovyResolveTestCase.java
@@ -21,9 +21,11 @@ import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiReference;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.groovy.LightGroovyTestCase;
import java.io.File;
+import java.io.IOException;
/**
* @author ven
@@ -39,7 +41,7 @@ public abstract class GroovyResolveTestCase extends LightGroovyTestCase {
}
}
- protected PsiReference configureByFile(@NonNls String filePath) throws Exception{
+ protected PsiReference configureByFile(@NonNls String filePath, @Nullable String newFilePath) throws IOException {
filePath = StringUtil.trimStart(filePath, getTestName(true) + "/");
final VirtualFile vFile = myFixture.getTempDirFixture().getFile(filePath);
assertNotNull("file " + filePath + " not found", vFile);
@@ -50,11 +52,20 @@ public abstract class GroovyResolveTestCase extends LightGroovyTestCase {
assertTrue(offset >= 0);
fileText = fileText.substring(0, offset) + fileText.substring(offset + MARKER.length());
- myFixture.configureByText(vFile.getFileType(), fileText);
+ if (newFilePath == null) {
+ myFixture.configureByText(vFile.getName(), fileText);
+ }
+ else {
+ myFixture.configureByText(newFilePath, fileText);
+ }
PsiReference ref = myFixture.getFile().findReferenceAt(offset);
assertNotNull(ref);
return ref;
}
+ protected PsiReference configureByFile(@NonNls String filePath) throws Exception {
+ return configureByFile(filePath, null);
+ }
+
}
diff --git a/plugins/groovy/testdata/highlighting/UsedLabel.groovy b/plugins/groovy/testdata/highlighting/UsedLabel.groovy
index 29b8a0f7deca..cff7c5840940 100644
--- a/plugins/groovy/testdata/highlighting/UsedLabel.groovy
+++ b/plugins/groovy/testdata/highlighting/UsedLabel.groovy
@@ -2,7 +2,7 @@ oo:
for (s in ['a', 'b']) {
oo1:
for (s1 in ['a', 'b']) {
- oo:
+ oo:
for (s2 in ['a', 'b']) {
}
}