@theia/variable-resolver 1.48.1 → 1.48.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +114 -114
  2. package/lib/browser/common-variable-contribution.d.ts +16 -16
  3. package/lib/browser/common-variable-contribution.js +161 -161
  4. package/lib/browser/index.d.ts +3 -3
  5. package/lib/browser/index.js +21 -21
  6. package/lib/browser/variable-input-schema.d.ts +2 -2
  7. package/lib/browser/variable-input-schema.js +130 -130
  8. package/lib/browser/variable-input.d.ts +20 -20
  9. package/lib/browser/variable-input.js +2 -2
  10. package/lib/browser/variable-quick-open-service.d.ts +14 -14
  11. package/lib/browser/variable-quick-open-service.js +69 -69
  12. package/lib/browser/variable-resolver-frontend-contribution.d.ts +13 -13
  13. package/lib/browser/variable-resolver-frontend-contribution.js +53 -53
  14. package/lib/browser/variable-resolver-frontend-contribution.spec.d.ts +4 -4
  15. package/lib/browser/variable-resolver-frontend-contribution.spec.js +82 -82
  16. package/lib/browser/variable-resolver-frontend-module.d.ts +3 -3
  17. package/lib/browser/variable-resolver-frontend-module.js +37 -37
  18. package/lib/browser/variable-resolver-service.d.ts +50 -50
  19. package/lib/browser/variable-resolver-service.js +162 -162
  20. package/lib/browser/variable-resolver-service.spec.d.ts +1 -1
  21. package/lib/browser/variable-resolver-service.spec.js +75 -75
  22. package/lib/browser/variable.d.ts +55 -55
  23. package/lib/browser/variable.js +73 -73
  24. package/lib/browser/variable.spec.d.ts +1 -1
  25. package/lib/browser/variable.spec.js +90 -90
  26. package/lib/common/variable-types.d.ts +7 -7
  27. package/lib/common/variable-types.js +17 -17
  28. package/package.json +4 -4
  29. package/src/browser/common-variable-contribution.ts +151 -151
  30. package/src/browser/index.ts +19 -19
  31. package/src/browser/variable-input-schema.ts +131 -131
  32. package/src/browser/variable-input.ts +47 -47
  33. package/src/browser/variable-quick-open-service.ts +62 -62
  34. package/src/browser/variable-resolver-frontend-contribution.spec.ts +98 -98
  35. package/src/browser/variable-resolver-frontend-contribution.ts +50 -50
  36. package/src/browser/variable-resolver-frontend-module.ts +40 -40
  37. package/src/browser/variable-resolver-service.spec.ts +83 -83
  38. package/src/browser/variable-resolver-service.ts +185 -185
  39. package/src/browser/variable.spec.ts +106 -106
  40. package/src/browser/variable.ts +111 -111
  41. package/src/common/variable-types.ts +23 -23
@@ -1,131 +1,131 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- /*---------------------------------------------------------------------------------------------
18
- * Copyright (c) Microsoft Corporation. All rights reserved.
19
- * Licensed under the MIT License. See License.txt in the project root for license information.
20
- *--------------------------------------------------------------------------------------------*/
21
- /*
22
- * copied from
23
- * https://github.com/microsoft/vscode/blob/0a34756cae4fc67739e60c708b04637089f8bb0d/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.ts#L23
24
- */
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.inputsSchema = void 0;
27
- const idDescription = "The input's id is used to associate an input with a variable of the form ${input:id}.";
28
- const typeDescription = 'The type of user input prompt to use.';
29
- const descriptionDescription = 'The description is shown when the user is prompted for input.';
30
- const defaultDescription = 'The default value for the input.';
31
- exports.inputsSchema = {
32
- definitions: {
33
- inputs: {
34
- type: 'array',
35
- description: 'User inputs. Used for defining user input prompts, such as free string input or a choice from several options.',
36
- items: {
37
- oneOf: [
38
- {
39
- type: 'object',
40
- required: ['id', 'type', 'description'],
41
- additionalProperties: false,
42
- properties: {
43
- id: {
44
- type: 'string',
45
- description: idDescription
46
- },
47
- type: {
48
- type: 'string',
49
- description: typeDescription,
50
- enum: ['promptString'],
51
- enumDescriptions: [
52
- "The 'promptString' type opens an input box to ask the user for input."
53
- ]
54
- },
55
- description: {
56
- type: 'string',
57
- description: descriptionDescription
58
- },
59
- default: {
60
- type: 'string',
61
- description: defaultDescription
62
- },
63
- }
64
- },
65
- {
66
- type: 'object',
67
- required: ['id', 'type', 'description', 'options'],
68
- additionalProperties: false,
69
- properties: {
70
- id: {
71
- type: 'string',
72
- description: idDescription
73
- },
74
- type: {
75
- type: 'string',
76
- description: typeDescription,
77
- enum: ['pickString'],
78
- enumDescriptions: [
79
- "The 'pickString' type shows a selection list.",
80
- ]
81
- },
82
- description: {
83
- type: 'string',
84
- description: descriptionDescription
85
- },
86
- default: {
87
- type: 'string',
88
- description: defaultDescription
89
- },
90
- options: {
91
- type: 'array',
92
- description: 'An array of strings that defines the options for a quick pick.',
93
- items: {
94
- type: 'string'
95
- }
96
- }
97
- }
98
- },
99
- {
100
- type: 'object',
101
- required: ['id', 'type', 'command'],
102
- additionalProperties: false,
103
- properties: {
104
- id: {
105
- type: 'string',
106
- description: idDescription
107
- },
108
- type: {
109
- type: 'string',
110
- description: typeDescription,
111
- enum: ['command'],
112
- enumDescriptions: [
113
- "The 'command' type executes a command.",
114
- ]
115
- },
116
- command: {
117
- type: 'string',
118
- description: 'The command to execute for this input variable.'
119
- },
120
- args: {
121
- type: 'object',
122
- description: 'Optional arguments passed to the command.'
123
- }
124
- }
125
- }
126
- ]
127
- }
128
- }
129
- }
130
- };
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ /*---------------------------------------------------------------------------------------------
18
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19
+ * Licensed under the MIT License. See License.txt in the project root for license information.
20
+ *--------------------------------------------------------------------------------------------*/
21
+ /*
22
+ * copied from
23
+ * https://github.com/microsoft/vscode/blob/0a34756cae4fc67739e60c708b04637089f8bb0d/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.ts#L23
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.inputsSchema = void 0;
27
+ const idDescription = "The input's id is used to associate an input with a variable of the form ${input:id}.";
28
+ const typeDescription = 'The type of user input prompt to use.';
29
+ const descriptionDescription = 'The description is shown when the user is prompted for input.';
30
+ const defaultDescription = 'The default value for the input.';
31
+ exports.inputsSchema = {
32
+ definitions: {
33
+ inputs: {
34
+ type: 'array',
35
+ description: 'User inputs. Used for defining user input prompts, such as free string input or a choice from several options.',
36
+ items: {
37
+ oneOf: [
38
+ {
39
+ type: 'object',
40
+ required: ['id', 'type', 'description'],
41
+ additionalProperties: false,
42
+ properties: {
43
+ id: {
44
+ type: 'string',
45
+ description: idDescription
46
+ },
47
+ type: {
48
+ type: 'string',
49
+ description: typeDescription,
50
+ enum: ['promptString'],
51
+ enumDescriptions: [
52
+ "The 'promptString' type opens an input box to ask the user for input."
53
+ ]
54
+ },
55
+ description: {
56
+ type: 'string',
57
+ description: descriptionDescription
58
+ },
59
+ default: {
60
+ type: 'string',
61
+ description: defaultDescription
62
+ },
63
+ }
64
+ },
65
+ {
66
+ type: 'object',
67
+ required: ['id', 'type', 'description', 'options'],
68
+ additionalProperties: false,
69
+ properties: {
70
+ id: {
71
+ type: 'string',
72
+ description: idDescription
73
+ },
74
+ type: {
75
+ type: 'string',
76
+ description: typeDescription,
77
+ enum: ['pickString'],
78
+ enumDescriptions: [
79
+ "The 'pickString' type shows a selection list.",
80
+ ]
81
+ },
82
+ description: {
83
+ type: 'string',
84
+ description: descriptionDescription
85
+ },
86
+ default: {
87
+ type: 'string',
88
+ description: defaultDescription
89
+ },
90
+ options: {
91
+ type: 'array',
92
+ description: 'An array of strings that defines the options for a quick pick.',
93
+ items: {
94
+ type: 'string'
95
+ }
96
+ }
97
+ }
98
+ },
99
+ {
100
+ type: 'object',
101
+ required: ['id', 'type', 'command'],
102
+ additionalProperties: false,
103
+ properties: {
104
+ id: {
105
+ type: 'string',
106
+ description: idDescription
107
+ },
108
+ type: {
109
+ type: 'string',
110
+ description: typeDescription,
111
+ enum: ['command'],
112
+ enumDescriptions: [
113
+ "The 'command' type executes a command.",
114
+ ]
115
+ },
116
+ command: {
117
+ type: 'string',
118
+ description: 'The command to execute for this input variable.'
119
+ },
120
+ args: {
121
+ type: 'object',
122
+ description: 'Optional arguments passed to the command.'
123
+ }
124
+ }
125
+ }
126
+ ]
127
+ }
128
+ }
129
+ }
130
+ };
131
131
  //# sourceMappingURL=variable-input-schema.js.map
@@ -1,21 +1,21 @@
1
- export interface VariablePromptStringInput {
2
- id: string;
3
- type: 'promptString';
4
- description: string;
5
- default?: string;
6
- }
7
- export interface VariablePickStringInput {
8
- id: string;
9
- type: 'pickString';
10
- description: string;
11
- options: string[];
12
- default?: string;
13
- }
14
- export interface VariableCommandInput {
15
- id: string;
16
- type: 'command';
17
- command: string;
18
- args?: any;
19
- }
20
- export declare type VariableInput = VariablePromptStringInput | VariablePickStringInput | VariableCommandInput;
1
+ export interface VariablePromptStringInput {
2
+ id: string;
3
+ type: 'promptString';
4
+ description: string;
5
+ default?: string;
6
+ }
7
+ export interface VariablePickStringInput {
8
+ id: string;
9
+ type: 'pickString';
10
+ description: string;
11
+ options: string[];
12
+ default?: string;
13
+ }
14
+ export interface VariableCommandInput {
15
+ id: string;
16
+ type: 'command';
17
+ command: string;
18
+ args?: any;
19
+ }
20
+ export declare type VariableInput = VariablePromptStringInput | VariablePickStringInput | VariableCommandInput;
21
21
  //# sourceMappingURL=variable-input.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=variable-input.js.map
@@ -1,15 +1,15 @@
1
- import { MessageService } from '@theia/core/lib/common/message-service';
2
- import { VariableRegistry, Variable } from './variable';
3
- import { VariableResolverService } from './variable-resolver-service';
4
- import { QuickPickItem, QuickInputService } from '@theia/core/lib/browser';
5
- export declare class VariableQuickOpenService {
6
- protected readonly variableRegistry: VariableRegistry;
7
- protected items: Array<QuickPickItem>;
8
- protected readonly messages: MessageService;
9
- protected readonly quickInputService: QuickInputService;
10
- protected readonly variableResolver: VariableResolverService;
11
- constructor(variableRegistry: VariableRegistry);
12
- open(): void;
13
- protected showValue(variable: Variable): Promise<void>;
14
- }
1
+ import { MessageService } from '@theia/core/lib/common/message-service';
2
+ import { VariableRegistry, Variable } from './variable';
3
+ import { VariableResolverService } from './variable-resolver-service';
4
+ import { QuickPickItem, QuickInputService } from '@theia/core/lib/browser';
5
+ export declare class VariableQuickOpenService {
6
+ protected readonly variableRegistry: VariableRegistry;
7
+ protected items: Array<QuickPickItem>;
8
+ protected readonly messages: MessageService;
9
+ protected readonly quickInputService: QuickInputService;
10
+ protected readonly variableResolver: VariableResolverService;
11
+ constructor(variableRegistry: VariableRegistry);
12
+ open(): void;
13
+ protected showValue(variable: Variable): Promise<void>;
14
+ }
15
15
  //# sourceMappingURL=variable-quick-open-service.d.ts.map
@@ -1,70 +1,70 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 Red Hat, Inc. and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.VariableQuickOpenService = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const message_service_1 = require("@theia/core/lib/common/message-service");
22
- const variable_1 = require("./variable");
23
- const variable_resolver_service_1 = require("./variable-resolver-service");
24
- const browser_1 = require("@theia/core/lib/browser");
25
- let VariableQuickOpenService = class VariableQuickOpenService {
26
- constructor(variableRegistry) {
27
- this.variableRegistry = variableRegistry;
28
- }
29
- open() {
30
- var _a;
31
- this.items = this.variableRegistry.getVariables().map(v => ({
32
- label: '${' + v.name + '}',
33
- detail: v.description,
34
- execute: () => {
35
- setTimeout(() => this.showValue(v));
36
- }
37
- }));
38
- (_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(this.items, { placeholder: 'Registered variables' });
39
- }
40
- async showValue(variable) {
41
- var _a;
42
- const argument = await ((_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.input({
43
- placeHolder: 'Type a variable argument'
44
- }));
45
- const value = await this.variableResolver.resolve('${' + variable.name + ':' + argument + '}');
46
- if (typeof value === 'string') {
47
- this.messages.info(value);
48
- }
49
- }
50
- };
51
- (0, tslib_1.__decorate)([
52
- (0, inversify_1.inject)(message_service_1.MessageService),
53
- (0, tslib_1.__metadata)("design:type", message_service_1.MessageService)
54
- ], VariableQuickOpenService.prototype, "messages", void 0);
55
- (0, tslib_1.__decorate)([
56
- (0, inversify_1.inject)(browser_1.QuickInputService),
57
- (0, inversify_1.optional)(),
58
- (0, tslib_1.__metadata)("design:type", Object)
59
- ], VariableQuickOpenService.prototype, "quickInputService", void 0);
60
- (0, tslib_1.__decorate)([
61
- (0, inversify_1.inject)(variable_resolver_service_1.VariableResolverService),
62
- (0, tslib_1.__metadata)("design:type", variable_resolver_service_1.VariableResolverService)
63
- ], VariableQuickOpenService.prototype, "variableResolver", void 0);
64
- VariableQuickOpenService = (0, tslib_1.__decorate)([
65
- (0, inversify_1.injectable)(),
66
- (0, tslib_1.__param)(0, (0, inversify_1.inject)(variable_1.VariableRegistry)),
67
- (0, tslib_1.__metadata)("design:paramtypes", [variable_1.VariableRegistry])
68
- ], VariableQuickOpenService);
69
- exports.VariableQuickOpenService = VariableQuickOpenService;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 Red Hat, Inc. and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.VariableQuickOpenService = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const message_service_1 = require("@theia/core/lib/common/message-service");
22
+ const variable_1 = require("./variable");
23
+ const variable_resolver_service_1 = require("./variable-resolver-service");
24
+ const browser_1 = require("@theia/core/lib/browser");
25
+ let VariableQuickOpenService = class VariableQuickOpenService {
26
+ constructor(variableRegistry) {
27
+ this.variableRegistry = variableRegistry;
28
+ }
29
+ open() {
30
+ var _a;
31
+ this.items = this.variableRegistry.getVariables().map(v => ({
32
+ label: '${' + v.name + '}',
33
+ detail: v.description,
34
+ execute: () => {
35
+ setTimeout(() => this.showValue(v));
36
+ }
37
+ }));
38
+ (_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(this.items, { placeholder: 'Registered variables' });
39
+ }
40
+ async showValue(variable) {
41
+ var _a;
42
+ const argument = await ((_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.input({
43
+ placeHolder: 'Type a variable argument'
44
+ }));
45
+ const value = await this.variableResolver.resolve('${' + variable.name + ':' + argument + '}');
46
+ if (typeof value === 'string') {
47
+ this.messages.info(value);
48
+ }
49
+ }
50
+ };
51
+ (0, tslib_1.__decorate)([
52
+ (0, inversify_1.inject)(message_service_1.MessageService),
53
+ (0, tslib_1.__metadata)("design:type", message_service_1.MessageService)
54
+ ], VariableQuickOpenService.prototype, "messages", void 0);
55
+ (0, tslib_1.__decorate)([
56
+ (0, inversify_1.inject)(browser_1.QuickInputService),
57
+ (0, inversify_1.optional)(),
58
+ (0, tslib_1.__metadata)("design:type", Object)
59
+ ], VariableQuickOpenService.prototype, "quickInputService", void 0);
60
+ (0, tslib_1.__decorate)([
61
+ (0, inversify_1.inject)(variable_resolver_service_1.VariableResolverService),
62
+ (0, tslib_1.__metadata)("design:type", variable_resolver_service_1.VariableResolverService)
63
+ ], VariableQuickOpenService.prototype, "variableResolver", void 0);
64
+ VariableQuickOpenService = (0, tslib_1.__decorate)([
65
+ (0, inversify_1.injectable)(),
66
+ (0, tslib_1.__param)(0, (0, inversify_1.inject)(variable_1.VariableRegistry)),
67
+ (0, tslib_1.__metadata)("design:paramtypes", [variable_1.VariableRegistry])
68
+ ], VariableQuickOpenService);
69
+ exports.VariableQuickOpenService = VariableQuickOpenService;
70
70
  //# sourceMappingURL=variable-quick-open-service.js.map
@@ -1,14 +1,14 @@
1
- import { FrontendApplicationContribution } from '@theia/core/lib/browser';
2
- import { Command, CommandContribution, CommandRegistry, ContributionProvider } from '@theia/core/lib/common';
3
- import { VariableContribution, VariableRegistry } from './variable';
4
- import { VariableQuickOpenService } from './variable-quick-open-service';
5
- export declare const LIST_VARIABLES: Command;
6
- export declare class VariableResolverFrontendContribution implements FrontendApplicationContribution, CommandContribution {
7
- protected readonly contributionProvider: ContributionProvider<VariableContribution>;
8
- protected readonly variableRegistry: VariableRegistry;
9
- protected readonly variableQuickOpenService: VariableQuickOpenService;
10
- constructor(contributionProvider: ContributionProvider<VariableContribution>, variableRegistry: VariableRegistry, variableQuickOpenService: VariableQuickOpenService);
11
- onStart(): void;
12
- registerCommands(commands: CommandRegistry): void;
13
- }
1
+ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
2
+ import { Command, CommandContribution, CommandRegistry, ContributionProvider } from '@theia/core/lib/common';
3
+ import { VariableContribution, VariableRegistry } from './variable';
4
+ import { VariableQuickOpenService } from './variable-quick-open-service';
5
+ export declare const LIST_VARIABLES: Command;
6
+ export declare class VariableResolverFrontendContribution implements FrontendApplicationContribution, CommandContribution {
7
+ protected readonly contributionProvider: ContributionProvider<VariableContribution>;
8
+ protected readonly variableRegistry: VariableRegistry;
9
+ protected readonly variableQuickOpenService: VariableQuickOpenService;
10
+ constructor(contributionProvider: ContributionProvider<VariableContribution>, variableRegistry: VariableRegistry, variableQuickOpenService: VariableQuickOpenService);
11
+ onStart(): void;
12
+ registerCommands(commands: CommandRegistry): void;
13
+ }
14
14
  //# sourceMappingURL=variable-resolver-frontend-contribution.d.ts.map
@@ -1,54 +1,54 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 Red Hat, Inc. and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.VariableResolverFrontendContribution = exports.LIST_VARIABLES = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const common_1 = require("@theia/core/lib/common");
22
- const variable_1 = require("./variable");
23
- const variable_quick_open_service_1 = require("./variable-quick-open-service");
24
- exports.LIST_VARIABLES = {
25
- id: 'variable.list',
26
- label: 'Variable: List All'
27
- };
28
- let VariableResolverFrontendContribution = class VariableResolverFrontendContribution {
29
- constructor(contributionProvider, variableRegistry, variableQuickOpenService) {
30
- this.contributionProvider = contributionProvider;
31
- this.variableRegistry = variableRegistry;
32
- this.variableQuickOpenService = variableQuickOpenService;
33
- }
34
- onStart() {
35
- this.contributionProvider.getContributions().forEach(contrib => contrib.registerVariables(this.variableRegistry));
36
- }
37
- registerCommands(commands) {
38
- commands.registerCommand(exports.LIST_VARIABLES, {
39
- isEnabled: () => true,
40
- execute: () => this.variableQuickOpenService.open()
41
- });
42
- }
43
- };
44
- VariableResolverFrontendContribution = (0, tslib_1.__decorate)([
45
- (0, inversify_1.injectable)(),
46
- (0, tslib_1.__param)(0, (0, inversify_1.inject)(common_1.ContributionProvider)),
47
- (0, tslib_1.__param)(0, (0, inversify_1.named)(variable_1.VariableContribution)),
48
- (0, tslib_1.__param)(1, (0, inversify_1.inject)(variable_1.VariableRegistry)),
49
- (0, tslib_1.__param)(2, (0, inversify_1.inject)(variable_quick_open_service_1.VariableQuickOpenService)),
50
- (0, tslib_1.__metadata)("design:paramtypes", [Object, variable_1.VariableRegistry,
51
- variable_quick_open_service_1.VariableQuickOpenService])
52
- ], VariableResolverFrontendContribution);
53
- exports.VariableResolverFrontendContribution = VariableResolverFrontendContribution;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 Red Hat, Inc. and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.VariableResolverFrontendContribution = exports.LIST_VARIABLES = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const common_1 = require("@theia/core/lib/common");
22
+ const variable_1 = require("./variable");
23
+ const variable_quick_open_service_1 = require("./variable-quick-open-service");
24
+ exports.LIST_VARIABLES = {
25
+ id: 'variable.list',
26
+ label: 'Variable: List All'
27
+ };
28
+ let VariableResolverFrontendContribution = class VariableResolverFrontendContribution {
29
+ constructor(contributionProvider, variableRegistry, variableQuickOpenService) {
30
+ this.contributionProvider = contributionProvider;
31
+ this.variableRegistry = variableRegistry;
32
+ this.variableQuickOpenService = variableQuickOpenService;
33
+ }
34
+ onStart() {
35
+ this.contributionProvider.getContributions().forEach(contrib => contrib.registerVariables(this.variableRegistry));
36
+ }
37
+ registerCommands(commands) {
38
+ commands.registerCommand(exports.LIST_VARIABLES, {
39
+ isEnabled: () => true,
40
+ execute: () => this.variableQuickOpenService.open()
41
+ });
42
+ }
43
+ };
44
+ VariableResolverFrontendContribution = (0, tslib_1.__decorate)([
45
+ (0, inversify_1.injectable)(),
46
+ (0, tslib_1.__param)(0, (0, inversify_1.inject)(common_1.ContributionProvider)),
47
+ (0, tslib_1.__param)(0, (0, inversify_1.named)(variable_1.VariableContribution)),
48
+ (0, tslib_1.__param)(1, (0, inversify_1.inject)(variable_1.VariableRegistry)),
49
+ (0, tslib_1.__param)(2, (0, inversify_1.inject)(variable_quick_open_service_1.VariableQuickOpenService)),
50
+ (0, tslib_1.__metadata)("design:paramtypes", [Object, variable_1.VariableRegistry,
51
+ variable_quick_open_service_1.VariableQuickOpenService])
52
+ ], VariableResolverFrontendContribution);
53
+ exports.VariableResolverFrontendContribution = VariableResolverFrontendContribution;
54
54
  //# sourceMappingURL=variable-resolver-frontend-contribution.js.map
@@ -1,5 +1,5 @@
1
- import { VariableContribution, VariableRegistry } from './variable';
2
- export declare class TestVariableContribution implements VariableContribution {
3
- registerVariables(variables: VariableRegistry): void;
4
- }
1
+ import { VariableContribution, VariableRegistry } from './variable';
2
+ export declare class TestVariableContribution implements VariableContribution {
3
+ registerVariables(variables: VariableRegistry): void;
4
+ }
5
5
  //# sourceMappingURL=variable-resolver-frontend-contribution.spec.d.ts.map