-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmain.js
51 lines (37 loc) · 1.17 KB
/
main.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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const nls = require('vscode-nls');
const path = require('path');
const options = {
messageFormat: nls.MessageFormat.bundle
};
// TODO: Should we use VSCODE_NLS_CONFIG?
if (process.env.VSCODE_DAPR_LOCALE) {
options.locale = process.env.VSCODE_DAPR_LOCALE;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const localize = nls.config(options)();
var actualExtension;
function getExtension(extensionPath) {
if (!actualExtension) {
const extensionFolderName = 'dist';
const extensionFileName = `./${extensionFolderName}/extension`;
global.vscodeDapr = {
localizationRootPath: path.join(extensionPath, extensionFolderName)
};
actualExtension = require(extensionFileName);
}
return actualExtension;
}
function activate(ctx) {
getExtension(ctx.extensionPath).activate(ctx);
}
function deactivate() {
if (actualExtension) {
return actualExtension.deactivate();
}
}
exports.activate = activate;
exports.deactivate = deactivate;