@codingame/monaco-vscode-configuration-service-override 37.2.0 → 37.3.1
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/common.d.ts +23 -0
- package/common.js +61 -0
- package/index.d.ts +3 -21
- package/index.js +21 -63
- package/package.json +11 -3
- package/session.d.ts +3 -0
- package/session.js +66 -0
- package/vscode/src/vs/sessions/contrib/configuration/browser/configuration.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/configuration/browser/configuration.contribution.js +13 -0
- package/vscode/src/vs/sessions/services/configuration/browser/configurationService.d.ts +73 -0
- package/vscode/src/vs/sessions/services/configuration/browser/configurationService.js +499 -0
- package/vscode/src/vs/sessions/services/workspace/browser/workspaceContextService.d.ts +39 -0
- package/vscode/src/vs/sessions/services/workspace/browser/workspaceContextService.js +152 -0
- package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.js +68 -68
- package/vscode/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.js +9 -9
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.js +17 -12
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +9 -9
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.js +43 -43
- package/vscode/src/vs/workbench/services/configuration/common/configurationModels.js +2 -2
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +8 -8
- package/vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +11 -11
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
|
|
2
|
+
import { Event, Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
|
+
import { Queue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { removeTrailingPathSeparator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
5
|
+
import { Workspace as Workspace$1, WorkbenchState, WorkspaceFolder } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
|
|
6
|
+
import { getWorkspaceIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspaces/common/workspaceIdentifier';
|
|
7
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
9
|
+
|
|
10
|
+
class SessionsWorkspaceContextService extends Disposable {
|
|
11
|
+
constructor(workspaceIdentifier, uriIdentityService) {
|
|
12
|
+
super();
|
|
13
|
+
this.uriIdentityService = uriIdentityService;
|
|
14
|
+
this.onDidChangeWorkbenchState = Event.None;
|
|
15
|
+
this.onDidChangeWorkspaceName = Event.None;
|
|
16
|
+
this.onDidEnterWorkspace = Event.None;
|
|
17
|
+
this._onWillChangeWorkspaceFolders = ( new Emitter());
|
|
18
|
+
this.onWillChangeWorkspaceFolders = this._onWillChangeWorkspaceFolders.event;
|
|
19
|
+
this._onDidChangeWorkspaceFolders = this._register(( new Emitter()));
|
|
20
|
+
this.onDidChangeWorkspaceFolders = this._onDidChangeWorkspaceFolders.event;
|
|
21
|
+
this._updateFoldersQueue = this._register(( new Queue()));
|
|
22
|
+
this.workspace = ( new Workspace$1(
|
|
23
|
+
workspaceIdentifier.id,
|
|
24
|
+
[],
|
|
25
|
+
false,
|
|
26
|
+
workspaceIdentifier.configPath,
|
|
27
|
+
uri => uriIdentityService.extUri.ignorePathCasing(uri),
|
|
28
|
+
( localize(4914, "Agents Window"))
|
|
29
|
+
));
|
|
30
|
+
}
|
|
31
|
+
getCompleteWorkspace() {
|
|
32
|
+
return Promise.resolve(this.workspace);
|
|
33
|
+
}
|
|
34
|
+
getWorkspace() {
|
|
35
|
+
return this.workspace;
|
|
36
|
+
}
|
|
37
|
+
getWorkbenchState() {
|
|
38
|
+
return WorkbenchState.WORKSPACE;
|
|
39
|
+
}
|
|
40
|
+
hasWorkspaceData() {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
getWorkspaceFolder(resource) {
|
|
44
|
+
return this.workspace.getFolder(resource);
|
|
45
|
+
}
|
|
46
|
+
isInsideWorkspace(resource) {
|
|
47
|
+
return !!this.getWorkspaceFolder(resource);
|
|
48
|
+
}
|
|
49
|
+
isCurrentWorkspace(workspaceIdOrFolder) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
addFolders(foldersToAdd) {
|
|
53
|
+
return this.doUpdateFolders(foldersToAdd, []);
|
|
54
|
+
}
|
|
55
|
+
removeFolders(foldersToRemove) {
|
|
56
|
+
return this.doUpdateFolders([], foldersToRemove);
|
|
57
|
+
}
|
|
58
|
+
async updateFolders(index, deleteCount, foldersToAddCandidates) {
|
|
59
|
+
const folders = this.workspace.folders;
|
|
60
|
+
let foldersToDelete = [];
|
|
61
|
+
if (typeof deleteCount === "number") {
|
|
62
|
+
foldersToDelete = folders.slice(index, index + deleteCount).map(folder => folder.uri);
|
|
63
|
+
}
|
|
64
|
+
let foldersToAdd = [];
|
|
65
|
+
if (Array.isArray(foldersToAddCandidates)) {
|
|
66
|
+
foldersToAdd = foldersToAddCandidates.map(folderToAdd => ({
|
|
67
|
+
uri: removeTrailingPathSeparator(folderToAdd.uri),
|
|
68
|
+
name: folderToAdd.name
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
return this.doUpdateFolders(foldersToAdd, foldersToDelete, index);
|
|
72
|
+
}
|
|
73
|
+
async enterWorkspace(_path) {}
|
|
74
|
+
async createAndEnterWorkspace(_folders, _path) {}
|
|
75
|
+
async saveAndEnterWorkspace(_path) {}
|
|
76
|
+
async copyWorkspaceSettings(_toWorkspace) {}
|
|
77
|
+
async pickNewWorkspacePath() {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
doUpdateFolders(foldersToAdd, foldersToRemove, index) {
|
|
81
|
+
return this._updateFoldersQueue.queue(() => this._doUpdateFolders(foldersToAdd, foldersToRemove, index));
|
|
82
|
+
}
|
|
83
|
+
async _doUpdateFolders(foldersToAdd, foldersToRemove, index) {
|
|
84
|
+
if (foldersToAdd.length === 0 && foldersToRemove.length === 0) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const currentFolders = this.workspace.folders;
|
|
88
|
+
let newFolders = currentFolders.filter(folder => !( foldersToRemove.some(toRemove => this.uriIdentityService.extUri.isEqual(folder.uri, toRemove))));
|
|
89
|
+
const foldersToAddWorkspaceFolders = foldersToAdd.filter(folderToAdd => !( newFolders.some(
|
|
90
|
+
existing => this.uriIdentityService.extUri.isEqual(existing.uri, folderToAdd.uri)
|
|
91
|
+
))).map(folderToAdd => ( new WorkspaceFolder({
|
|
92
|
+
uri: folderToAdd.uri,
|
|
93
|
+
name: folderToAdd.name || this.uriIdentityService.extUri.basenameOrAuthority(folderToAdd.uri),
|
|
94
|
+
index: 0
|
|
95
|
+
}, {
|
|
96
|
+
uri: ( folderToAdd.uri.toString())
|
|
97
|
+
})));
|
|
98
|
+
if (foldersToAddWorkspaceFolders.length > 0) {
|
|
99
|
+
if (typeof index === "number" && index >= 0 && index < newFolders.length) {
|
|
100
|
+
newFolders = [
|
|
101
|
+
...newFolders.slice(0, index),
|
|
102
|
+
...foldersToAddWorkspaceFolders,
|
|
103
|
+
...newFolders.slice(index)
|
|
104
|
+
];
|
|
105
|
+
} else {
|
|
106
|
+
newFolders = [...newFolders, ...foldersToAddWorkspaceFolders];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
newFolders = newFolders.map((f, i) => ( new WorkspaceFolder({
|
|
110
|
+
uri: f.uri,
|
|
111
|
+
name: f.name,
|
|
112
|
+
index: i
|
|
113
|
+
}, f.raw)));
|
|
114
|
+
const added = newFolders.filter(folder => !( currentFolders.some(
|
|
115
|
+
existing => this.uriIdentityService.extUri.isEqual(existing.uri, folder.uri)
|
|
116
|
+
)));
|
|
117
|
+
const removed = currentFolders.filter(folder => !( newFolders.some(
|
|
118
|
+
existing => this.uriIdentityService.extUri.isEqual(existing.uri, folder.uri)
|
|
119
|
+
)));
|
|
120
|
+
const changed = [];
|
|
121
|
+
const changes = {
|
|
122
|
+
added,
|
|
123
|
+
removed,
|
|
124
|
+
changed
|
|
125
|
+
};
|
|
126
|
+
if (added.length === 0 && removed.length === 0) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const joinPromises = [];
|
|
130
|
+
this._onWillChangeWorkspaceFolders.fire({
|
|
131
|
+
changes,
|
|
132
|
+
fromCache: false,
|
|
133
|
+
join(promise) {
|
|
134
|
+
joinPromises.push(promise);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
await Promise.allSettled(joinPromises);
|
|
138
|
+
const workspaceIdentifier = getWorkspaceIdentifier(this.workspace.configuration);
|
|
139
|
+
const workspace = ( new Workspace$1(
|
|
140
|
+
workspaceIdentifier.id,
|
|
141
|
+
newFolders,
|
|
142
|
+
false,
|
|
143
|
+
workspaceIdentifier.configPath,
|
|
144
|
+
uri => this.uriIdentityService.extUri.ignorePathCasing(uri),
|
|
145
|
+
this.workspace.name
|
|
146
|
+
));
|
|
147
|
+
this.workspace.update(workspace);
|
|
148
|
+
this._onDidChangeWorkspaceFolders.fire(changes);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export { SessionsWorkspaceContextService };
|
|
@@ -28,28 +28,28 @@ const configurationEntrySchema = {
|
|
|
28
28
|
properties: {
|
|
29
29
|
title: {
|
|
30
30
|
description: ( localize(
|
|
31
|
-
|
|
31
|
+
5082,
|
|
32
32
|
"A title for the current category of settings. This label will be rendered in the Settings editor as a subheading. If the title is the same as the extension display name, then the category will be grouped under the main extension heading."
|
|
33
33
|
)),
|
|
34
34
|
type: "string"
|
|
35
35
|
},
|
|
36
36
|
order: {
|
|
37
37
|
description: ( localize(
|
|
38
|
-
|
|
38
|
+
5083,
|
|
39
39
|
"When specified, gives the order of this category of settings relative to other categories."
|
|
40
40
|
)),
|
|
41
41
|
type: "integer"
|
|
42
42
|
},
|
|
43
43
|
properties: {
|
|
44
|
-
description: ( localize(
|
|
44
|
+
description: ( localize(5084, "Description of the configuration properties.")),
|
|
45
45
|
type: "object",
|
|
46
46
|
propertyNames: {
|
|
47
47
|
pattern: "\\S+",
|
|
48
|
-
patternErrorMessage: ( localize(
|
|
48
|
+
patternErrorMessage: ( localize(5085, "Property should not be empty."))
|
|
49
49
|
},
|
|
50
50
|
additionalProperties: {
|
|
51
51
|
anyOf: [{
|
|
52
|
-
title: ( localize(
|
|
52
|
+
title: ( localize(5086, "Schema of the configuration property.")),
|
|
53
53
|
$ref: "http://json-schema.org/draft-07/schema#"
|
|
54
54
|
}, {
|
|
55
55
|
type: "object",
|
|
@@ -65,24 +65,24 @@ const configurationEntrySchema = {
|
|
|
65
65
|
"machine-overridable"
|
|
66
66
|
],
|
|
67
67
|
default: "window",
|
|
68
|
-
enumDescriptions: [( localize(
|
|
69
|
-
|
|
68
|
+
enumDescriptions: [( localize(5087, "Configuration that can be configured only in the user settings.")), ( localize(
|
|
69
|
+
5088,
|
|
70
70
|
"Configuration that can be configured only in the user settings or only in the remote settings."
|
|
71
71
|
)), ( localize(
|
|
72
|
-
|
|
72
|
+
5089,
|
|
73
73
|
"Configuration that can be configured in the user, remote or workspace settings."
|
|
74
74
|
)), ( localize(
|
|
75
|
-
|
|
75
|
+
5090,
|
|
76
76
|
"Configuration that can be configured in the user, remote, workspace or folder settings."
|
|
77
77
|
)), ( localize(
|
|
78
|
-
|
|
78
|
+
5091,
|
|
79
79
|
"Resource configuration that can be configured in language specific settings."
|
|
80
80
|
)), ( localize(
|
|
81
|
-
|
|
81
|
+
5092,
|
|
82
82
|
"Machine configuration that can be configured also in workspace or folder settings."
|
|
83
83
|
))],
|
|
84
84
|
markdownDescription: ( localize(
|
|
85
|
-
|
|
85
|
+
5093,
|
|
86
86
|
"Scope in which the configuration is applicable. Available scopes are `application`, `machine`, `window`, `resource`, and `machine-overridable`."
|
|
87
87
|
))
|
|
88
88
|
},
|
|
@@ -91,14 +91,14 @@ const configurationEntrySchema = {
|
|
|
91
91
|
items: {
|
|
92
92
|
type: "string"
|
|
93
93
|
},
|
|
94
|
-
description: ( localize(
|
|
94
|
+
description: ( localize(5094, "Descriptions for enum values"))
|
|
95
95
|
},
|
|
96
96
|
markdownEnumDescriptions: {
|
|
97
97
|
type: "array",
|
|
98
98
|
items: {
|
|
99
99
|
type: "string"
|
|
100
100
|
},
|
|
101
|
-
description: ( localize(
|
|
101
|
+
description: ( localize(5095, "Descriptions for enum values in the markdown format."))
|
|
102
102
|
},
|
|
103
103
|
enumItemLabels: {
|
|
104
104
|
type: "array",
|
|
@@ -106,26 +106,26 @@ const configurationEntrySchema = {
|
|
|
106
106
|
type: "string"
|
|
107
107
|
},
|
|
108
108
|
markdownDescription: ( localize(
|
|
109
|
-
|
|
109
|
+
5096,
|
|
110
110
|
"Labels for enum values to be displayed in the Settings editor. When specified, the {0} values still show after the labels, but less prominently.",
|
|
111
111
|
"`enum`"
|
|
112
112
|
))
|
|
113
113
|
},
|
|
114
114
|
markdownDescription: {
|
|
115
115
|
type: "string",
|
|
116
|
-
description: ( localize(
|
|
116
|
+
description: ( localize(5097, "The description in the markdown format."))
|
|
117
117
|
},
|
|
118
118
|
deprecationMessage: {
|
|
119
119
|
type: "string",
|
|
120
120
|
description: ( localize(
|
|
121
|
-
|
|
121
|
+
5098,
|
|
122
122
|
"If set, the property is marked as deprecated and the given message is shown as an explanation."
|
|
123
123
|
))
|
|
124
124
|
},
|
|
125
125
|
markdownDeprecationMessage: {
|
|
126
126
|
type: "string",
|
|
127
127
|
description: ( localize(
|
|
128
|
-
|
|
128
|
+
5099,
|
|
129
129
|
"If set, the property is marked as deprecated and the given message is shown as an explanation in the markdown format."
|
|
130
130
|
))
|
|
131
131
|
},
|
|
@@ -133,33 +133,33 @@ const configurationEntrySchema = {
|
|
|
133
133
|
type: "string",
|
|
134
134
|
enum: ["warning", "info"],
|
|
135
135
|
enumDescriptions: [( localize(
|
|
136
|
-
|
|
136
|
+
5100,
|
|
137
137
|
"Shows the deprecation message using the standard warning treatment."
|
|
138
|
-
)), ( localize(
|
|
138
|
+
)), ( localize(5101, "Shows the deprecation message using an informational treatment."))],
|
|
139
139
|
default: "warning",
|
|
140
|
-
description: ( localize(
|
|
140
|
+
description: ( localize(5102, "Controls the severity used to display the deprecation message."))
|
|
141
141
|
},
|
|
142
142
|
editPresentation: {
|
|
143
143
|
type: "string",
|
|
144
144
|
enum: ["singlelineText", "multilineText"],
|
|
145
|
-
enumDescriptions: [( localize(
|
|
145
|
+
enumDescriptions: [( localize(5103, "The value will be shown in an inputbox.")), ( localize(5104, "The value will be shown in a textarea."))],
|
|
146
146
|
default: "singlelineText",
|
|
147
147
|
description: ( localize(
|
|
148
|
-
|
|
148
|
+
5105,
|
|
149
149
|
"When specified, controls the presentation format of the string setting."
|
|
150
150
|
))
|
|
151
151
|
},
|
|
152
152
|
order: {
|
|
153
153
|
type: "integer",
|
|
154
154
|
description: ( localize(
|
|
155
|
-
|
|
155
|
+
5106,
|
|
156
156
|
"When specified, gives the order of this setting relative to other settings within the same category. Settings with an order property will be placed before settings without this property set."
|
|
157
157
|
))
|
|
158
158
|
},
|
|
159
159
|
ignoreSync: {
|
|
160
160
|
type: "boolean",
|
|
161
161
|
description: ( localize(
|
|
162
|
-
|
|
162
|
+
5107,
|
|
163
163
|
"When enabled, Settings Sync will not sync the user value of this configuration by default."
|
|
164
164
|
))
|
|
165
165
|
},
|
|
@@ -169,7 +169,7 @@ const configurationEntrySchema = {
|
|
|
169
169
|
type: "string"
|
|
170
170
|
},
|
|
171
171
|
description: ( localize(
|
|
172
|
-
|
|
172
|
+
5108,
|
|
173
173
|
"A list of keywords that help users find this setting in the Settings editor. These are not shown to the user."
|
|
174
174
|
))
|
|
175
175
|
},
|
|
@@ -184,37 +184,37 @@ const configurationEntrySchema = {
|
|
|
184
184
|
"telemetry",
|
|
185
185
|
"usesOnlineServices"
|
|
186
186
|
],
|
|
187
|
-
enumDescriptions: [( localize(
|
|
188
|
-
|
|
187
|
+
enumDescriptions: [( localize(5109, "Accessibility settings")), ( localize(
|
|
188
|
+
5110,
|
|
189
189
|
"Advanced settings are hidden by default in the Settings editor unless the user chooses to show advanced settings."
|
|
190
190
|
)), ( localize(
|
|
191
|
-
|
|
191
|
+
5111,
|
|
192
192
|
"Experimental settings are subject to change and may be removed in future releases."
|
|
193
193
|
)), ( localize(
|
|
194
|
-
|
|
194
|
+
5112,
|
|
195
195
|
"Preview settings can be used to try out new features before they are finalized."
|
|
196
|
-
)), ( localize(
|
|
196
|
+
)), ( localize(5113, "Telemetry settings")), ( localize(5114, "Settings that use online services"))]
|
|
197
197
|
},
|
|
198
198
|
additionalItems: true,
|
|
199
199
|
markdownDescription: ( localize(
|
|
200
|
-
|
|
200
|
+
5115,
|
|
201
201
|
"A list of tags under which to place the setting. The tag can then be searched up in the Settings editor. For example, specifying the `experimental` tag allows one to find the setting by searching `@tag:experimental`."
|
|
202
202
|
))
|
|
203
203
|
},
|
|
204
204
|
agentsWindow: {
|
|
205
205
|
type: "object",
|
|
206
206
|
markdownDescription: ( localize(
|
|
207
|
-
|
|
207
|
+
5116,
|
|
208
208
|
"Configuration overrides for the Agents window. Allows specifying a different default value and read-only behavior for this setting when running in the Agents window.\n\n**Note**: This is a proposed API. To use it, extensions must include `agentsWindowConfiguration` in their `enabledApiProposals`."
|
|
209
209
|
)),
|
|
210
210
|
properties: {
|
|
211
211
|
"default": {
|
|
212
|
-
description: ( localize(
|
|
212
|
+
description: ( localize(5117, "The default value for this setting in the Agents window."))
|
|
213
213
|
},
|
|
214
214
|
readOnly: {
|
|
215
215
|
type: "boolean",
|
|
216
216
|
description: ( localize(
|
|
217
|
-
|
|
217
|
+
5118,
|
|
218
218
|
"When true, this setting cannot be changed by the user in the Agents window."
|
|
219
219
|
)),
|
|
220
220
|
default: false
|
|
@@ -254,13 +254,13 @@ defaultConfigurationExtPoint.setHandler((
|
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
256
|
if (removed.length) {
|
|
257
|
-
const removedDefaultConfigurations =
|
|
257
|
+
const removedDefaultConfigurations = removed.map(extension => ({
|
|
258
258
|
overrides: deepClone(extension.value),
|
|
259
259
|
source: {
|
|
260
260
|
id: extension.description.identifier.value,
|
|
261
261
|
displayName: extension.description.displayName
|
|
262
262
|
}
|
|
263
|
-
}))
|
|
263
|
+
}));
|
|
264
264
|
_configDelta.removedDefaults = removedDefaultConfigurations;
|
|
265
265
|
}
|
|
266
266
|
if (added.length) {
|
|
@@ -271,13 +271,13 @@ defaultConfigurationExtPoint.setHandler((
|
|
|
271
271
|
ConfigurationScope.RESOURCE,
|
|
272
272
|
ConfigurationScope.LANGUAGE_OVERRIDABLE
|
|
273
273
|
];
|
|
274
|
-
const addedDefaultConfigurations =
|
|
274
|
+
const addedDefaultConfigurations = added.map(extension => {
|
|
275
275
|
const overrides = deepClone(extension.value);
|
|
276
276
|
for (const key of ( Object.keys(overrides))) {
|
|
277
277
|
const registeredPropertyScheme = registeredProperties[key];
|
|
278
278
|
if (registeredPropertyScheme?.disallowConfigurationDefault) {
|
|
279
279
|
extension.collector.warn(( localize(
|
|
280
|
-
|
|
280
|
+
5119,
|
|
281
281
|
"Cannot register configuration defaults for '{0}'. This setting does not allow contributing configuration defaults.",
|
|
282
282
|
key
|
|
283
283
|
)));
|
|
@@ -287,7 +287,7 @@ defaultConfigurationExtPoint.setHandler((
|
|
|
287
287
|
if (!OVERRIDE_PROPERTY_REGEX.test(key)) {
|
|
288
288
|
if (registeredPropertyScheme?.scope && !allowedScopes.includes(registeredPropertyScheme.scope)) {
|
|
289
289
|
extension.collector.warn(( localize(
|
|
290
|
-
|
|
290
|
+
5120,
|
|
291
291
|
"Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",
|
|
292
292
|
key
|
|
293
293
|
)));
|
|
@@ -303,7 +303,7 @@ defaultConfigurationExtPoint.setHandler((
|
|
|
303
303
|
displayName: extension.description.displayName
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
})
|
|
306
|
+
});
|
|
307
307
|
_configDelta.addedDefaults = addedDefaultConfigurations;
|
|
308
308
|
}
|
|
309
309
|
});
|
|
@@ -311,7 +311,7 @@ const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
311
311
|
extensionPoint: "configuration",
|
|
312
312
|
deps: [defaultConfigurationExtPoint],
|
|
313
313
|
jsonSchema: {
|
|
314
|
-
description: ( localize(
|
|
314
|
+
description: ( localize(5121, "Contributes configuration settings.")),
|
|
315
315
|
oneOf: [configurationEntrySchema, {
|
|
316
316
|
type: "array",
|
|
317
317
|
items: configurationEntrySchema
|
|
@@ -340,7 +340,7 @@ configurationExtPoint.setHandler((
|
|
|
340
340
|
function handleConfiguration(node, extension) {
|
|
341
341
|
const configuration = deepClone(node);
|
|
342
342
|
if (configuration.title && (typeof configuration.title !== "string")) {
|
|
343
|
-
extension.collector.error(( localize(
|
|
343
|
+
extension.collector.error(( localize(5122, "'configuration.title' must be a string")));
|
|
344
344
|
}
|
|
345
345
|
validateProperties(configuration, extension);
|
|
346
346
|
configuration.id = node.id || extension.description.identifier.value;
|
|
@@ -357,7 +357,7 @@ configurationExtPoint.setHandler((
|
|
|
357
357
|
const extensionConfigurationPolicy = product.extensionConfigurationPolicy;
|
|
358
358
|
if (properties) {
|
|
359
359
|
if (typeof properties !== "object") {
|
|
360
|
-
extension.collector.error(( localize(
|
|
360
|
+
extension.collector.error(( localize(5123, "'configuration.properties' must be an object")));
|
|
361
361
|
configuration.properties = {};
|
|
362
362
|
}
|
|
363
363
|
for (const key in properties) {
|
|
@@ -370,12 +370,12 @@ configurationExtPoint.setHandler((
|
|
|
370
370
|
}
|
|
371
371
|
if (( seenProperties.has(key)) && !( EXTENSION_UNIFICATION_EXTENSION_IDS.has(extension.description.identifier.value.toLowerCase()))) {
|
|
372
372
|
delete properties[key];
|
|
373
|
-
extension.collector.warn(( localize(
|
|
373
|
+
extension.collector.warn(( localize(5124, "Cannot register '{0}'. This property is already registered.", key)));
|
|
374
374
|
continue;
|
|
375
375
|
}
|
|
376
376
|
if (!isObject(propertyConfiguration)) {
|
|
377
377
|
delete properties[key];
|
|
378
|
-
extension.collector.error(( localize(
|
|
378
|
+
extension.collector.error(( localize(5125, "configuration.properties property '{0}' must be an object", key)));
|
|
379
379
|
continue;
|
|
380
380
|
}
|
|
381
381
|
const policyEntry = extensionConfigurationPolicy?.[key];
|
|
@@ -395,7 +395,7 @@ configurationExtPoint.setHandler((
|
|
|
395
395
|
}
|
|
396
396
|
if (propertyConfiguration.agentsWindow && !isProposedApiEnabled(extension.description, "agentsWindowConfiguration")) {
|
|
397
397
|
extension.collector.error(( localize(
|
|
398
|
-
|
|
398
|
+
5126,
|
|
399
399
|
"Extension '{0}' CANNOT use 'agentsWindow' property on configuration '{1}' without enabling the 'agentsWindowConfiguration' API proposal.",
|
|
400
400
|
extension.description.identifier.value,
|
|
401
401
|
key
|
|
@@ -404,7 +404,7 @@ configurationExtPoint.setHandler((
|
|
|
404
404
|
}
|
|
405
405
|
if (propertyConfiguration.agentHost) {
|
|
406
406
|
extension.collector.error(( localize(
|
|
407
|
-
|
|
407
|
+
5127,
|
|
408
408
|
"Extension '{0}' CANNOT use the 'agentHost' property on configuration '{1}'.",
|
|
409
409
|
extension.description.identifier.value,
|
|
410
410
|
key
|
|
@@ -418,7 +418,7 @@ configurationExtPoint.setHandler((
|
|
|
418
418
|
const subNodes = configuration.allOf;
|
|
419
419
|
if (subNodes) {
|
|
420
420
|
extension.collector.error(( localize(
|
|
421
|
-
|
|
421
|
+
5128,
|
|
422
422
|
"'configuration.allOf' is deprecated and should no longer be used. Instead, pass multiple configuration sections as an array to the 'configuration' contribution point."
|
|
423
423
|
)));
|
|
424
424
|
for (const node of subNodes) {
|
|
@@ -458,7 +458,7 @@ jsonRegistry.registerSchema("vscode://schemas/workspaceConfig", {
|
|
|
458
458
|
"folders": {
|
|
459
459
|
minItems: 0,
|
|
460
460
|
uniqueItems: true,
|
|
461
|
-
description: ( localize(
|
|
461
|
+
description: ( localize(5129, "List of folders to be loaded in the workspace.")),
|
|
462
462
|
items: {
|
|
463
463
|
type: "object",
|
|
464
464
|
defaultSnippets: [{
|
|
@@ -471,13 +471,13 @@ jsonRegistry.registerSchema("vscode://schemas/workspaceConfig", {
|
|
|
471
471
|
path: {
|
|
472
472
|
type: "string",
|
|
473
473
|
description: ( localize(
|
|
474
|
-
|
|
474
|
+
5130,
|
|
475
475
|
"A file path. e.g. `/root/folderA` or `./folderA` for a relative path that will be resolved against the location of the workspace file."
|
|
476
476
|
))
|
|
477
477
|
},
|
|
478
478
|
name: {
|
|
479
479
|
type: "string",
|
|
480
|
-
description: ( localize(
|
|
480
|
+
description: ( localize(5131, "An optional name for the folder. "))
|
|
481
481
|
}
|
|
482
482
|
},
|
|
483
483
|
required: ["path"]
|
|
@@ -485,11 +485,11 @@ jsonRegistry.registerSchema("vscode://schemas/workspaceConfig", {
|
|
|
485
485
|
properties: {
|
|
486
486
|
uri: {
|
|
487
487
|
type: "string",
|
|
488
|
-
description: ( localize(
|
|
488
|
+
description: ( localize(5132, "URI of the folder"))
|
|
489
489
|
},
|
|
490
490
|
name: {
|
|
491
491
|
type: "string",
|
|
492
|
-
description: ( localize(
|
|
492
|
+
description: ( localize(5131, "An optional name for the folder. "))
|
|
493
493
|
}
|
|
494
494
|
},
|
|
495
495
|
required: ["uri"]
|
|
@@ -499,7 +499,7 @@ jsonRegistry.registerSchema("vscode://schemas/workspaceConfig", {
|
|
|
499
499
|
"settings": {
|
|
500
500
|
type: "object",
|
|
501
501
|
default: {},
|
|
502
|
-
description: ( localize(
|
|
502
|
+
description: ( localize(5133, "Workspace settings")),
|
|
503
503
|
allOf: [{
|
|
504
504
|
$ref: workspaceSettingsSchemaId
|
|
505
505
|
}, {
|
|
@@ -515,7 +515,7 @@ jsonRegistry.registerSchema("vscode://schemas/workspaceConfig", {
|
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
},
|
|
518
|
-
description: ( localize(
|
|
518
|
+
description: ( localize(5134, "Model Context Protocol server configurations")),
|
|
519
519
|
$ref: mcpSchemaId
|
|
520
520
|
}
|
|
521
521
|
}
|
|
@@ -527,7 +527,7 @@ jsonRegistry.registerSchema("vscode://schemas/workspaceConfig", {
|
|
|
527
527
|
configurations: [],
|
|
528
528
|
compounds: []
|
|
529
529
|
},
|
|
530
|
-
description: ( localize(
|
|
530
|
+
description: ( localize(5135, "Workspace launch configurations")),
|
|
531
531
|
$ref: launchSchemaId
|
|
532
532
|
},
|
|
533
533
|
"tasks": {
|
|
@@ -536,27 +536,27 @@ jsonRegistry.registerSchema("vscode://schemas/workspaceConfig", {
|
|
|
536
536
|
version: "2.0.0",
|
|
537
537
|
tasks: []
|
|
538
538
|
},
|
|
539
|
-
description: ( localize(
|
|
539
|
+
description: ( localize(5136, "Workspace task configurations")),
|
|
540
540
|
$ref: tasksSchemaId
|
|
541
541
|
},
|
|
542
542
|
"extensions": {
|
|
543
543
|
type: "object",
|
|
544
544
|
default: {},
|
|
545
|
-
description: ( localize(
|
|
545
|
+
description: ( localize(5137, "Workspace extensions")),
|
|
546
546
|
$ref: "vscode://schemas/extensions"
|
|
547
547
|
},
|
|
548
548
|
"remoteAuthority": {
|
|
549
549
|
type: "string",
|
|
550
550
|
doNotSuggest: true,
|
|
551
|
-
description: ( localize(
|
|
551
|
+
description: ( localize(5138, "The remote server where the workspace is located."))
|
|
552
552
|
},
|
|
553
553
|
"transient": {
|
|
554
554
|
type: "boolean",
|
|
555
555
|
doNotSuggest: true,
|
|
556
|
-
description: ( localize(
|
|
556
|
+
description: ( localize(5139, "A transient workspace will disappear when restarting or reloading."))
|
|
557
557
|
}
|
|
558
558
|
},
|
|
559
|
-
errorMessage: ( localize(
|
|
559
|
+
errorMessage: ( localize(5140, "Unknown workspace configuration property"))
|
|
560
560
|
});
|
|
561
561
|
class SettingsTableRenderer extends Disposable {
|
|
562
562
|
constructor() {
|
|
@@ -570,14 +570,14 @@ class SettingsTableRenderer extends Disposable {
|
|
|
570
570
|
const configuration = manifest.contributes?.configuration ? Array.isArray(manifest.contributes.configuration) ? manifest.contributes.configuration : [manifest.contributes.configuration] : [];
|
|
571
571
|
const properties = getAllConfigurationProperties(configuration);
|
|
572
572
|
const contrib = properties ? ( Object.keys(properties)) : [];
|
|
573
|
-
const headers = [( localize(
|
|
574
|
-
const rows =
|
|
573
|
+
const headers = [( localize(5141, "ID")), ( localize(5142, "Description")), ( localize(5143, "Default"))];
|
|
574
|
+
const rows = contrib.sort((a, b) => a.localeCompare(b)).map(key => {
|
|
575
575
|
return [( new MarkdownString()).appendMarkdown(`\`${key}\``), properties[key].markdownDescription ? ( new MarkdownString(properties[key].markdownDescription, false)) : properties[key].description ?? "", ( new MarkdownString()).appendCodeblock("json", JSON.stringify(
|
|
576
576
|
isUndefined(properties[key].default) ? getDefaultValue(properties[key].type) : properties[key].default,
|
|
577
577
|
null,
|
|
578
578
|
2
|
|
579
579
|
))];
|
|
580
|
-
})
|
|
580
|
+
});
|
|
581
581
|
return {
|
|
582
582
|
data: {
|
|
583
583
|
headers,
|
|
@@ -589,7 +589,7 @@ class SettingsTableRenderer extends Disposable {
|
|
|
589
589
|
}
|
|
590
590
|
( Registry.as(Extensions$2.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
591
591
|
id: "configuration",
|
|
592
|
-
label: ( localize(
|
|
592
|
+
label: ( localize(5144, "Settings")),
|
|
593
593
|
access: {
|
|
594
594
|
canToggle: false
|
|
595
595
|
},
|
|
@@ -605,7 +605,7 @@ class ConfigurationDefaultsTableRenderer extends Disposable {
|
|
|
605
605
|
}
|
|
606
606
|
render(manifest) {
|
|
607
607
|
const configurationDefaults = manifest.contributes?.configurationDefaults ?? {};
|
|
608
|
-
const headers = [( localize(
|
|
608
|
+
const headers = [( localize(5145, "Languages")), ( localize(5146, "Setting")), ( localize(5147, "Override Value"))];
|
|
609
609
|
const rows = [];
|
|
610
610
|
for (const key of ( Object.keys(configurationDefaults)).sort((a, b) => a.localeCompare(b))) {
|
|
611
611
|
const value = configurationDefaults[key];
|
|
@@ -638,7 +638,7 @@ class ConfigurationDefaultsTableRenderer extends Disposable {
|
|
|
638
638
|
}
|
|
639
639
|
( Registry.as(Extensions$2.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
640
640
|
id: "configurationDefaults",
|
|
641
|
-
label: ( localize(
|
|
641
|
+
label: ( localize(5148, "Settings Default Overrides")),
|
|
642
642
|
access: {
|
|
643
643
|
canToggle: false
|
|
644
644
|
},
|