use of org.eclipse.lsp4j.DidChangeTextDocumentParams in project eclipse.jdt.ls by eclipse.
the class CompletionHandlerTest method changeDocument.
private void changeDocument(ICompilationUnit unit, String content, int version) throws JavaModelException {
DidChangeTextDocumentParams changeParms = new DidChangeTextDocumentParams();
VersionedTextDocumentIdentifier textDocument = new VersionedTextDocumentIdentifier();
textDocument.setUri(JDTUtils.toURI(unit));
textDocument.setVersion(version);
changeParms.setTextDocument(textDocument);
TextDocumentContentChangeEvent event = new TextDocumentContentChangeEvent();
event.setText(content);
List<TextDocumentContentChangeEvent> contentChanges = new ArrayList<>();
contentChanges.add(event);
changeParms.setContentChanges(contentChanges);
lifeCycleHandler.didChange(changeParms);
}
use of org.eclipse.lsp4j.DidChangeTextDocumentParams in project eclipse.jdt.ls by eclipse.
the class DocumentLifeCycleHandlerTest method changeDocument.
private void changeDocument(ICompilationUnit cu, String content, int version, Range range) throws JavaModelException {
DidChangeTextDocumentParams changeParms = new DidChangeTextDocumentParams();
VersionedTextDocumentIdentifier textDocument = new VersionedTextDocumentIdentifier();
textDocument.setUri(JDTUtils.toURI(cu));
textDocument.setVersion(version);
changeParms.setTextDocument(textDocument);
TextDocumentContentChangeEvent event = new TextDocumentContentChangeEvent();
if (range != null) {
event.setRange(range);
}
event.setText(content);
List<TextDocumentContentChangeEvent> contentChanges = new ArrayList<>();
contentChanges.add(event);
changeParms.setContentChanges(contentChanges);
lifeCycleHandler.didChange(changeParms);
}
Aggregations