diff --git a/src/OneWare.Essentials/LanguageService/LanguageServiceLsp.cs b/src/OneWare.Essentials/LanguageService/LanguageServiceLsp.cs index b16152d..5fdc055 100644 --- a/src/OneWare.Essentials/LanguageService/LanguageServiceLsp.cs +++ b/src/OneWare.Essentials/LanguageService/LanguageServiceLsp.cs @@ -36,7 +36,8 @@ public override async Task ActivateAsync() { //return; if (IsActivated) return; - + IsActivated = true; + if (ExecutablePath == null) { ContainerLocator.Container.Resolve().Warning($"Tried to activate Language Server {Name} without executable!", new NotSupportedException(), false); @@ -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()?.Error(e.Message, e); + + IsActivated = false; return; } } @@ -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()?.Error(e.Message, e); + IsActivated = false; } } }