Skip to content

Commit a971156

Browse files
committed
Add Initialization Code
1 parent b57804f commit a971156

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public override async Task<List<Result>> QueryAsync(Query query, CancellationTok
4040
{
4141
try
4242
{
43-
var res = await RPC.InvokeWithCancellationAsync<JsonRPCQueryResponseModel>("query",
43+
var res = await RPC.InvokeWithCancellationAsync<JsonRPCQueryResponseModel>("query",
4444
new[] { query },
4545
token);
4646

@@ -50,7 +50,7 @@ public override async Task<List<Result>> QueryAsync(Query query, CancellationTok
5050
}
5151
catch
5252
{
53-
return new List<Result>();
53+
return new List<Result>();
5454
}
5555
}
5656

@@ -61,6 +61,8 @@ public override async Task InitAsync(PluginInitContext context)
6161

6262
_ = ReadErrorAsync();
6363

64+
await RPC.InvokeAsync("initialize", context);
65+
6466
async Task ReadErrorAsync()
6567
{
6668
var error = await ErrorStream.ReadToEndAsync();

Flow.Launcher.Core/Plugin/PythonPluginV2.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ private void SetupJsonRPC(Process process, IPublicAPI api)
9696
RPC = new JsonRpc(handler, new JsonRPCPublicAPI(api));
9797
RPC.SynchronizationContext = null;
9898
RPC.StartListening();
99-
100-
_ = process.StandardError.ReadToEndAsync().ContinueWith(e =>
101-
{
102-
if (e.Result.Length > 0)
103-
throw new Exception(e.Result);
104-
});
10599
}
106100
}
107101
}

0 commit comments

Comments
 (0)