Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
fix double ls activation
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Feb 29, 2024
1 parent d53c25f commit fe4e9f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/OneWare.Essentials/LanguageService/LanguageServiceLsp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public override async Task ActivateAsync()
{
//return;
if (IsActivated) return;

IsActivated = true;

if (ExecutablePath == null)
{
ContainerLocator.Container.Resolve<ILogger>().Warning($"Tried to activate Language Server {Name} without executable!", new NotSupportedException(), false);
Expand All @@ -58,12 +59,13 @@ public override async Task ActivateAsync()
await websocket.ConnectAsync(new Uri(ExecutablePath), _cancellation.Token);

await InitAsync(websocket.UsePipeReader().AsStream(), websocket.UsePipeWriter().AsStream());
IsActivated = true;
return;
}
catch (Exception e)
{
ContainerLocator.Container.Resolve<ILogger>()?.Error(e.Message, e);

IsActivated = false;
return;
}
}
Expand Down Expand Up @@ -103,11 +105,11 @@ public override async Task ActivateAsync()
}, _cancellation.Token);

await InitAsync(_process.StandardOutput, _process.StandardInput);
IsActivated = true;
}
catch (Exception e)
{
ContainerLocator.Container.Resolve<ILogger>()?.Error(e.Message, e);
IsActivated = false;
}
}
}
Expand Down

0 comments on commit fe4e9f9

Please sign in to comment.