Search in sources :

Example 81 with PsiReference

use of com.intellij.psi.PsiReference in project intellij-community by JetBrains.

the class AntResolveTest method doPropertyTestExpectReferenceUnresolved.

private void doPropertyTestExpectReferenceUnresolved() throws Exception {
    PsiReference ref = configure();
    PsiElement target = ref.resolve();
    assertTrue(target == null);
}
Also used : PsiReference(com.intellij.psi.PsiReference) PomTargetPsiElement(com.intellij.pom.PomTargetPsiElement) PsiElement(com.intellij.psi.PsiElement)

Example 82 with PsiReference

use of com.intellij.psi.PsiReference in project intellij-community by JetBrains.

the class AntResolveTest method doTaskTest.

private void doTaskTest() throws Exception {
    PsiReference ref = configure();
    PsiElement target = ref.resolve();
    assertTrue(target instanceof PomTargetPsiElement && ((PomTargetPsiElement) target).getTarget().canNavigateToSource());
}
Also used : PsiReference(com.intellij.psi.PsiReference) PomTargetPsiElement(com.intellij.pom.PomTargetPsiElement) PomTargetPsiElement(com.intellij.pom.PomTargetPsiElement) PsiElement(com.intellij.psi.PsiElement)

Example 83 with PsiReference

use of com.intellij.psi.PsiReference in project intellij-community by JetBrains.

the class AntResolveTest method testMacrodefElement.

public void testMacrodefElement() throws Exception {
    PsiReference ref = configure();
    assertNotNull(ref.resolve());
}
Also used : PsiReference(com.intellij.psi.PsiReference)

Example 84 with PsiReference

use of com.intellij.psi.PsiReference in project intellij-community by JetBrains.

the class AntResolveTest method testPresetDef.

public void testPresetDef() throws Exception {
    PsiReference ref = configure();
    assertNotNull(ref.resolve());
}
Also used : PsiReference(com.intellij.psi.PsiReference)

Example 85 with PsiReference

use of com.intellij.psi.PsiReference in project intellij-community by JetBrains.

the class AntResolveTest method testNonExistingEnvProperty.

public void testNonExistingEnvProperty() throws Exception {
    boolean isNull = false;
    final PsiReference ref = configure();
    if (ref != null && ref.resolve() == null) {
        isNull = true;
    }
    assertTrue(isNull);
}
Also used : PsiReference(com.intellij.psi.PsiReference)

Aggregations

PsiReference (com.intellij.psi.PsiReference)564 PsiElement (com.intellij.psi.PsiElement)327 NotNull (org.jetbrains.annotations.NotNull)97 Nullable (org.jetbrains.annotations.Nullable)55 TextRange (com.intellij.openapi.util.TextRange)54 PsiFile (com.intellij.psi.PsiFile)52 ArrayList (java.util.ArrayList)46 Test (org.junit.Test)40 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)36 BuildFile (com.google.idea.blaze.base.lang.buildfile.psi.BuildFile)32 IdentifierPSINode (org.ballerinalang.plugins.idea.psi.IdentifierPSINode)25 LeafPsiElement (com.intellij.psi.impl.source.tree.LeafPsiElement)23 XmlTag (com.intellij.psi.xml.XmlTag)22 VirtualFile (com.intellij.openapi.vfs.VirtualFile)21 XmlAttributeValue (com.intellij.psi.xml.XmlAttributeValue)20 PsiClass (com.intellij.psi.PsiClass)17 XmlAttribute (com.intellij.psi.xml.XmlAttribute)17 LinkedList (java.util.LinkedList)17 LookupElement (com.intellij.codeInsight.lookup.LookupElement)16 Project (com.intellij.openapi.project.Project)16