Add space to empty edit because vscode doesn't like empty strings.

This commit is contained in:
Kris De Volder
2018-06-07 17:21:34 -07:00
parent f0afe840d9
commit 036ab5eba2
2 changed files with 6 additions and 0 deletions

View File

@@ -135,6 +135,11 @@ public class LspCompletionInterpreter implements IDocumentState {
if (afterEdit!=null) additionalEdits.add(afterEdit);
item.setAdditionalTextEdits(additionalEdits.build());
if (mainEdit!=null && mainEdit.getNewText().equals("")) {
//Vscode handles this poorly and adds 'junk' instead.
mainEdit.setNewText(" "); // Adding a space. It is still junk but it is at least not immediately visible.
}
if (needsCursorMove) {
Position position = docState.getDocument().toPosition(docState.getCursor());
item.setCommand(new Command("Move Cursor", server.MOVE_CURSOR_COMMAND_ID, ImmutableList.of(originalDoc.getUri(), position)));

View File

@@ -1,6 +1,7 @@
#!/bin/bash
set -e
../mvnw \
-Dmaven.test.skip=true \
-f ../pom.xml \
-pl spring-boot-language-server \
-am \