Skip to content

Commit

Permalink
Follow-up cleanups after #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 20, 2024
1 parent ea588aa commit baca5f8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 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,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<boolean>('useScriptAsExecutable');
let clangdArguments = config.get<string[]>('arguments');
if (useScriptAsExecutable) {
Expand Down

0 comments on commit baca5f8

Please sign in to comment.