This pertains to the MonacoEditorLanguageClientWrapper when using a worker for the language server.
When starting the wrapper up, if the languageClientWrapper internally fails to start for some reason (such as when working with a misconfigured LS), it's possible to get the LC stuck in a 'starting' state. In such a case disposing of the wrapper, which has failed to start, will also fail because the language client cannot be cleaned up. Due to the order of execution for cleanup on dispose, this means the worker for the language server (if using a worker & not a WS) can be leaked during dispose.
We should ensure that the worker is always cleaned up upon dispose, even if the language client fails on being disposed itself.
This pertains to the
MonacoEditorLanguageClientWrapper
when using a worker for the language server.When starting the wrapper up, if the languageClientWrapper internally fails to start for some reason (such as when working with a misconfigured LS), it's possible to get the LC stuck in a 'starting' state. In such a case disposing of the wrapper, which has failed to start, will also fail because the language client cannot be cleaned up. Due to the order of execution for cleanup on dispose, this means the worker for the language server (if using a worker & not a WS) can be leaked during dispose.
We should ensure that the worker is always cleaned up upon dispose, even if the language client fails on being disposed itself.