feat: add destructor for plugin

finally! proper disconnection
This commit is contained in:
əlemi 2024-09-25 05:12:41 +02:00
parent 8755954b98
commit c03ea41f16
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 6 additions and 5 deletions

View file

@ -396,8 +396,3 @@ export async function jump(selected: vscode.TreeItem | undefined){
editor.revealRange(cursor_range, vscode.TextEditorRevealType.InCenter); editor.revealRange(cursor_range, vscode.TextEditorRevealType.InCenter);
} }
// This method is called when your extension is deactivated
export function deactivate() {
//Maybe i should disconnect from every workspace and buffer ??? // TODO
// TODO
}

View file

@ -45,6 +45,12 @@ export function activate(context: vscode.ExtensionContext) {
} }
} }
export async function deactivate() {
if (commands.client && commands.workspace) {
await commands.client.leave_workspace(commands.workspace.id());
}
}
async function log_poller_task(logger: codemp.JsLogger) { async function log_poller_task(logger: codemp.JsLogger) {
while (true) { while (true) {
let message = await logger.message(); let message = await logger.message();