Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as nls from '../../../../nls.js';
7
import { IJSONSchema } from '../../../../base/common/jsonSchema.js';
8
9
const idDescription = nls.localize('JsonSchema.input.id', "The input's id is used to associate an input with a variable of the form ${input:id}.");
10
const typeDescription = nls.localize('JsonSchema.input.type', "The type of user input prompt to use.");
11
const descriptionDescription = nls.localize('JsonSchema.input.description', "The description is shown when the user is prompted for input.");
12
const defaultDescription = nls.localize('JsonSchema.input.default', "The default value for the input.");
13
14
15
export const inputsSchema: IJSONSchema = {
16
definitions: {
17
inputs: {
18
type: 'array',
19
description: nls.localize('JsonSchema.inputs', 'User inputs. Used for defining user input prompts, such as free string input or a choice from several options.'),
20
items: {
21
oneOf: [
22
{
23
type: 'object',
24
required: ['id', 'type', 'description'],
25
additionalProperties: false,
26
properties: {
27
id: {
28
type: 'string',
29
description: idDescription
30
},
31
type: {
32
type: 'string',
33
description: typeDescription,
34
enum: ['promptString'],
35
enumDescriptions: [
36
nls.localize('JsonSchema.input.type.promptString', "The 'promptString' type opens an input box to ask the user for input."),
37
]
38
},
39
description: {
40
type: 'string',
41
description: descriptionDescription
42
},
43
default: {
44
type: 'string',
45
description: defaultDescription
46
},
47
password: {
48
type: 'boolean',
49
description: nls.localize('JsonSchema.input.password', "Controls if a password input is shown. Password input hides the typed text."),
50
},
51
}
52
},
53
{
54
type: 'object',
55
required: ['id', 'type', 'description', 'options'],
56
additionalProperties: false,
57
properties: {
58
id: {
59
type: 'string',
60
description: idDescription
61
},
62
type: {
63
type: 'string',
64
description: typeDescription,
65
enum: ['pickString'],
66
enumDescriptions: [
67
nls.localize('JsonSchema.input.type.pickString', "The 'pickString' type shows a selection list."),
68
]
69
},
70
description: {
71
type: 'string',
72
description: descriptionDescription
73
},
74
default: {
75
type: 'string',
76
description: defaultDescription
77
},
78
options: {
79
type: 'array',
80
description: nls.localize('JsonSchema.input.options', "An array of strings that defines the options for a quick pick."),
81
items: {
82
oneOf: [
83
{
84
type: 'string'
85
},
86
{
87
type: 'object',
88
required: ['value'],
89
additionalProperties: false,
90
properties: {
91
label: {
92
type: 'string',
93
description: nls.localize('JsonSchema.input.pickString.optionLabel', "Label for the option.")
94
},
95
value: {
96
type: 'string',
97
description: nls.localize('JsonSchema.input.pickString.optionValue', "Value for the option.")
98
}
99
}
100
}
101
]
102
}
103
}
104
}
105
},
106
{
107
type: 'object',
108
required: ['id', 'type', 'command'],
109
additionalProperties: false,
110
properties: {
111
id: {
112
type: 'string',
113
description: idDescription
114
},
115
type: {
116
type: 'string',
117
description: typeDescription,
118
enum: ['command'],
119
enumDescriptions: [
120
nls.localize('JsonSchema.input.type.command', "The 'command' type executes a command."),
121
]
122
},
123
command: {
124
type: 'string',
125
description: nls.localize('JsonSchema.input.command.command', "The command to execute for this input variable.")
126
},
127
args: {
128
oneOf: [
129
{
130
type: 'object',
131
description: nls.localize('JsonSchema.input.command.args', "Optional arguments passed to the command.")
132
},
133
{
134
type: 'array',
135
description: nls.localize('JsonSchema.input.command.args', "Optional arguments passed to the command.")
136
},
137
{
138
type: 'string',
139
description: nls.localize('JsonSchema.input.command.args', "Optional arguments passed to the command.")
140
}
141
]
142
}
143
}
144
}
145
]
146
}
147
}
148
}
149
};
150
151