Package com.intellij.psi

Examples of com.intellij.psi.PsiReference.resolve()


  }

  private void checkResolveToSplit(String filePath) throws IOException {
    configureByFileName(filePath);
    final PsiReference reference = findReference();
    final PsiElement element = reference.resolve();
    assert(element instanceof ClDef && ((ClDef) element).getName().equals("split"));
  }

  public void testUse1() throws Exception {
    checkResolveToSplit("use/use1.clj");
View Full Code Here


  }

  private void checkReferenceIsUnresolved(String filePath) throws IOException {
    configureByFileName(filePath);
    final PsiReference reference = findReference();
    final PsiElement element = reference.resolve();
    assertNull(element);
  }

  public void testImportFails3() throws Exception {
    checkReferenceIsUnresolved("javaClass/importFails3.clj");
View Full Code Here

    PsiFileImpl used = (PsiFileImpl) myFixture.addFileToProject("used.clj", "(ns used)\n(defn foo [] (println \"hello\"))");
    myFixture.configureByText("main.clj", "(require used)\n(used/f<caret>oo)");

    PsiReference ref = myFixture.getFile().findReferenceAt(myFixture.getEditor().getCaretModel().getOffset());
    assertNotNull(ref);
    assertInstanceOf(ref.resolve(), ClDef.class);
    assert !used.isContentsLoaded();
  }
}
View Full Code Here

    }

    private void openClassInEditor(Project project, PsiElement classReference)
    {
        PsiReference psiReference = (PsiReference) classReference;
        PsiFile containingFile = psiReference.resolve().getContainingFile();
        VirtualFile virtualFile = containingFile.getVirtualFile();
        FileEditorManager.getInstance(project).openFile(virtualFile, true);
        Editor selectedTextEditor = FileEditorManager.getInstance(project).getSelectedTextEditor();

        if (containingFile instanceof JSFile) //it might be an MXML file
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.