From baca5f8273d1ab8ab1f3f1c6125efdc7e83d4329 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 19 Nov 2024 01:13:41 -0500 Subject: [PATCH] Follow-up cleanups after #728 - The disposables passed in to install.activate() were not saved for cleanup - config.get() is not async --- src/clangd-context.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/clangd-context.ts b/src/clangd-context.ts index 1ccf01b..b4d79a2 100644 --- a/src/clangd-context.ts +++ b/src/clangd-context.ts @@ -57,7 +57,7 @@ class EnableEditsNearCursorFeature implements vscodelc.StaticFeature { } export class ClangdContext implements vscode.Disposable { - subscriptions: vscode.Disposable[] = []; + subscriptions: vscode.Disposable[]; client: ClangdLanguageClient; static async create(globalStoragePath: string, @@ -68,10 +68,12 @@ export class ClangdContext implements vscode.Disposable { if (!clangdPath) return null; - return new ClangdContext(clangdPath, outputChannel); + return new ClangdContext(subscriptions, clangdPath, outputChannel); } - private constructor(clangdPath: string, outputChannel: vscode.OutputChannel) { + private constructor(subscriptions: vscode.Disposable[], clangdPath: string, + outputChannel: vscode.OutputChannel) { + this.subscriptions = subscriptions; const useScriptAsExecutable = config.get('useScriptAsExecutable'); let clangdArguments = config.get('arguments'); if (useScriptAsExecutable) {