@theia/variable-resolver 1.45.1 → 1.46.0-next.72
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.
- package/README.md +114 -114
- package/lib/browser/common-variable-contribution.d.ts +16 -16
- package/lib/browser/common-variable-contribution.js +169 -169
- package/lib/browser/index.d.ts +3 -3
- package/lib/browser/index.js +30 -30
- package/lib/browser/variable-input-schema.d.ts +2 -2
- package/lib/browser/variable-input-schema.js +130 -130
- package/lib/browser/variable-input.d.ts +20 -20
- package/lib/browser/variable-input.js +2 -2
- package/lib/browser/variable-quick-open-service.d.ts +14 -14
- package/lib/browser/variable-quick-open-service.js +80 -80
- package/lib/browser/variable-resolver-frontend-contribution.d.ts +13 -13
- package/lib/browser/variable-resolver-frontend-contribution.js +64 -64
- package/lib/browser/variable-resolver-frontend-contribution.spec.d.ts +4 -4
- package/lib/browser/variable-resolver-frontend-contribution.spec.js +82 -82
- package/lib/browser/variable-resolver-frontend-module.d.ts +3 -3
- package/lib/browser/variable-resolver-frontend-module.js +37 -37
- package/lib/browser/variable-resolver-service.d.ts +50 -50
- package/lib/browser/variable-resolver-service.js +170 -170
- package/lib/browser/variable-resolver-service.spec.d.ts +1 -1
- package/lib/browser/variable-resolver-service.spec.js +75 -75
- package/lib/browser/variable.d.ts +55 -55
- package/lib/browser/variable.js +78 -78
- package/lib/browser/variable.spec.d.ts +1 -1
- package/lib/browser/variable.spec.js +90 -90
- package/lib/common/variable-types.d.ts +7 -7
- package/lib/common/variable-types.js +17 -17
- package/package.json +4 -4
- package/src/browser/common-variable-contribution.ts +151 -151
- package/src/browser/index.ts +19 -19
- package/src/browser/variable-input-schema.ts +131 -131
- package/src/browser/variable-input.ts +47 -47
- package/src/browser/variable-quick-open-service.ts +62 -62
- package/src/browser/variable-resolver-frontend-contribution.spec.ts +98 -98
- package/src/browser/variable-resolver-frontend-contribution.ts +50 -50
- package/src/browser/variable-resolver-frontend-module.ts +40 -40
- package/src/browser/variable-resolver-service.spec.ts +83 -83
- package/src/browser/variable-resolver-service.ts +185 -185
- package/src/browser/variable.spec.ts +106 -106
- package/src/browser/variable.ts +111 -111
- package/src/common/variable-types.ts +23 -23
package/lib/browser/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
__exportStar(require("./variable"), exports);
|
|
29
|
-
__exportStar(require("./variable-quick-open-service"), exports);
|
|
30
|
-
__exportStar(require("./variable-resolver-service"), exports);
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
__exportStar(require("./variable"), exports);
|
|
29
|
+
__exportStar(require("./variable-quick-open-service"), exports);
|
|
30
|
+
__exportStar(require("./variable-resolver-service"), exports);
|
|
31
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IJSONSchema } from '@theia/core/lib/common/json-schema';
|
|
2
|
-
export declare const inputsSchema: IJSONSchema;
|
|
1
|
+
import { IJSONSchema } from '@theia/core/lib/common/json-schema';
|
|
2
|
+
export declare const inputsSchema: IJSONSchema;
|
|
3
3
|
//# sourceMappingURL=variable-input-schema.d.ts.map
|
|
@@ -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,81 +1,81 @@
|
|
|
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
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.VariableQuickOpenService = void 0;
|
|
31
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
|
-
const message_service_1 = require("@theia/core/lib/common/message-service");
|
|
33
|
-
const variable_1 = require("./variable");
|
|
34
|
-
const variable_resolver_service_1 = require("./variable-resolver-service");
|
|
35
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
36
|
-
let VariableQuickOpenService = class VariableQuickOpenService {
|
|
37
|
-
constructor(variableRegistry) {
|
|
38
|
-
this.variableRegistry = variableRegistry;
|
|
39
|
-
}
|
|
40
|
-
open() {
|
|
41
|
-
var _a;
|
|
42
|
-
this.items = this.variableRegistry.getVariables().map(v => ({
|
|
43
|
-
label: '${' + v.name + '}',
|
|
44
|
-
detail: v.description,
|
|
45
|
-
execute: () => {
|
|
46
|
-
setTimeout(() => this.showValue(v));
|
|
47
|
-
}
|
|
48
|
-
}));
|
|
49
|
-
(_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(this.items, { placeholder: 'Registered variables' });
|
|
50
|
-
}
|
|
51
|
-
async showValue(variable) {
|
|
52
|
-
var _a;
|
|
53
|
-
const argument = await ((_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.input({
|
|
54
|
-
placeHolder: 'Type a variable argument'
|
|
55
|
-
}));
|
|
56
|
-
const value = await this.variableResolver.resolve('${' + variable.name + ':' + argument + '}');
|
|
57
|
-
if (typeof value === 'string') {
|
|
58
|
-
this.messages.info(value);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, inversify_1.inject)(message_service_1.MessageService),
|
|
64
|
-
__metadata("design:type", message_service_1.MessageService)
|
|
65
|
-
], VariableQuickOpenService.prototype, "messages", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, inversify_1.inject)(browser_1.QuickInputService),
|
|
68
|
-
(0, inversify_1.optional)(),
|
|
69
|
-
__metadata("design:type", Object)
|
|
70
|
-
], VariableQuickOpenService.prototype, "quickInputService", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, inversify_1.inject)(variable_resolver_service_1.VariableResolverService),
|
|
73
|
-
__metadata("design:type", variable_resolver_service_1.VariableResolverService)
|
|
74
|
-
], VariableQuickOpenService.prototype, "variableResolver", void 0);
|
|
75
|
-
VariableQuickOpenService = __decorate([
|
|
76
|
-
(0, inversify_1.injectable)(),
|
|
77
|
-
__param(0, (0, inversify_1.inject)(variable_1.VariableRegistry)),
|
|
78
|
-
__metadata("design:paramtypes", [variable_1.VariableRegistry])
|
|
79
|
-
], VariableQuickOpenService);
|
|
80
|
-
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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.VariableQuickOpenService = void 0;
|
|
31
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
|
+
const message_service_1 = require("@theia/core/lib/common/message-service");
|
|
33
|
+
const variable_1 = require("./variable");
|
|
34
|
+
const variable_resolver_service_1 = require("./variable-resolver-service");
|
|
35
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
36
|
+
let VariableQuickOpenService = class VariableQuickOpenService {
|
|
37
|
+
constructor(variableRegistry) {
|
|
38
|
+
this.variableRegistry = variableRegistry;
|
|
39
|
+
}
|
|
40
|
+
open() {
|
|
41
|
+
var _a;
|
|
42
|
+
this.items = this.variableRegistry.getVariables().map(v => ({
|
|
43
|
+
label: '${' + v.name + '}',
|
|
44
|
+
detail: v.description,
|
|
45
|
+
execute: () => {
|
|
46
|
+
setTimeout(() => this.showValue(v));
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
(_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(this.items, { placeholder: 'Registered variables' });
|
|
50
|
+
}
|
|
51
|
+
async showValue(variable) {
|
|
52
|
+
var _a;
|
|
53
|
+
const argument = await ((_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.input({
|
|
54
|
+
placeHolder: 'Type a variable argument'
|
|
55
|
+
}));
|
|
56
|
+
const value = await this.variableResolver.resolve('${' + variable.name + ':' + argument + '}');
|
|
57
|
+
if (typeof value === 'string') {
|
|
58
|
+
this.messages.info(value);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, inversify_1.inject)(message_service_1.MessageService),
|
|
64
|
+
__metadata("design:type", message_service_1.MessageService)
|
|
65
|
+
], VariableQuickOpenService.prototype, "messages", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, inversify_1.inject)(browser_1.QuickInputService),
|
|
68
|
+
(0, inversify_1.optional)(),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], VariableQuickOpenService.prototype, "quickInputService", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, inversify_1.inject)(variable_resolver_service_1.VariableResolverService),
|
|
73
|
+
__metadata("design:type", variable_resolver_service_1.VariableResolverService)
|
|
74
|
+
], VariableQuickOpenService.prototype, "variableResolver", void 0);
|
|
75
|
+
VariableQuickOpenService = __decorate([
|
|
76
|
+
(0, inversify_1.injectable)(),
|
|
77
|
+
__param(0, (0, inversify_1.inject)(variable_1.VariableRegistry)),
|
|
78
|
+
__metadata("design:paramtypes", [variable_1.VariableRegistry])
|
|
79
|
+
], VariableQuickOpenService);
|
|
80
|
+
exports.VariableQuickOpenService = VariableQuickOpenService;
|
|
81
81
|
//# 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
|