-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathextensionMain.js
39 lines (29 loc) · 1.21 KB
/
extensionMain.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
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable @typescript-eslint/no-unsafe-call */
"use strict";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const join = require("path").join;
/**
* This file serves as the extension's entryPoint.
* It loads the actual entryPoint from a webpack bundle or from
* tsc compiled source based on the ASK_TOOLKIT_IGNORE_WEBPACK_BUNDLE environment variable.
*
* This allows us to activate the extension from tests.
*/
Object.defineProperty(exports, "__esModule", {value: true});
const extensionEntryPath =
useBundledEntryPoint() === true ? join(__dirname, "dist", "extension") : join(__dirname, "out", "src", "extension");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const extension = require(extensionEntryPath);
async function activate(context) {
await extension.activate(context);
}
async function deactivate() {
await extension.deactivate();
}
function useBundledEntryPoint() {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
return (process.env.ASK_TOOLKIT_IGNORE_WEBPACK_BUNDLE || "false").toLowerCase() !== "true";
}
exports.activate = activate;
exports.deactivate = deactivate;