Spring properties postfix computed in completion item resolve
This commit is contained in:
@@ -507,6 +507,11 @@ public class Editor {
|
||||
selectionStart = selectionEnd = selectionStart - (end - start) + replaceWith.length();
|
||||
}
|
||||
}
|
||||
|
||||
// Apply command
|
||||
if (completion.getCommand() != null) {
|
||||
harness.executeCommand(completion.getCommand());
|
||||
}
|
||||
}
|
||||
|
||||
private String getInsertText(CompletionItem completion) {
|
||||
|
||||
@@ -719,7 +719,7 @@ public class LanguageServerHarness {
|
||||
assertNotNull(completions);
|
||||
assertFalse(completions.isEmpty());
|
||||
CompletionItem completion = editor.getFirstCompletion();
|
||||
editor.apply(completion);
|
||||
editor.apply(resolveCompletionItem(completion));
|
||||
assertEquals(expectTextAfter, editor.getText());
|
||||
}
|
||||
|
||||
@@ -735,7 +735,7 @@ public class LanguageServerHarness {
|
||||
List<? extends CompletionItem> completions = editor.getCompletions();
|
||||
for (CompletionItem ci : completions) {
|
||||
editor = newEditor(textBefore);
|
||||
editor.apply(ci);
|
||||
editor.apply(resolveCompletionItem(ci));
|
||||
actual.append(editor.getText());
|
||||
actual.append("\n-------------------\n");
|
||||
}
|
||||
@@ -749,7 +749,7 @@ public class LanguageServerHarness {
|
||||
List<? extends CompletionItem> completions = editor.getCompletions();
|
||||
for (CompletionItem ci : completions) {
|
||||
editor = newEditor(textBefore);
|
||||
editor.apply(ci);
|
||||
editor.apply(resolveCompletionItem(ci));
|
||||
if (editor.getText().equals(expectTextAfter)) {
|
||||
return;
|
||||
}
|
||||
@@ -1007,6 +1007,10 @@ public class LanguageServerHarness {
|
||||
List<? extends WorkspaceSymbol> r = server.getWorkspaceService().symbol(params).get().getRight();
|
||||
return ImmutableList.copyOf(r);
|
||||
}
|
||||
|
||||
public Object executeCommand(Command command) throws Exception {
|
||||
return server.getWorkspaceService().executeCommand(new ExecuteCommandParams(command.getCommand(), command.getArguments())).get();
|
||||
}
|
||||
|
||||
public void assertWorkspaceSymbols(String query, String... expectedSymbols) throws Exception {
|
||||
Set<String> actualSymbols = getWorkspaceSymbols(query).stream().map(sym -> sym.getName()).collect(Collectors.toSet());
|
||||
|
||||
Reference in New Issue
Block a user