Search in sources :

Example 1 with MavenPsiElementWrapper

use of org.jetbrains.idea.maven.dom.references.MavenPsiElementWrapper in project intellij-community by JetBrains.

the class MavenDomTestCase method doAssertResolved.

private PsiReference doAssertResolved(VirtualFile file, PsiElement expected) throws IOException {
    assertNotNull("expected reference is null", expected);
    PsiReference ref = getReferenceAtCaret(file);
    assertNotNull(ref);
    PsiElement resolved = ref.resolve();
    if (resolved instanceof MavenPsiElementWrapper) {
        resolved = ((MavenPsiElementWrapper) resolved).getWrappee();
    }
    assertEquals(expected, resolved);
    return ref;
}
Also used : PsiReference(com.intellij.psi.PsiReference) MavenPsiElementWrapper(org.jetbrains.idea.maven.dom.references.MavenPsiElementWrapper) PsiElement(com.intellij.psi.PsiElement)

Example 2 with MavenPsiElementWrapper

use of org.jetbrains.idea.maven.dom.references.MavenPsiElementWrapper in project intellij-community by JetBrains.

the class MavenDomTestCase method resolveReference.

@Nullable
protected PsiElement resolveReference(VirtualFile file, @NotNull String referenceText) throws IOException {
    PsiReference ref = getReference(file, referenceText);
    assertNotNull(ref);
    PsiElement resolved = ref.resolve();
    if (resolved instanceof MavenPsiElementWrapper) {
        resolved = ((MavenPsiElementWrapper) resolved).getWrappee();
    }
    return resolved;
}
Also used : PsiReference(com.intellij.psi.PsiReference) MavenPsiElementWrapper(org.jetbrains.idea.maven.dom.references.MavenPsiElementWrapper) PsiElement(com.intellij.psi.PsiElement) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PsiElement (com.intellij.psi.PsiElement)2 PsiReference (com.intellij.psi.PsiReference)2 MavenPsiElementWrapper (org.jetbrains.idea.maven.dom.references.MavenPsiElementWrapper)2 Nullable (org.jetbrains.annotations.Nullable)1