-
Notifications
You must be signed in to change notification settings - Fork 18
/
extension.js
94 lines (85 loc) · 2.01 KB
/
extension.js
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
const installDependencies = require("./helpers/onInitDependencyInstaller");
const vscode = require("vscode");
const {
activateFn,
createEnv,
deploy,
init,
newFunction,
start,
list
} = require("./commands");
/**
* @param {vscode.ExtensionContext} context
*/
const output = vscode.window.createOutputChannel("twilio");
const activate = context => {
console.log("Twilio Serverless for Code is now active!");
installDependencies(context, output);
const createProject = vscode.commands.registerCommand("extension.init", init);
const createFunction = vscode.commands.registerCommand(
"extension.new",
newFunction
);
const startServer = vscode.commands.registerCommand("extension.start", start);
const deployFunction = vscode.commands.registerCommand(
"extension.deploy",
deploy
);
const activateFunction = vscode.commands.registerCommand(
"extension.activate",
activateFn
);
const createEnvironment = vscode.commands.registerCommand(
"extension.createEnvironment",
createEnv
);
const listFunctions = vscode.commands.registerCommand(
"extension.listFunctions",
list
);
const listServices = vscode.commands.registerCommand(
"extension.listServices",
() => {
list("services");
}
);
const listEnvironments = vscode.commands.registerCommand(
"extension.listEnvironments",
() => {
list("environments");
}
);
const listAssets = vscode.commands.registerCommand(
"extension.listAssets",
() => {
list("assets");
}
);
const listVariables = vscode.commands.registerCommand(
"extension.listVariables",
() => {
list("variables");
}
);
context.subscriptions.push(
activateFunction,
createEnvironment,
createFunction,
createProject,
deployFunction,
startServer,
listFunctions,
listServices,
listEnvironments,
listAssets,
listVariables
);
};
const deactivate = () => {
/* nothing to do for now */
};
module.exports = {
activate,
deactivate
};