Skip to content

Commit

Permalink
Push disposals to context.subscriptions (#1112)
Browse files Browse the repository at this point in the history
Co-authored-by: Ganesh Nalawade <[email protected]>
  • Loading branch information
TamiTakamiya and ganeshrn authored Mar 4, 2024
1 parent 99a6026 commit 45d6486
Showing 1 changed file with 48 additions and 40 deletions.
88 changes: 48 additions & 40 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,52 +234,60 @@ export async function activate(context: ExtensionContext): Promise<void> {
);

// register ansible meta data in the statusbar tooltip (client-server)
window.onDidChangeActiveTextEditor(
async (editor: vscode.TextEditor | undefined) => {
context.subscriptions.push(
window.onDidChangeActiveTextEditor(
async (editor: vscode.TextEditor | undefined) => {
await updateAnsibleStatusBar(
metaData,
lightSpeedManager,
pythonInterpreterManager
);
if (editor) {
await lightSpeedManager.ansibleContentFeedback(
editor.document,
AnsibleContentUploadTrigger.TAB_CHANGE
);
}
}
)
);
context.subscriptions.push(
workspace.onDidOpenTextDocument(async (document: vscode.TextDocument) => {
await updateAnsibleStatusBar(
metaData,
lightSpeedManager,
pythonInterpreterManager
);
if (editor) {
await lightSpeedManager.ansibleContentFeedback(
editor.document,
AnsibleContentUploadTrigger.TAB_CHANGE
);
}
}
lightSpeedManager.ansibleContentFeedback(
document,
AnsibleContentUploadTrigger.FILE_OPEN
);
})
);
context.subscriptions.push(
workspace.onDidCloseTextDocument(async (document: vscode.TextDocument) => {
await lightSpeedManager.ansibleContentFeedback(
document,
AnsibleContentUploadTrigger.FILE_CLOSE
);
})
);

context.subscriptions.push(
workspace.onDidChangeConfiguration(async () => {
await updateConfigurationChanges(
metaData,
pythonInterpreterManager,
extSettings,
lightSpeedManager
);
await updateAnsibleStatusBar(
metaData,
lightSpeedManager,
pythonInterpreterManager
);
})
);
workspace.onDidOpenTextDocument(async (document: vscode.TextDocument) => {
await updateAnsibleStatusBar(
metaData,
lightSpeedManager,
pythonInterpreterManager
);
lightSpeedManager.ansibleContentFeedback(
document,
AnsibleContentUploadTrigger.FILE_OPEN
);
});
workspace.onDidCloseTextDocument(async (document: vscode.TextDocument) => {
await lightSpeedManager.ansibleContentFeedback(
document,
AnsibleContentUploadTrigger.FILE_CLOSE
);
});

workspace.onDidChangeConfiguration(async () => {
await updateConfigurationChanges(
metaData,
pythonInterpreterManager,
extSettings,
lightSpeedManager
);
await updateAnsibleStatusBar(
metaData,
lightSpeedManager,
pythonInterpreterManager
);
});

context.subscriptions.push(
workspace.onDidChangeTextDocument((e: vscode.TextDocumentChangeEvent) => {
Expand Down

0 comments on commit 45d6486

Please sign in to comment.