Fix failing tests

This commit is contained in:
Kris De Volder
2017-04-12 16:11:33 -07:00
parent f2bc237b53
commit d601b0427d
2 changed files with 7 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ public abstract class SimpleLanguageServer implements LanguageServer, LanguageCl
private static final Scheduler RECONCILER_SCHEDULER = Schedulers.newSingle("Reconciler");
private final String EXTENSION_ID;
public final String EXTENSION_ID;
private Path workspaceRoot;

View File

@@ -439,20 +439,22 @@ public class LanguageServerHarness {
ObjectMapper mapper = new ObjectMapper();
public void perform(Command command) throws Exception {
switch (command.getCommand()) {
case "sts.quickfix":
if (getQuickfixCommandId().equals(command.getCommand())) {
List<Object> args = command.getArguments();
assertEquals(2, args.size());
//Note convert the value to a 'typeless' Object becaus that is more representative on how it will be
// received when we get it in a real client/server setting (i.e. parsed from json).
Object untypedParams = mapper.convertValue(args.get(1), Object.class);
perform(server.quickfixResolve(new QuickfixResolveParams((String)args.get(0), untypedParams)).get());
return;
default:
} else {
throw new IllegalArgumentException("Unknown command: "+command);
}
}
private String getQuickfixCommandId() {
return "sts.quickfix."+server.EXTENSION_ID;
}
private void perform(WorkspaceEdit workspaceEdit) throws Exception {
Assert.isNull("Versioned WorkspaceEdits not supported", workspaceEdit.getDocumentChanges());
for (Entry<String, List<TextEdit>> entry : workspaceEdit.getChanges().entrySet()) {