LS sends Location for Theia client instead of LocationLink
This commit is contained in:
@@ -363,10 +363,16 @@ public class SimpleTextDocumentService implements TextDocumentService, DocumentE
|
||||
return async.invoke(() -> {
|
||||
List<LocationLink> locations = h.handle(position);
|
||||
if (locations==null) {
|
||||
// vscode client does not like to recieve null result. See: https://github.com/spring-projects/sts4/issues/309
|
||||
// vscode client does not like to receive null result. See: https://github.com/spring-projects/sts4/issues/309
|
||||
locations = ImmutableList.of();
|
||||
}
|
||||
return Either.forRight(locations);
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
return CompletableFuture.completedFuture(Either.forLeft(ImmutableList.of()));
|
||||
|
||||
Reference in New Issue
Block a user