IDEA-79812 (Spring config highlights all properies as errors yet Idea can still navigate to the property in the .properties file)

This commit is contained in:
Sergey Evdokimov
2012-03-11 14:42:21 +04:00
parent a8d722927c
commit d51425a1f2
4 changed files with 8 additions and 7 deletions
@@ -29,8 +29,8 @@ import org.jetbrains.idea.maven.project.MavenProject;
import java.util.List;
public class MavenFilteredPropertyPsiReference extends MavenPropertyPsiReference {
public MavenFilteredPropertyPsiReference(MavenProject mavenProject, PsiElement element, String text, TextRange range, boolean isSoft) {
super(mavenProject, element, text, range, isSoft);
public MavenFilteredPropertyPsiReference(MavenProject mavenProject, PsiElement element, String text, TextRange range) {
super(mavenProject, element, text, range, true);
}
@Override
@@ -138,8 +138,7 @@ public class MavenFilteredPropertyPsiReferenceProvider extends PsiReferenceProvi
TextRange range = TextRange.from(from, propertyName.length());
res.add(
new MavenFilteredPropertyPsiReference(mavenProject, element, propertyName, range, MavenPropertyPsiReferenceProvider.SOFT_DEFAULT));
res.add(new MavenFilteredPropertyPsiReference(mavenProject, element, propertyName, range));
}
return res == null ? PsiReference.EMPTY_ARRAY : res.toArray(new PsiReference[res.size()]);
@@ -53,8 +53,7 @@ public class MavenPropertyCompletionContributor extends CompletionContributor {
TextRange range = TextRange.create(braceOffset, offset);
String prefix = range.substring(text);
MavenFilteredPropertyPsiReference ref = new MavenFilteredPropertyPsiReference(projectFile, psiFile, prefix, range,
MavenPropertyPsiReferenceProvider.SOFT_DEFAULT);
MavenFilteredPropertyPsiReference ref = new MavenFilteredPropertyPsiReference(projectFile, psiFile, prefix, range);
addVariants(Arrays.asList(ref.getVariants()), result.withPrefixMatcher(prefix));
}
@@ -20,6 +20,7 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiManager;
import com.intellij.psi.PsiReference;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.maven.dom.model.MavenDomProfilesModel;
import org.jetbrains.idea.maven.dom.references.MavenPropertyPsiReference;
@@ -493,7 +494,9 @@ public class MavenFilteredPropertiesCompletionAndResolutionTest extends MavenDom
assertNotNull(resolveReference(f, "basedir"));
assertNotNull(resolveReference(f, "pom.baseUri"));
assertNotNull(getReference(f, "ve|rsion"));
PsiReference ref = getReference(f, "ve|rsion");
assertNotNull(ref);
assertTrue(ref.isSoft());
}
public void testDontUseDefaultDelimiter1() throws Exception {