@codingame/monaco-vscode-api 1.85.1 → 1.85.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.
- package/README.md +14 -5
- package/missing-services.js +305 -63
- package/monaco-editor-treemending.patch +946 -946
- package/package.json +8 -7
- package/service-override/tools/editor.js +1 -1
- package/services.js +10 -6
- package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +14 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +140 -0
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1062 -93
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +220 -0
- package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +102 -0
- package/vscode/src/vs/platform/userDataSync/common/content.js +9 -0
- package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +514 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +154 -2
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +43 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +177 -0
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostWebview.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +105 -0
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +1614 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +7 -7
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +73 -2
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +6 -6
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +12 -2
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +712 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +130 -0
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +20 -1
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +205 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +11 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +9 -9
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +2 -2
- package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.js +24 -1
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +41 -0
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +588 -0
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +43 -0
- package/vscode/src/vs/workbench/services/search/common/search.js +3 -3
- package/vscode/src/vs/workbench/services/terminal/common/embedderTerminalService.js +75 -1
- package/vscode/src/vs/workbench/services/timer/browser/timerService.js +240 -1
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +31 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +25 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +75 -1
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +74 -4
- package/vscode/src/vs/base/parts/request/browser/request.js +0 -60
- package/vscode/src/vs/platform/request/browser/requestService.js +0 -28
- package/vscode/src/vs/platform/request/common/requestIpc.js +0 -17
- package/vscode/src/vs/platform/url/common/urlService.js +0 -17
- package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +0 -120
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +0 -319
- package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +0 -9
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +0 -408
- package/vscode/src/vs/workbench/services/request/browser/requestService.js +0 -48
- package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +0 -56
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +0 -639
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +0 -402
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +0 -62
- package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +0 -38
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -295
- package/vscode/src/vs/workbench/services/url/browser/urlService.js +0 -47
- package/vscode/src/vs/workbench/services/views/common/treeViewsService.js +0 -20
- package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +0 -19
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { coalesce, distinct } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
4
|
+
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
5
|
+
import { Language } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
6
|
+
import { or, matchesPrefix, matchesWords, matchesContiguousSubString, matchesCamelCase } from 'monaco-editor/esm/vs/base/common/filters.js';
|
|
7
|
+
import { UILabelProvider, AriaLabelProvider, UserSettingsLabelProvider } from 'monaco-editor/esm/vs/base/common/keybindingLabels.js';
|
|
8
|
+
import { MenuRegistry } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
9
|
+
import { EditorModel } from '../../../common/editor/editorModel.js';
|
|
10
|
+
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
11
|
+
import { ResolvedKeybindingItem } from 'monaco-editor/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js';
|
|
12
|
+
import { getAllUnboundCommands } from '../../keybinding/browser/unboundCommands.js';
|
|
13
|
+
import { isString, isEmptyObject } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
14
|
+
import { IExtensionService } from '../../extensions/common/extensions.js';
|
|
15
|
+
import { ExtensionIdentifier, ExtensionIdentifierMap } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
|
|
16
|
+
var KeybindingsEditorModel_1;
|
|
17
|
+
const KEYBINDING_ENTRY_TEMPLATE_ID = 'keybinding.entry.template';
|
|
18
|
+
const SOURCE_SYSTEM = ( localizeWithPath(
|
|
19
|
+
'vs/workbench/services/preferences/browser/keybindingsEditorModel',
|
|
20
|
+
'default',
|
|
21
|
+
"System"
|
|
22
|
+
));
|
|
23
|
+
const SOURCE_EXTENSION = ( localizeWithPath(
|
|
24
|
+
'vs/workbench/services/preferences/browser/keybindingsEditorModel',
|
|
25
|
+
'extension',
|
|
26
|
+
"Extension"
|
|
27
|
+
));
|
|
28
|
+
const SOURCE_USER = ( localizeWithPath(
|
|
29
|
+
'vs/workbench/services/preferences/browser/keybindingsEditorModel',
|
|
30
|
+
'user',
|
|
31
|
+
"User"
|
|
32
|
+
));
|
|
33
|
+
const wordFilter = or(matchesPrefix, matchesWords, matchesContiguousSubString);
|
|
34
|
+
const SOURCE_REGEX = /@source:\s*(user|default|system|extension)/i;
|
|
35
|
+
const EXTENSION_REGEX = /@ext:\s*((".+")|([^\s]+))/i;
|
|
36
|
+
let KeybindingsEditorModel = KeybindingsEditorModel_1 = class KeybindingsEditorModel extends EditorModel {
|
|
37
|
+
constructor(os, keybindingsService, extensionService) {
|
|
38
|
+
super();
|
|
39
|
+
this.keybindingsService = keybindingsService;
|
|
40
|
+
this.extensionService = extensionService;
|
|
41
|
+
this._keybindingItems = [];
|
|
42
|
+
this._keybindingItemsSortedByPrecedence = [];
|
|
43
|
+
this.modifierLabels = {
|
|
44
|
+
ui: UILabelProvider.modifierLabels[os],
|
|
45
|
+
aria: AriaLabelProvider.modifierLabels[os],
|
|
46
|
+
user: UserSettingsLabelProvider.modifierLabels[os]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
fetch(searchValue, sortByPrecedence = false) {
|
|
50
|
+
let keybindingItems = sortByPrecedence ? this._keybindingItemsSortedByPrecedence : this._keybindingItems;
|
|
51
|
+
const commandIdMatches = /@command:\s*(.+)/i.exec(searchValue);
|
|
52
|
+
if (commandIdMatches && commandIdMatches[1]) {
|
|
53
|
+
return ( keybindingItems.filter(k => k.command === commandIdMatches[1])
|
|
54
|
+
.map(
|
|
55
|
+
keybindingItem => ({ id: KeybindingsEditorModel_1.getId(keybindingItem), keybindingItem, templateId: KEYBINDING_ENTRY_TEMPLATE_ID })
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
if (SOURCE_REGEX.test(searchValue)) {
|
|
59
|
+
keybindingItems = this.filterBySource(keybindingItems, searchValue);
|
|
60
|
+
searchValue = searchValue.replace(SOURCE_REGEX, '');
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const extensionMatches = EXTENSION_REGEX.exec(searchValue);
|
|
64
|
+
if (extensionMatches && (extensionMatches[2] || extensionMatches[3])) {
|
|
65
|
+
const extensionId = extensionMatches[2] ? extensionMatches[2].substring(1, extensionMatches[2].length - 1) : extensionMatches[3];
|
|
66
|
+
keybindingItems = this.filterByExtension(keybindingItems, extensionId);
|
|
67
|
+
searchValue = searchValue.replace(EXTENSION_REGEX, '');
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const keybindingMatches = /@keybinding:\s*((\".+\")|(\S+))/i.exec(searchValue);
|
|
71
|
+
if (keybindingMatches && (keybindingMatches[2] || keybindingMatches[3])) {
|
|
72
|
+
searchValue = keybindingMatches[2] || `"${keybindingMatches[3]}"`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
searchValue = searchValue.trim();
|
|
77
|
+
if (!searchValue) {
|
|
78
|
+
return ( keybindingItems.map(
|
|
79
|
+
keybindingItem => ({ id: KeybindingsEditorModel_1.getId(keybindingItem), keybindingItem, templateId: KEYBINDING_ENTRY_TEMPLATE_ID })
|
|
80
|
+
));
|
|
81
|
+
}
|
|
82
|
+
return this.filterByText(keybindingItems, searchValue);
|
|
83
|
+
}
|
|
84
|
+
filterBySource(keybindingItems, searchValue) {
|
|
85
|
+
if (/@source:\s*default/i.test(searchValue) || /@source:\s*system/i.test(searchValue)) {
|
|
86
|
+
return keybindingItems.filter(k => k.source === SOURCE_SYSTEM);
|
|
87
|
+
}
|
|
88
|
+
if (/@source:\s*user/i.test(searchValue)) {
|
|
89
|
+
return keybindingItems.filter(k => k.source === SOURCE_USER);
|
|
90
|
+
}
|
|
91
|
+
if (/@source:\s*extension/i.test(searchValue)) {
|
|
92
|
+
return keybindingItems.filter(k => !isString(k.source) || k.source === SOURCE_EXTENSION);
|
|
93
|
+
}
|
|
94
|
+
return keybindingItems;
|
|
95
|
+
}
|
|
96
|
+
filterByExtension(keybindingItems, extension) {
|
|
97
|
+
extension = extension.toLowerCase().trim();
|
|
98
|
+
return keybindingItems.filter(k => !isString(k.source) && (ExtensionIdentifier.equals(k.source.identifier, extension) || k.source.displayName?.toLowerCase() === extension.toLowerCase()));
|
|
99
|
+
}
|
|
100
|
+
filterByText(keybindingItems, searchValue) {
|
|
101
|
+
const quoteAtFirstChar = searchValue.charAt(0) === '"';
|
|
102
|
+
const quoteAtLastChar = searchValue.charAt(searchValue.length - 1) === '"';
|
|
103
|
+
const completeMatch = quoteAtFirstChar && quoteAtLastChar;
|
|
104
|
+
if (quoteAtFirstChar) {
|
|
105
|
+
searchValue = searchValue.substring(1);
|
|
106
|
+
}
|
|
107
|
+
if (quoteAtLastChar) {
|
|
108
|
+
searchValue = searchValue.substring(0, searchValue.length - 1);
|
|
109
|
+
}
|
|
110
|
+
searchValue = searchValue.trim();
|
|
111
|
+
const result = [];
|
|
112
|
+
const words = searchValue.split(' ');
|
|
113
|
+
const keybindingWords = this.splitKeybindingWords(words);
|
|
114
|
+
for (const keybindingItem of keybindingItems) {
|
|
115
|
+
const keybindingMatches = ( new KeybindingItemMatches(
|
|
116
|
+
this.modifierLabels,
|
|
117
|
+
keybindingItem,
|
|
118
|
+
searchValue,
|
|
119
|
+
words,
|
|
120
|
+
keybindingWords,
|
|
121
|
+
completeMatch
|
|
122
|
+
));
|
|
123
|
+
if (keybindingMatches.commandIdMatches
|
|
124
|
+
|| keybindingMatches.commandLabelMatches
|
|
125
|
+
|| keybindingMatches.commandDefaultLabelMatches
|
|
126
|
+
|| keybindingMatches.sourceMatches
|
|
127
|
+
|| keybindingMatches.whenMatches
|
|
128
|
+
|| keybindingMatches.keybindingMatches
|
|
129
|
+
|| keybindingMatches.extensionIdMatches
|
|
130
|
+
|| keybindingMatches.extensionLabelMatches) {
|
|
131
|
+
result.push({
|
|
132
|
+
id: KeybindingsEditorModel_1.getId(keybindingItem),
|
|
133
|
+
templateId: KEYBINDING_ENTRY_TEMPLATE_ID,
|
|
134
|
+
commandLabelMatches: keybindingMatches.commandLabelMatches || undefined,
|
|
135
|
+
commandDefaultLabelMatches: keybindingMatches.commandDefaultLabelMatches || undefined,
|
|
136
|
+
keybindingItem,
|
|
137
|
+
keybindingMatches: keybindingMatches.keybindingMatches || undefined,
|
|
138
|
+
commandIdMatches: keybindingMatches.commandIdMatches || undefined,
|
|
139
|
+
sourceMatches: keybindingMatches.sourceMatches || undefined,
|
|
140
|
+
whenMatches: keybindingMatches.whenMatches || undefined,
|
|
141
|
+
extensionIdMatches: keybindingMatches.extensionIdMatches || undefined,
|
|
142
|
+
extensionLabelMatches: keybindingMatches.extensionLabelMatches || undefined
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
splitKeybindingWords(wordsSeparatedBySpaces) {
|
|
149
|
+
const result = [];
|
|
150
|
+
for (const word of wordsSeparatedBySpaces) {
|
|
151
|
+
result.push(...coalesce(word.split('+')));
|
|
152
|
+
}
|
|
153
|
+
return result;
|
|
154
|
+
}
|
|
155
|
+
async resolve(actionLabels = ( new Map())) {
|
|
156
|
+
const extensions = ( new ExtensionIdentifierMap());
|
|
157
|
+
for (const extension of this.extensionService.extensions) {
|
|
158
|
+
extensions.set(extension.identifier, extension);
|
|
159
|
+
}
|
|
160
|
+
this._keybindingItemsSortedByPrecedence = [];
|
|
161
|
+
const boundCommands = ( new Map());
|
|
162
|
+
for (const keybinding of this.keybindingsService.getKeybindings()) {
|
|
163
|
+
if (keybinding.command) {
|
|
164
|
+
this._keybindingItemsSortedByPrecedence.push(KeybindingsEditorModel_1.toKeybindingEntry(keybinding.command, keybinding, actionLabels, extensions));
|
|
165
|
+
boundCommands.set(keybinding.command, true);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const commandsWithDefaultKeybindings = ( this.keybindingsService.getDefaultKeybindings().map(keybinding => keybinding.command));
|
|
169
|
+
for (const command of getAllUnboundCommands(boundCommands)) {
|
|
170
|
+
const keybindingItem = ( new ResolvedKeybindingItem(
|
|
171
|
+
undefined,
|
|
172
|
+
command,
|
|
173
|
+
null,
|
|
174
|
+
undefined,
|
|
175
|
+
commandsWithDefaultKeybindings.indexOf(command) === -1,
|
|
176
|
+
null,
|
|
177
|
+
false
|
|
178
|
+
));
|
|
179
|
+
this._keybindingItemsSortedByPrecedence.push(KeybindingsEditorModel_1.toKeybindingEntry(command, keybindingItem, actionLabels, extensions));
|
|
180
|
+
}
|
|
181
|
+
this._keybindingItemsSortedByPrecedence = distinct(this._keybindingItemsSortedByPrecedence, keybindingItem => KeybindingsEditorModel_1.getId(keybindingItem));
|
|
182
|
+
this._keybindingItems = this._keybindingItemsSortedByPrecedence.slice(0).sort((a, b) => KeybindingsEditorModel_1.compareKeybindingData(a, b));
|
|
183
|
+
return super.resolve();
|
|
184
|
+
}
|
|
185
|
+
static getId(keybindingItem) {
|
|
186
|
+
return keybindingItem.command + (keybindingItem?.keybinding?.getAriaLabel() ?? '') + keybindingItem.when + (isString(keybindingItem.source) ? keybindingItem.source : keybindingItem.source.identifier.value);
|
|
187
|
+
}
|
|
188
|
+
static compareKeybindingData(a, b) {
|
|
189
|
+
if (a.keybinding && !b.keybinding) {
|
|
190
|
+
return -1;
|
|
191
|
+
}
|
|
192
|
+
if (b.keybinding && !a.keybinding) {
|
|
193
|
+
return 1;
|
|
194
|
+
}
|
|
195
|
+
if (a.commandLabel && !b.commandLabel) {
|
|
196
|
+
return -1;
|
|
197
|
+
}
|
|
198
|
+
if (b.commandLabel && !a.commandLabel) {
|
|
199
|
+
return 1;
|
|
200
|
+
}
|
|
201
|
+
if (a.commandLabel && b.commandLabel) {
|
|
202
|
+
if (a.commandLabel !== b.commandLabel) {
|
|
203
|
+
return a.commandLabel.localeCompare(b.commandLabel);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (a.command === b.command) {
|
|
207
|
+
return a.keybindingItem.isDefault ? 1 : -1;
|
|
208
|
+
}
|
|
209
|
+
return a.command.localeCompare(b.command);
|
|
210
|
+
}
|
|
211
|
+
static toKeybindingEntry(command, keybindingItem, actions, extensions) {
|
|
212
|
+
const menuCommand = MenuRegistry.getCommand(command);
|
|
213
|
+
const editorActionLabel = actions.get(command);
|
|
214
|
+
let source = SOURCE_USER;
|
|
215
|
+
if (keybindingItem.isDefault) {
|
|
216
|
+
const extensionId = keybindingItem.extensionId ?? (keybindingItem.resolvedKeybinding ? undefined : menuCommand?.source?.id);
|
|
217
|
+
source = extensionId ? extensions.get(extensionId) ?? SOURCE_EXTENSION : SOURCE_SYSTEM;
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
keybinding: keybindingItem.resolvedKeybinding,
|
|
221
|
+
keybindingItem,
|
|
222
|
+
command,
|
|
223
|
+
commandLabel: KeybindingsEditorModel_1.getCommandLabel(menuCommand, editorActionLabel),
|
|
224
|
+
commandDefaultLabel: KeybindingsEditorModel_1.getCommandDefaultLabel(menuCommand),
|
|
225
|
+
when: keybindingItem.when ? keybindingItem.when.serialize() : '',
|
|
226
|
+
source
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
static getCommandDefaultLabel(menuCommand) {
|
|
230
|
+
if (!Language.isDefaultVariant()) {
|
|
231
|
+
if (menuCommand && menuCommand.title && menuCommand.title.original) {
|
|
232
|
+
const category = menuCommand.category ? menuCommand.category.original : undefined;
|
|
233
|
+
const title = menuCommand.title.original;
|
|
234
|
+
return category ? ( localizeWithPath(
|
|
235
|
+
'vs/workbench/services/preferences/browser/keybindingsEditorModel',
|
|
236
|
+
'cat.title',
|
|
237
|
+
"{0}: {1}",
|
|
238
|
+
category,
|
|
239
|
+
title
|
|
240
|
+
)) : title;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
static getCommandLabel(menuCommand, editorActionLabel) {
|
|
246
|
+
if (menuCommand) {
|
|
247
|
+
const category = menuCommand.category ? typeof menuCommand.category === 'string' ? menuCommand.category : menuCommand.category.value : undefined;
|
|
248
|
+
const title = typeof menuCommand.title === 'string' ? menuCommand.title : menuCommand.title.value;
|
|
249
|
+
return category ? ( localizeWithPath(
|
|
250
|
+
'vs/workbench/services/preferences/browser/keybindingsEditorModel',
|
|
251
|
+
'cat.title',
|
|
252
|
+
"{0}: {1}",
|
|
253
|
+
category,
|
|
254
|
+
title
|
|
255
|
+
)) : title;
|
|
256
|
+
}
|
|
257
|
+
if (editorActionLabel) {
|
|
258
|
+
return editorActionLabel;
|
|
259
|
+
}
|
|
260
|
+
return '';
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
KeybindingsEditorModel = KeybindingsEditorModel_1 = ( __decorate([
|
|
264
|
+
( __param(1, IKeybindingService)),
|
|
265
|
+
( __param(2, IExtensionService))
|
|
266
|
+
], KeybindingsEditorModel));
|
|
267
|
+
class KeybindingItemMatches {
|
|
268
|
+
constructor(modifierLabels, keybindingItem, searchValue, words, keybindingWords, completeMatch) {
|
|
269
|
+
this.modifierLabels = modifierLabels;
|
|
270
|
+
this.commandIdMatches = null;
|
|
271
|
+
this.commandLabelMatches = null;
|
|
272
|
+
this.commandDefaultLabelMatches = null;
|
|
273
|
+
this.sourceMatches = null;
|
|
274
|
+
this.whenMatches = null;
|
|
275
|
+
this.keybindingMatches = null;
|
|
276
|
+
this.extensionIdMatches = null;
|
|
277
|
+
this.extensionLabelMatches = null;
|
|
278
|
+
if (!completeMatch) {
|
|
279
|
+
this.commandIdMatches = this.matches(searchValue, keybindingItem.command, or(matchesWords, matchesCamelCase), words);
|
|
280
|
+
this.commandLabelMatches = keybindingItem.commandLabel ? this.matches(searchValue, keybindingItem.commandLabel, (word, wordToMatchAgainst) => matchesWords(word, keybindingItem.commandLabel, true), words) : null;
|
|
281
|
+
this.commandDefaultLabelMatches = keybindingItem.commandDefaultLabel ? this.matches(searchValue, keybindingItem.commandDefaultLabel, (word, wordToMatchAgainst) => matchesWords(word, keybindingItem.commandDefaultLabel, true), words) : null;
|
|
282
|
+
this.whenMatches = keybindingItem.when ? this.matches(null, keybindingItem.when, or(matchesWords, matchesCamelCase), words) : null;
|
|
283
|
+
if (isString(keybindingItem.source)) {
|
|
284
|
+
this.sourceMatches = this.matches(searchValue, keybindingItem.source, (word, wordToMatchAgainst) => matchesWords(word, keybindingItem.source, true), words);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
this.extensionLabelMatches = keybindingItem.source.displayName ? this.matches(searchValue, keybindingItem.source.displayName, (word, wordToMatchAgainst) => matchesWords(word, keybindingItem.commandLabel, true), words) : null;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
this.keybindingMatches = keybindingItem.keybinding ? this.matchesKeybinding(keybindingItem.keybinding, searchValue, keybindingWords, completeMatch) : null;
|
|
291
|
+
}
|
|
292
|
+
matches(searchValue, wordToMatchAgainst, wordMatchesFilter, words) {
|
|
293
|
+
let matches = searchValue ? wordFilter(searchValue, wordToMatchAgainst) : null;
|
|
294
|
+
if (!matches) {
|
|
295
|
+
matches = this.matchesWords(words, wordToMatchAgainst, wordMatchesFilter);
|
|
296
|
+
}
|
|
297
|
+
if (matches) {
|
|
298
|
+
matches = this.filterAndSort(matches);
|
|
299
|
+
}
|
|
300
|
+
return matches;
|
|
301
|
+
}
|
|
302
|
+
matchesWords(words, wordToMatchAgainst, wordMatchesFilter) {
|
|
303
|
+
let matches = [];
|
|
304
|
+
for (const word of words) {
|
|
305
|
+
const wordMatches = wordMatchesFilter(word, wordToMatchAgainst);
|
|
306
|
+
if (wordMatches) {
|
|
307
|
+
matches = [...(matches || []), ...wordMatches];
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
matches = null;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return matches;
|
|
315
|
+
}
|
|
316
|
+
filterAndSort(matches) {
|
|
317
|
+
return distinct(matches, (a => a.start + '.' + a.end)).filter(match => !( matches.some(
|
|
318
|
+
m => !(m.start === match.start && m.end === match.end) && (m.start <= match.start && m.end >= match.end)
|
|
319
|
+
))).sort((a, b) => a.start - b.start);
|
|
320
|
+
}
|
|
321
|
+
matchesKeybinding(keybinding, searchValue, words, completeMatch) {
|
|
322
|
+
const [firstPart, chordPart] = keybinding.getChords();
|
|
323
|
+
const userSettingsLabel = keybinding.getUserSettingsLabel();
|
|
324
|
+
const ariaLabel = keybinding.getAriaLabel();
|
|
325
|
+
const label = keybinding.getLabel();
|
|
326
|
+
if ((userSettingsLabel && strings.compareIgnoreCase(searchValue, userSettingsLabel) === 0)
|
|
327
|
+
|| (ariaLabel && strings.compareIgnoreCase(searchValue, ariaLabel) === 0)
|
|
328
|
+
|| (label && strings.compareIgnoreCase(searchValue, label) === 0)) {
|
|
329
|
+
return {
|
|
330
|
+
firstPart: this.createCompleteMatch(firstPart),
|
|
331
|
+
chordPart: this.createCompleteMatch(chordPart)
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
const firstPartMatch = {};
|
|
335
|
+
let chordPartMatch = {};
|
|
336
|
+
const matchedWords = [];
|
|
337
|
+
const firstPartMatchedWords = [];
|
|
338
|
+
let chordPartMatchedWords = [];
|
|
339
|
+
let matchFirstPart = true;
|
|
340
|
+
for (let index = 0; index < words.length; index++) {
|
|
341
|
+
const word = words[index];
|
|
342
|
+
let firstPartMatched = false;
|
|
343
|
+
let chordPartMatched = false;
|
|
344
|
+
matchFirstPart = matchFirstPart && !firstPartMatch.keyCode;
|
|
345
|
+
let matchChordPart = !chordPartMatch.keyCode;
|
|
346
|
+
if (matchFirstPart) {
|
|
347
|
+
firstPartMatched = this.matchPart(firstPart, firstPartMatch, word, completeMatch);
|
|
348
|
+
if (firstPartMatch.keyCode) {
|
|
349
|
+
for (const cordPartMatchedWordIndex of chordPartMatchedWords) {
|
|
350
|
+
if (firstPartMatchedWords.indexOf(cordPartMatchedWordIndex) === -1) {
|
|
351
|
+
matchedWords.splice(matchedWords.indexOf(cordPartMatchedWordIndex), 1);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
chordPartMatch = {};
|
|
355
|
+
chordPartMatchedWords = [];
|
|
356
|
+
matchChordPart = false;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (matchChordPart) {
|
|
360
|
+
chordPartMatched = this.matchPart(chordPart, chordPartMatch, word, completeMatch);
|
|
361
|
+
}
|
|
362
|
+
if (firstPartMatched) {
|
|
363
|
+
firstPartMatchedWords.push(index);
|
|
364
|
+
}
|
|
365
|
+
if (chordPartMatched) {
|
|
366
|
+
chordPartMatchedWords.push(index);
|
|
367
|
+
}
|
|
368
|
+
if (firstPartMatched || chordPartMatched) {
|
|
369
|
+
matchedWords.push(index);
|
|
370
|
+
}
|
|
371
|
+
matchFirstPart = matchFirstPart && this.isModifier(word);
|
|
372
|
+
}
|
|
373
|
+
if (matchedWords.length !== words.length) {
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
if (completeMatch) {
|
|
377
|
+
if (!this.isCompleteMatch(firstPart, firstPartMatch)) {
|
|
378
|
+
return null;
|
|
379
|
+
}
|
|
380
|
+
if (!isEmptyObject(chordPartMatch) && !this.isCompleteMatch(chordPart, chordPartMatch)) {
|
|
381
|
+
return null;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return this.hasAnyMatch(firstPartMatch) || this.hasAnyMatch(chordPartMatch) ? { firstPart: firstPartMatch, chordPart: chordPartMatch } : null;
|
|
385
|
+
}
|
|
386
|
+
matchPart(chord, match, word, completeMatch) {
|
|
387
|
+
let matched = false;
|
|
388
|
+
if (this.matchesMetaModifier(chord, word)) {
|
|
389
|
+
matched = true;
|
|
390
|
+
match.metaKey = true;
|
|
391
|
+
}
|
|
392
|
+
if (this.matchesCtrlModifier(chord, word)) {
|
|
393
|
+
matched = true;
|
|
394
|
+
match.ctrlKey = true;
|
|
395
|
+
}
|
|
396
|
+
if (this.matchesShiftModifier(chord, word)) {
|
|
397
|
+
matched = true;
|
|
398
|
+
match.shiftKey = true;
|
|
399
|
+
}
|
|
400
|
+
if (this.matchesAltModifier(chord, word)) {
|
|
401
|
+
matched = true;
|
|
402
|
+
match.altKey = true;
|
|
403
|
+
}
|
|
404
|
+
if (this.matchesKeyCode(chord, word, completeMatch)) {
|
|
405
|
+
match.keyCode = true;
|
|
406
|
+
matched = true;
|
|
407
|
+
}
|
|
408
|
+
return matched;
|
|
409
|
+
}
|
|
410
|
+
matchesKeyCode(chord, word, completeMatch) {
|
|
411
|
+
if (!chord) {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
const ariaLabel = chord.keyAriaLabel || '';
|
|
415
|
+
if (completeMatch || ariaLabel.length === 1 || word.length === 1) {
|
|
416
|
+
if (strings.compareIgnoreCase(ariaLabel, word) === 0) {
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
if (matchesContiguousSubString(word, ariaLabel)) {
|
|
422
|
+
return true;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
matchesMetaModifier(chord, word) {
|
|
428
|
+
if (!chord) {
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
if (!chord.metaKey) {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
return this.wordMatchesMetaModifier(word);
|
|
435
|
+
}
|
|
436
|
+
matchesCtrlModifier(chord, word) {
|
|
437
|
+
if (!chord) {
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
if (!chord.ctrlKey) {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
return this.wordMatchesCtrlModifier(word);
|
|
444
|
+
}
|
|
445
|
+
matchesShiftModifier(chord, word) {
|
|
446
|
+
if (!chord) {
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
449
|
+
if (!chord.shiftKey) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
return this.wordMatchesShiftModifier(word);
|
|
453
|
+
}
|
|
454
|
+
matchesAltModifier(chord, word) {
|
|
455
|
+
if (!chord) {
|
|
456
|
+
return false;
|
|
457
|
+
}
|
|
458
|
+
if (!chord.altKey) {
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
return this.wordMatchesAltModifier(word);
|
|
462
|
+
}
|
|
463
|
+
hasAnyMatch(keybindingMatch) {
|
|
464
|
+
return !!keybindingMatch.altKey ||
|
|
465
|
+
!!keybindingMatch.ctrlKey ||
|
|
466
|
+
!!keybindingMatch.metaKey ||
|
|
467
|
+
!!keybindingMatch.shiftKey ||
|
|
468
|
+
!!keybindingMatch.keyCode;
|
|
469
|
+
}
|
|
470
|
+
isCompleteMatch(chord, match) {
|
|
471
|
+
if (!chord) {
|
|
472
|
+
return true;
|
|
473
|
+
}
|
|
474
|
+
if (!match.keyCode) {
|
|
475
|
+
return false;
|
|
476
|
+
}
|
|
477
|
+
if (chord.metaKey && !match.metaKey) {
|
|
478
|
+
return false;
|
|
479
|
+
}
|
|
480
|
+
if (chord.altKey && !match.altKey) {
|
|
481
|
+
return false;
|
|
482
|
+
}
|
|
483
|
+
if (chord.ctrlKey && !match.ctrlKey) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
if (chord.shiftKey && !match.shiftKey) {
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
489
|
+
return true;
|
|
490
|
+
}
|
|
491
|
+
createCompleteMatch(chord) {
|
|
492
|
+
const match = {};
|
|
493
|
+
if (chord) {
|
|
494
|
+
match.keyCode = true;
|
|
495
|
+
if (chord.metaKey) {
|
|
496
|
+
match.metaKey = true;
|
|
497
|
+
}
|
|
498
|
+
if (chord.altKey) {
|
|
499
|
+
match.altKey = true;
|
|
500
|
+
}
|
|
501
|
+
if (chord.ctrlKey) {
|
|
502
|
+
match.ctrlKey = true;
|
|
503
|
+
}
|
|
504
|
+
if (chord.shiftKey) {
|
|
505
|
+
match.shiftKey = true;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return match;
|
|
509
|
+
}
|
|
510
|
+
isModifier(word) {
|
|
511
|
+
if (this.wordMatchesAltModifier(word)) {
|
|
512
|
+
return true;
|
|
513
|
+
}
|
|
514
|
+
if (this.wordMatchesCtrlModifier(word)) {
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
if (this.wordMatchesMetaModifier(word)) {
|
|
518
|
+
return true;
|
|
519
|
+
}
|
|
520
|
+
if (this.wordMatchesShiftModifier(word)) {
|
|
521
|
+
return true;
|
|
522
|
+
}
|
|
523
|
+
return false;
|
|
524
|
+
}
|
|
525
|
+
wordMatchesAltModifier(word) {
|
|
526
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.ui.altKey, word)) {
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
529
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.aria.altKey, word)) {
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.user.altKey, word)) {
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
if (strings.equalsIgnoreCase(( localizeWithPath(
|
|
536
|
+
'vs/workbench/services/preferences/browser/keybindingsEditorModel',
|
|
537
|
+
'option',
|
|
538
|
+
"option"
|
|
539
|
+
)), word)) {
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
544
|
+
wordMatchesCtrlModifier(word) {
|
|
545
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.ui.ctrlKey, word)) {
|
|
546
|
+
return true;
|
|
547
|
+
}
|
|
548
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.aria.ctrlKey, word)) {
|
|
549
|
+
return true;
|
|
550
|
+
}
|
|
551
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.user.ctrlKey, word)) {
|
|
552
|
+
return true;
|
|
553
|
+
}
|
|
554
|
+
return false;
|
|
555
|
+
}
|
|
556
|
+
wordMatchesMetaModifier(word) {
|
|
557
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.ui.metaKey, word)) {
|
|
558
|
+
return true;
|
|
559
|
+
}
|
|
560
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.aria.metaKey, word)) {
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.user.metaKey, word)) {
|
|
564
|
+
return true;
|
|
565
|
+
}
|
|
566
|
+
if (strings.equalsIgnoreCase(( localizeWithPath(
|
|
567
|
+
'vs/workbench/services/preferences/browser/keybindingsEditorModel',
|
|
568
|
+
'meta',
|
|
569
|
+
"meta"
|
|
570
|
+
)), word)) {
|
|
571
|
+
return true;
|
|
572
|
+
}
|
|
573
|
+
return false;
|
|
574
|
+
}
|
|
575
|
+
wordMatchesShiftModifier(word) {
|
|
576
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.ui.shiftKey, word)) {
|
|
577
|
+
return true;
|
|
578
|
+
}
|
|
579
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.aria.shiftKey, word)) {
|
|
580
|
+
return true;
|
|
581
|
+
}
|
|
582
|
+
if (strings.equalsIgnoreCase(this.modifierLabels.user.shiftKey, word)) {
|
|
583
|
+
return true;
|
|
584
|
+
}
|
|
585
|
+
return false;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
export { KEYBINDING_ENTRY_TEMPLATE_ID, KeybindingsEditorModel };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
3
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
4
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
5
|
+
import { EditorInput } from '../../../common/editor/editorInput.js';
|
|
6
|
+
import { IPreferencesService } from './preferences.js';
|
|
7
|
+
var SettingsEditor2Input_1;
|
|
8
|
+
let SettingsEditor2Input = class SettingsEditor2Input extends EditorInput {
|
|
9
|
+
static { SettingsEditor2Input_1 = this; }
|
|
10
|
+
static { this.ID = 'workbench.input.settings2'; }
|
|
11
|
+
constructor(_preferencesService) {
|
|
12
|
+
super();
|
|
13
|
+
this.resource = ( URI.from({
|
|
14
|
+
scheme: Schemas.vscodeSettings,
|
|
15
|
+
path: `settingseditor`
|
|
16
|
+
}));
|
|
17
|
+
this._settingsModel = _preferencesService.createSettings2EditorModel();
|
|
18
|
+
}
|
|
19
|
+
matches(otherInput) {
|
|
20
|
+
return super.matches(otherInput) || otherInput instanceof SettingsEditor2Input_1;
|
|
21
|
+
}
|
|
22
|
+
get typeId() {
|
|
23
|
+
return SettingsEditor2Input_1.ID;
|
|
24
|
+
}
|
|
25
|
+
getName() {
|
|
26
|
+
return ( nls.localizeWithPath(
|
|
27
|
+
'vs/workbench/services/preferences/common/preferencesEditorInput',
|
|
28
|
+
'settingsEditor2InputName',
|
|
29
|
+
"Settings"
|
|
30
|
+
));
|
|
31
|
+
}
|
|
32
|
+
async resolve() {
|
|
33
|
+
return this._settingsModel;
|
|
34
|
+
}
|
|
35
|
+
dispose() {
|
|
36
|
+
this._settingsModel.dispose();
|
|
37
|
+
super.dispose();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
SettingsEditor2Input = SettingsEditor2Input_1 = ( __decorate([
|
|
41
|
+
( __param(0, IPreferencesService))
|
|
42
|
+
], SettingsEditor2Input));
|
|
43
|
+
export { SettingsEditor2Input };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mapArrayOrNot } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
2
2
|
import * as glob from 'monaco-editor/esm/vs/base/common/glob.js';
|
|
3
|
-
import * as
|
|
3
|
+
import * as Objects from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
4
4
|
import * as extpath from 'monaco-editor/esm/vs/base/common/extpath.js';
|
|
5
5
|
import { getNLines } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
6
6
|
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
@@ -104,8 +104,8 @@ function getExcludes(configuration, includeSearchExcludes = true) {
|
|
|
104
104
|
return fileExcludes || searchExcludes;
|
|
105
105
|
}
|
|
106
106
|
let allExcludes = Object.create(null);
|
|
107
|
-
allExcludes =
|
|
108
|
-
allExcludes =
|
|
107
|
+
allExcludes = Objects.mixin(allExcludes, Objects.deepClone(fileExcludes));
|
|
108
|
+
allExcludes = Objects.mixin(allExcludes, Objects.deepClone(searchExcludes), true);
|
|
109
109
|
return allExcludes;
|
|
110
110
|
}
|
|
111
111
|
function pathIncludedInQuery(queryProps, fsPath) {
|