|
58 | 58 | import org.eclipse.lsp4j.DidCloseTextDocumentParams; |
59 | 59 | import org.eclipse.lsp4j.DidOpenTextDocumentParams; |
60 | 60 | import org.eclipse.lsp4j.DidSaveTextDocumentParams; |
| 61 | +import org.eclipse.lsp4j.DocumentFormattingParams; |
61 | 62 | import org.eclipse.lsp4j.DocumentSymbol; |
62 | 63 | import org.eclipse.lsp4j.DocumentSymbolParams; |
63 | 64 | import org.eclipse.lsp4j.ExecuteCommandOptions; |
|
69 | 70 | import org.eclipse.lsp4j.InlayHint; |
70 | 71 | import org.eclipse.lsp4j.InlayHintKind; |
71 | 72 | import org.eclipse.lsp4j.InlayHintParams; |
72 | | -import org.eclipse.lsp4j.LocationLink; |
73 | 73 | import org.eclipse.lsp4j.Location; |
| 74 | +import org.eclipse.lsp4j.LocationLink; |
74 | 75 | import org.eclipse.lsp4j.Position; |
75 | 76 | import org.eclipse.lsp4j.ReferenceParams; |
76 | 77 | import org.eclipse.lsp4j.SemanticTokens; |
|
83 | 84 | import org.eclipse.lsp4j.TextDocumentIdentifier; |
84 | 85 | import org.eclipse.lsp4j.TextDocumentItem; |
85 | 86 | import org.eclipse.lsp4j.TextDocumentSyncKind; |
| 87 | +import org.eclipse.lsp4j.TextEdit; |
86 | 88 | import org.eclipse.lsp4j.VersionedTextDocumentIdentifier; |
87 | 89 | import org.eclipse.lsp4j.jsonrpc.ResponseErrorException; |
88 | 90 | import org.eclipse.lsp4j.jsonrpc.messages.Either; |
|
104 | 106 | import org.rascalmpl.vscode.lsp.uri.FallbackResolver; |
105 | 107 | import org.rascalmpl.vscode.lsp.util.CodeActions; |
106 | 108 | import org.rascalmpl.vscode.lsp.util.Diagnostics; |
107 | | -import org.rascalmpl.vscode.lsp.util.FoldingRanges; |
108 | 109 | import org.rascalmpl.vscode.lsp.util.DocumentSymbols; |
| 110 | +import org.rascalmpl.vscode.lsp.util.FoldingRanges; |
109 | 111 | import org.rascalmpl.vscode.lsp.util.SemanticTokenizer; |
110 | 112 | import org.rascalmpl.vscode.lsp.util.Versioned; |
111 | 113 | import org.rascalmpl.vscode.lsp.util.concurrent.InterruptibleFuture; |
@@ -511,6 +513,17 @@ public CompletableFuture<List<Either<Command, CodeAction>>> codeAction(CodeActio |
511 | 513 | return CodeActions.mergeAndConvertCodeActions(this, dedicatedLanguageName, contribs.getName(), quickfixes, codeActions); |
512 | 514 | } |
513 | 515 |
|
| 516 | + @Override |
| 517 | + public CompletableFuture<List<? extends TextEdit>> formatting(DocumentFormattingParams params) { |
| 518 | + logger.debug("formatting: {}", params); |
| 519 | + |
| 520 | + // convert the `FormattingOptions` map to a `formattingOptions` constructor |
| 521 | + // call the `formatting` implementation of the relevant language contribution |
| 522 | + // with the resulting string and the input tree, compute a list of `TextEdit`s to return |
| 523 | + |
| 524 | + return CompletableFuture.completedFuture(Collections.emptyList()); |
| 525 | + } |
| 526 | + |
514 | 527 | private CompletableFuture<IList> computeCodeActions(final ILanguageContributions contribs, final int startLine, final int startColumn, ITree tree) { |
515 | 528 | IList focus = TreeSearch.computeFocusList(tree, startLine, startColumn); |
516 | 529 |
|
|
0 commit comments