Old Location API for Theia, Atom and IntelliJ clients

This commit is contained in:
BoykoAlex
2019-11-19 12:38:19 -05:00
parent 8465cde498
commit e29cbbe521

View File

@@ -368,10 +368,13 @@ public class SimpleTextDocumentService implements TextDocumentService, DocumentE
}
// Workaround for https://github.com/eclipse-theia/theia/issues/6414
// Theia does not support LocationLink yet
if (LspClient.currentClient() == LspClient.Client.THEIA) {
return Either.forLeft(locations.stream().map(link -> new Location(link.getTargetUri(), link.getTargetRange())).collect(Collectors.toList()));
} else {
return Either.forRight(locations);
switch (LspClient.currentClient()) {
case THEIA:
case ATOM:
case INTELLIJ:
return Either.forLeft(locations.stream().map(link -> new Location(link.getTargetUri(), link.getTargetRange())).collect(Collectors.toList()));
default:
return Either.forRight(locations);
}
});
}