Skip to content

Commit 49ec805

Browse files
Follow-up cleanup after #728 (#731)
Save the disposables passed in to install.activate() for cleanup
1 parent ea588aa commit 49ec805

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/clangd-context.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class EnableEditsNearCursorFeature implements vscodelc.StaticFeature {
5757
}
5858

5959
export class ClangdContext implements vscode.Disposable {
60-
subscriptions: vscode.Disposable[] = [];
60+
subscriptions: vscode.Disposable[];
6161
client: ClangdLanguageClient;
6262

6363
static async create(globalStoragePath: string,
@@ -68,10 +68,12 @@ export class ClangdContext implements vscode.Disposable {
6868
if (!clangdPath)
6969
return null;
7070

71-
return new ClangdContext(clangdPath, outputChannel);
71+
return new ClangdContext(subscriptions, clangdPath, outputChannel);
7272
}
7373

74-
private constructor(clangdPath: string, outputChannel: vscode.OutputChannel) {
74+
private constructor(subscriptions: vscode.Disposable[], clangdPath: string,
75+
outputChannel: vscode.OutputChannel) {
76+
this.subscriptions = subscriptions;
7577
const useScriptAsExecutable = config.get<boolean>('useScriptAsExecutable');
7678
let clangdArguments = config.get<string[]>('arguments');
7779
if (useScriptAsExecutable) {

0 commit comments

Comments
 (0)