Skip to content

Commit 89c7f57

Browse files
committed
Use correct object mapper for plugin host
1 parent 9f977c1 commit 89c7f57

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This change
33

44
## [Unreleased]
55

6+
## [0.4.6] - 2022-06-09
7+
8+
- fixed an issue where wrong object mapper was used for plugin host
9+
610
## [0.4.5] - 2022-06-08
711

812
- exposed `RpcClient` and `ReactiveRpcClient` from `NeovimJavaPluginHost` for easy access to different communication interfaces

plugin-host/src/main/java/com/ensarsarajcic/neovim/java/pluginhost/NeovimJavaPluginHost.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525
package com.ensarsarajcic.neovim.java.pluginhost;
2626

2727
import com.ensarsarajcic.neovim.java.api.NeovimApi;
28+
import com.ensarsarajcic.neovim.java.api.NeovimApis;
2829
import com.ensarsarajcic.neovim.java.api.NeovimStreamApi;
2930
import com.ensarsarajcic.neovim.java.api.types.apiinfo.ApiInfo;
3031
import com.ensarsarajcic.neovim.java.api.util.ObjectMappers;
31-
import com.ensarsarajcic.neovim.java.corerpc.client.RpcClient;
3232
import com.ensarsarajcic.neovim.java.corerpc.client.RpcConnection;
33+
import com.ensarsarajcic.neovim.java.corerpc.client.RpcStreamer;
3334
import com.ensarsarajcic.neovim.java.corerpc.client.StdIoRpcConnection;
3435
import com.ensarsarajcic.neovim.java.corerpc.reactive.ReactiveRpcClient;
36+
import com.ensarsarajcic.neovim.java.corerpc.reactive.ReactiveRpcStreamer;
3537
import com.ensarsarajcic.neovim.java.handler.NeovimHandlerManager;
3638
import com.ensarsarajcic.neovim.java.handler.NeovimHandlerProxy;
3739
import com.ensarsarajcic.neovim.java.notifications.NeovimStreamNotificationHandler;
@@ -49,8 +51,8 @@ public final class NeovimJavaPluginHost {
4951
private final NeovimHandlerProxy neovimHandlerProxy;
5052
private final NeovimApi api;
5153
private final NeovimStreamNotificationHandler neovimStreamNotificationHandler;
52-
private final RpcClient client;
53-
private final ReactiveRpcClient reactiveClient;
54+
private final RpcStreamer client;
55+
private final ReactiveRpcStreamer reactiveClient;
5456
private final RemotePluginManager remotePluginManager;
5557

5658
private ApiInfo apiInfo = null;
@@ -73,7 +75,7 @@ public NeovimJavaPluginHost(NeovimHandlerProxy neovimHandlerProxy) {
7375
return null;
7476
}
7577
});
76-
client = RpcClient.getDefaultAsyncInstance();
78+
client = NeovimApis.getNeovimRpcStreamer();
7779
reactiveClient = ReactiveRpcClient.createDefaultInstanceWithCustomStreamer(client);
7880
neovimStreamNotificationHandler = new NeovimStreamNotificationHandler(reactiveClient);
7981
remotePluginManager = new RemotePluginManager(neovimHandlerManager, neovimHandlerProxy, client);
@@ -116,11 +118,11 @@ public PluginApi getPluginApi() {
116118
return pluginApi;
117119
}
118120

119-
public RpcClient getClient() {
121+
public RpcStreamer getClient() {
120122
return client;
121123
}
122124

123-
public ReactiveRpcClient getReactiveClient() {
125+
public ReactiveRpcStreamer getReactiveClient() {
124126
return reactiveClient;
125127
}
126128
}

plugin-host/src/main/java/com/ensarsarajcic/neovim/java/pluginhost/RemotePluginManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import com.ensarsarajcic.neovim.java.api.util.ObjectMappers;
2828
import com.ensarsarajcic.neovim.java.corerpc.client.RpcClient;
29+
import com.ensarsarajcic.neovim.java.corerpc.client.RpcStreamer;
2930
import com.ensarsarajcic.neovim.java.corerpc.message.NotificationMessage;
3031
import com.ensarsarajcic.neovim.java.corerpc.message.RequestMessage;
3132
import com.ensarsarajcic.neovim.java.corerpc.message.ResponseMessage;
@@ -60,14 +61,14 @@ final class RemotePluginManager {
6061

6162
private final NeovimHandlerManager neovimHandlerManager;
6263
private final NeovimHandlerProxy neovimHandlerProxy;
63-
private final RpcClient client;
64+
private final RpcStreamer client;
6465

6566
// Hooks
6667
private final List<Supplier<CompletableFuture<Void>>> preconfigurationHooks = new ArrayList<>();
6768
private final List<Supplier<CompletableFuture<Void>>> readyHooks = new ArrayList<>();
6869
private final List<Supplier<CompletableFuture<Void>>> setupMethods = new ArrayList<>();
6970

70-
RemotePluginManager(NeovimHandlerManager neovimHandlerManager, NeovimHandlerProxy neovimHandlerProxy, RpcClient rpcClient) {
71+
RemotePluginManager(NeovimHandlerManager neovimHandlerManager, NeovimHandlerProxy neovimHandlerProxy, RpcStreamer rpcClient) {
7172
this.neovimHandlerManager = neovimHandlerManager;
7273
this.neovimHandlerProxy = neovimHandlerProxy;
7374
this.client = rpcClient;

0 commit comments

Comments
 (0)