diff --git a/src/clangd-context.ts b/src/clangd-context.ts index db2412b..593d0ff 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,16 @@ 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');