-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension.ts
More file actions
32 lines (26 loc) · 997 Bytes
/
Copy pathextension.ts
File metadata and controls
32 lines (26 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";
import * as vscode from "vscode";
import { importFromRegistry } from "./commands/importFromRegistry";
import { ServerManagerView } from "./ui/serverManagerView";
import { commonActivate, extensionId } from "./commonActivate";
import { logout, serverSessions } from "./makeRESTRequest";
export function activate(context: vscode.ExtensionContext) {
const view = new ServerManagerView(context);
// importServers command is only supported in a node environment
context.subscriptions.push(
vscode.commands.registerCommand(`${extensionId}.importServers`, async () => {
await importFromRegistry(context.secrets);
view.refreshTree();
}),
);
// Common activation steps
return commonActivate(context, view);
}
export async function deactivate() {
// Do our best to log out of all sessions
const promises: Promise<any>[] = [];
for (const serverSession of serverSessions) {
promises.push(logout(serverSession[1].serverName));
}
await Promise.allSettled(promises);
}