-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension.js
More file actions
23 lines (21 loc) · 946 Bytes
/
extension.js
File metadata and controls
23 lines (21 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
const vscode = require('vscode');
const { actions, getActionFn } = require('./src/actions');
const { quickSelect } = require('./src/vsutils');
function registerCommand(context, name, cb) {
const disposable = vscode.commands.registerCommand(name, cb);
context.subscriptions.push(disposable);
}
// this code is called when your extension is activated
// your extension is activated the very first time the command is executed
const socket = require('socket.io')('4242');
exports.activate = function activate(context) {
registerCommand(context, 'olympus.openMenu', async () => {
const actionName = await quickSelect(actions);
if (!actionName) return;
getActionFn(actionName)(socket);
});
}
// this method is called when your extension is deactivated
exports.deactivate = function deactivate() { }