PathUtil filePath = new PathUtil(path);
document = Document.createFromString(source);
parser = DocumentParser.create(
document, CodeMirror2.getParser(filePath), new StubIncrementalScheduler(50, 50));
FileTreeNode root = FileTreeNode.transform(buildSimpleTree());
FileTreeModel model = new FileTreeModel(new MockOutgoingController());
model.replaceNode(PathUtil.WORKSPACE_ROOT, root, "1");
return new DynamicReferenceProvider(path, new DeferringLineParser(parser), model, null);
}