use of com.intellij.psi.stubs.StubTreeLoader in project intellij-community by JetBrains.
the class DomStubTest method getRootStub.
public static ElementStub getRootStub(@TestDataFile String filePath, JavaCodeInsightTestFixture fixture) {
PsiFile psiFile = fixture.configureByFile(filePath);
StubTreeLoader loader = StubTreeLoader.getInstance();
VirtualFile file = psiFile.getVirtualFile();
assertTrue(loader.canHaveStub(file));
ObjectStubTree stubTree = loader.readFromVFile(fixture.getProject(), file);
assertNotNull(stubTree);
ElementStub root = (ElementStub) stubTree.getRoot();
assertNotNull(root);
return root;
}
use of com.intellij.psi.stubs.StubTreeLoader in project intellij-community by JetBrains.
the class DomStubBuilderTest method testNullTag.
public void testNullTag() throws Exception {
VirtualFile virtualFile = myFixture.copyFileToProject("nullTag.xml");
assertNotNull(virtualFile);
PsiFile psiFile = ((PsiManagerEx) getPsiManager()).getFileManager().findFile(virtualFile);
StubTreeLoader loader = StubTreeLoader.getInstance();
VirtualFile file = psiFile.getVirtualFile();
assertTrue(loader.canHaveStub(file));
ObjectStubTree stubTree = loader.readFromVFile(getProject(), file);
// no stubs for invalid XML
assertNull(stubTree);
}
Aggregations