Skip to content

Commit

Permalink
Follow-up cleanups after clangd#728
Browse files Browse the repository at this point in the history
 - The disposables passed in to install.activate() were not saved for
   cleanup
 - config.get() is not async
  • Loading branch information
HighCommander4 committed Nov 19, 2024
1 parent 4da3e1e commit d8354fb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/clangd-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -68,16 +68,15 @@ export class ClangdContext implements vscode.Disposable {
if (!clangdPath)
return null;

const clangdArguments = await config.get<string[]>('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<string[]>('arguments'),
options: {cwd: vscode.workspace.rootPath || process.cwd()}
};
const traceFile = config.get<string>('trace');
Expand Down

0 comments on commit d8354fb

Please sign in to comment.