|
27 | 27 | package org.rascalmpl.vscode.lsp.util; |
28 | 28 |
|
29 | 29 | import java.util.Collections; |
| 30 | +import java.util.HashMap; |
30 | 31 | import java.util.List; |
31 | 32 | import java.util.concurrent.CompletableFuture; |
32 | 33 | import java.util.function.Function; |
|
36 | 37 | import org.apache.logging.log4j.LogManager; |
37 | 38 | import org.apache.logging.log4j.Logger; |
38 | 39 | import org.checkerframework.checker.nullness.qual.Nullable; |
| 40 | +import org.eclipse.lsp4j.ChangeAnnotation; |
39 | 41 | import org.eclipse.lsp4j.CompletionContext; |
40 | 42 | import org.eclipse.lsp4j.CompletionItem; |
41 | 43 | import org.eclipse.lsp4j.CompletionItemKind; |
|
47 | 49 | import org.eclipse.lsp4j.MarkupKind; |
48 | 50 | import org.eclipse.lsp4j.Position; |
49 | 51 | import org.eclipse.lsp4j.Range; |
50 | | -import org.eclipse.lsp4j.TextDocumentEdit; |
51 | 52 | import org.eclipse.lsp4j.jsonrpc.messages.Either; |
52 | 53 | import org.rascalmpl.values.IRascalValueFactory; |
53 | 54 | import org.rascalmpl.vscode.lsp.IBaseTextDocumentService; |
@@ -129,12 +130,8 @@ public List<CompletionItem> toLSP(final IBaseTextDocumentService docService, Typ |
129 | 130 | .map(IString::getValue) |
130 | 131 | .collect(Collectors.toList())); |
131 | 132 |
|
132 | | - var wsEdit = DocumentChanges.translateDocumentChanges(docService, (IList) kws.getParameter(ADDITIONAL_CHANGES)); |
133 | | - ci.setAdditionalTextEdits(wsEdit.getDocumentChanges() |
134 | | - .stream() |
135 | | - .map(e -> (TextDocumentEdit) e.get()) |
136 | | - .flatMap(t -> t.getEdits().stream()) |
137 | | - .collect(Collectors.toList())); |
| 133 | + var edits = DocumentChanges.translateTextEdits(docService, (IList) kws.getParameter(ADDITIONAL_CHANGES), new HashMap<String, ChangeAnnotation>()); |
| 134 | + ci.setAdditionalTextEdits(edits); |
138 | 135 |
|
139 | 136 | ci.setCommand(CodeActions.constructorToCommand(dedicatedLanguageName, languageName, (IConstructor) kws.getParameter(COMMAND))); |
140 | 137 |
|
|
0 commit comments