Skip to content

Commit 8171b24

Browse files
authored
Dispose LSP's output channel on restart (#841)
When restarting SourceKit-LSP its output channel was not disposed, which caused a new entry to be added to the output channel list without removing the old one.
1 parent 800414e commit 8171b24

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/sourcekit-lsp/LanguageClientManager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ export class LanguageClientManager {
351351
.stop()
352352
.then(async () => {
353353
await this.setupLanguageClient(workspaceFolder?.uri);
354+
355+
// Now that the client has been replaced, dispose the old client's output channel.
356+
client.outputChannel.dispose();
354357
})
355358
.catch(async reason => {
356359
// error message matches code here https://github.com/microsoft/vscode-languageserver-node/blob/2041784436fed53f4e77267a49396bca22a7aacf/client/src/common/client.ts#L1409C1-L1409C54

0 commit comments

Comments
 (0)