From d8354fb7f4ec57c73347b71c34251b4d049ba02f 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 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/clangd-context.ts b/src/clangd-context.ts index db2412b..5c1106c 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,16 +68,15 @@ export class ClangdContext implements vscode.Disposable { if (!clangdPath) return null; - const clangdArguments = await config.get('arguments'); - - return new ClangdContext(clangdPath, clangdArguments, outputChannel); + return new ClangdContext(subscriptions, clangdPath, outputChannel); } - private constructor(clangdPath: string, clangdArguments: string[], + private constructor(subscriptions: vscode.Disposable[], clangdPath: string, outputChannel: vscode.OutputChannel) { + this.subscriptions = subscriptions; const clangd: vscodelc.Executable = { command: clangdPath, - args: clangdArguments, + args: config.get('arguments'), options: {cwd: vscode.workspace.rootPath || process.cwd()} }; const traceFile = config.get('trace');