mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add Initialization Code
This commit is contained in:
parent
b57804f255
commit
a971156519
2 changed files with 4 additions and 8 deletions
|
|
@ -40,7 +40,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
{
|
||||
try
|
||||
{
|
||||
var res = await RPC.InvokeWithCancellationAsync<JsonRPCQueryResponseModel>("query",
|
||||
var res = await RPC.InvokeWithCancellationAsync<JsonRPCQueryResponseModel>("query",
|
||||
new[] { query },
|
||||
token);
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
}
|
||||
catch
|
||||
{
|
||||
return new List<Result>();
|
||||
return new List<Result>();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,6 +61,8 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
_ = ReadErrorAsync();
|
||||
|
||||
await RPC.InvokeAsync("initialize", context);
|
||||
|
||||
async Task ReadErrorAsync()
|
||||
{
|
||||
var error = await ErrorStream.ReadToEndAsync();
|
||||
|
|
|
|||
|
|
@ -96,12 +96,6 @@ namespace Flow.Launcher.Core.Plugin
|
|||
RPC = new JsonRpc(handler, new JsonRPCPublicAPI(api));
|
||||
RPC.SynchronizationContext = null;
|
||||
RPC.StartListening();
|
||||
|
||||
_ = process.StandardError.ReadToEndAsync().ContinueWith(e =>
|
||||
{
|
||||
if (e.Result.Length > 0)
|
||||
throw new Exception(e.Result);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue