Skip to content

Commit

Permalink
Simplified event handling (#79-2)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Aug 8, 2024
1 parent 124db18 commit ff5d280
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions src/services/ExtensionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,16 @@ export class ExtensionController implements Disposable {

this.updateConnectionStatusBarItemVisibility();

// Toggle visibility of connection status bar item based on whether the
// languageid is supported by DH
vscode.window.onDidChangeActiveTextEditor(
const args = [
this.updateConnectionStatusBarItemVisibility,
null,
this.context.subscriptions
);

vscode.workspace.onDidChangeConfiguration(
this.updateConnectionStatusBarItemVisibility,
null,
this.context.subscriptions
);
this.context.subscriptions,
] as const;

vscode.window.onDidChangeActiveTextEditor(...args);
vscode.workspace.onDidChangeConfiguration(...args);
// Handle scenarios such as languageId change within an already open document
vscode.workspace.onDidOpenTextDocument(
this.updateConnectionStatusBarItemVisibility,
null,
this.context.subscriptions
);
vscode.workspace.onDidOpenTextDocument(...args);
};

/**
Expand Down

0 comments on commit ff5d280

Please sign in to comment.