Search in sources :

Example 1 with DocumentFormattingParamsDTO

use of org.eclipse.che.api.languageserver.shared.lsapi.DocumentFormattingParamsDTO in project che by eclipse.

the class LanguageServerFormatter method formatFullDocument.

private void formatFullDocument(Document document) {
    DocumentFormattingParamsDTO params = dtoFactory.createDto(DocumentFormattingParamsDTO.class);
    TextDocumentIdentifierDTO identifier = dtoFactory.createDto(TextDocumentIdentifierDTO.class);
    identifier.setUri(document.getFile().getLocation().toString());
    params.setTextDocument(identifier);
    params.setOptions(getFormattingOptions());
    Promise<List<TextEditDTO>> promise = client.formatting(params);
    handleFormatting(promise, document);
}
Also used : TextDocumentIdentifierDTO(org.eclipse.che.api.languageserver.shared.lsapi.TextDocumentIdentifierDTO) List(java.util.List) DocumentFormattingParamsDTO(org.eclipse.che.api.languageserver.shared.lsapi.DocumentFormattingParamsDTO)

Aggregations

List (java.util.List)1 DocumentFormattingParamsDTO (org.eclipse.che.api.languageserver.shared.lsapi.DocumentFormattingParamsDTO)1 TextDocumentIdentifierDTO (org.eclipse.che.api.languageserver.shared.lsapi.TextDocumentIdentifierDTO)1