use of org.eclipse.xtext.ui.editor.model.XtextDocument in project xtext-xtend by eclipse.
the class AbstractOutlineTests method newAssertBuilder.
protected AssertBuilder newAssertBuilder(XtendFile xtendFile) throws Exception, CoreException {
XtextDocument document = documentProvider.get();
document.setInput((XtextResource) xtendFile.eResource());
IOutlineNode root = treeProvider.createRoot(document);
AssertBuilder assertBuilder = new AssertBuilder(root);
return assertBuilder;
}
use of org.eclipse.xtext.ui.editor.model.XtextDocument in project xtext-xtend by eclipse.
the class PresentationDamagerTest method createDocument.
@Override
public Document createDocument(final String before) throws Exception {
XtextDocument _xblockexpression = null;
{
XtendDocumentTokenSource _xtendDocumentTokenSource = new XtendDocumentTokenSource();
final Procedure1<XtendDocumentTokenSource> _function = (XtendDocumentTokenSource it) -> {
AntlrTokenDefProvider _antlrTokenDefProvider = new AntlrTokenDefProvider();
final Procedure1<AntlrTokenDefProvider> _function_1 = (AntlrTokenDefProvider it_1) -> {
XtendAntlrTokenFileProvider _xtendAntlrTokenFileProvider = new XtendAntlrTokenFileProvider();
it_1.setAntlrTokenFileProvider(_xtendAntlrTokenFileProvider);
};
AntlrTokenDefProvider _doubleArrow = ObjectExtensions.<AntlrTokenDefProvider>operator_doubleArrow(_antlrTokenDefProvider, _function_1);
it.setTokenDefProvider(_doubleArrow);
final Provider<Lexer> _function_2 = () -> {
return this.createLexer();
};
it.setLexer(_function_2);
it.setFlexerFactory(this.flexerFactory);
};
final XtendDocumentTokenSource source = ObjectExtensions.<XtendDocumentTokenSource>operator_doubleArrow(_xtendDocumentTokenSource, _function);
final XtextDocument document = new XtextDocument(source, null, this.outdatedStateManager, this.operationCanceledManager);
document.set(before);
_xblockexpression = document;
}
return _xblockexpression;
}
use of org.eclipse.xtext.ui.editor.model.XtextDocument in project xtext-eclipse by eclipse.
the class AbstractDamagerRepairerTest method createDocument.
protected Document createDocument(String before) throws Exception {
DocumentTokenSource source = new DocumentTokenSource();
source.setLexer(new Provider<Lexer>() {
@Override
public Lexer get() {
return createLexer();
}
});
XtextDocument document = new XtextDocument(source, null, outdatedStateManager, operationCanceledManager);
document.set(before);
return document;
}
use of org.eclipse.xtext.ui.editor.model.XtextDocument in project xtext-eclipse by eclipse.
the class AbstractQuickfixTest method getDocument.
/**
* The implementation of the following helper methods are taken from the
* {@code org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder} class.
*/
protected IXtextDocument getDocument(String model) {
XtextResource xtextResource = getXtextResource(model);
XtextDocument document = injector.getInstance(XtextDocument.class);
document.set(model);
document.setInput(xtextResource);
return document;
}
use of org.eclipse.xtext.ui.editor.model.XtextDocument in project xtext-eclipse by eclipse.
the class ContentAssistProcessorTestBuilder method getDocument.
public IXtextDocument getDocument(final XtextResource xtextResource, final String model) {
XtextDocument document = get(XtextDocument.class);
document.set(model);
document.setInput(xtextResource);
DocumentPartitioner partitioner = get(DocumentPartitioner.class);
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
return document;
}
Aggregations