@codingame/monaco-vscode-quickaccess-service-override 4.5.0 → 4.5.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/index.d.ts +1 -1
- package/package.json +2 -2
- package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.js +29 -59
- package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.js +19 -22
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +7 -30
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +11 -18
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +46 -79
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +22 -62
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +25 -60
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +16 -42
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainsValidator.js +43 -48
- package/vscode/src/vs/workbench/contrib/url/browser/url.contribution.js +8 -11
- package/quickaccess.d.ts +0 -10
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from 'vscode/service-override/quickaccess';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-quickaccess-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -19,6 +19,7 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
|
|
|
19
19
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
20
20
|
|
|
21
21
|
var AbstractCommandsQuickAccessProvider_1, CommandsHistory_1;
|
|
22
|
+
const _moduleId = "vs/platform/quickinput/browser/commandsQuickAccess";
|
|
22
23
|
let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvider extends PickerQuickAccessProvider {
|
|
23
24
|
static { AbstractCommandsQuickAccessProvider_1 = this; }
|
|
24
25
|
static { this.PREFIX = '>'; }
|
|
@@ -41,11 +42,11 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
41
42
|
return [];
|
|
42
43
|
}
|
|
43
44
|
const runTfidf = createSingleCallFunction(() => {
|
|
44
|
-
const tfidf = ( new TfIdfCalculator());
|
|
45
|
-
tfidf.updateDocuments(( allCommandPicks.map(commandPick => ({
|
|
45
|
+
const tfidf = ( (new TfIdfCalculator()));
|
|
46
|
+
tfidf.updateDocuments(( (allCommandPicks.map(commandPick => ({
|
|
46
47
|
key: commandPick.commandId,
|
|
47
48
|
textChunks: [this.getTfIdfChunk(commandPick)]
|
|
48
|
-
}))));
|
|
49
|
+
})))));
|
|
49
50
|
const result = tfidf.calculateScores(filter, token);
|
|
50
51
|
return normalizeTfIdfScores(result)
|
|
51
52
|
.filter(score => score.score > AbstractCommandsQuickAccessProvider_1.TFIDF_THRESHOLD)
|
|
@@ -77,7 +78,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
const mapLabelToCommand = ( new Map());
|
|
81
|
+
const mapLabelToCommand = ( (new Map()));
|
|
81
82
|
for (const commandPick of filteredCommandPicks) {
|
|
82
83
|
const existingCommandForLabel = mapLabelToCommand.get(commandPick.label);
|
|
83
84
|
if (existingCommandForLabel) {
|
|
@@ -113,8 +114,8 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
113
114
|
return 1;
|
|
114
115
|
}
|
|
115
116
|
if (this.options.suggestedCommandIds) {
|
|
116
|
-
const commandASuggestion = ( this.options.suggestedCommandIds.has(commandPickA.commandId));
|
|
117
|
-
const commandBSuggestion = ( this.options.suggestedCommandIds.has(commandPickB.commandId));
|
|
117
|
+
const commandASuggestion = ( (this.options.suggestedCommandIds.has(commandPickA.commandId)));
|
|
118
|
+
const commandBSuggestion = ( (this.options.suggestedCommandIds.has(commandPickB.commandId)));
|
|
118
119
|
if (commandASuggestion && commandBSuggestion) {
|
|
119
120
|
return 0;
|
|
120
121
|
}
|
|
@@ -134,36 +135,20 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
134
135
|
for (let i = 0; i < filteredCommandPicks.length; i++) {
|
|
135
136
|
const commandPick = filteredCommandPicks[i];
|
|
136
137
|
if (i === 0 && this.commandsHistory.peek(commandPick.commandId)) {
|
|
137
|
-
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
138
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
139
|
-
'recentlyUsed',
|
|
140
|
-
"recently used"
|
|
141
|
-
)) });
|
|
138
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 0, "recently used")) });
|
|
142
139
|
addOtherSeparator = true;
|
|
143
140
|
}
|
|
144
141
|
if (addSuggestedSeparator && commandPick.tfIdfScore !== undefined) {
|
|
145
|
-
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
146
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
147
|
-
'suggested',
|
|
148
|
-
"similar commands"
|
|
149
|
-
)) });
|
|
142
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 1, "similar commands")) });
|
|
150
143
|
addSuggestedSeparator = false;
|
|
151
144
|
}
|
|
152
145
|
if (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
153
|
-
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
154
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
155
|
-
'commonlyUsed',
|
|
156
|
-
"commonly used"
|
|
157
|
-
)) });
|
|
146
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 2, "commonly used")) });
|
|
158
147
|
addOtherSeparator = true;
|
|
159
148
|
addCommonlyUsedSeparator = false;
|
|
160
149
|
}
|
|
161
150
|
if (addOtherSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
162
|
-
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
163
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
164
|
-
'morecCommands',
|
|
165
|
-
"other commands"
|
|
166
|
-
)) });
|
|
151
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 3, "other commands")) });
|
|
167
152
|
addOtherSeparator = false;
|
|
168
153
|
}
|
|
169
154
|
commandPicks.push(this.toCommandPick(commandPick, runOptions));
|
|
@@ -178,13 +163,9 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
178
163
|
if (token.isCancellationRequested) {
|
|
179
164
|
return [];
|
|
180
165
|
}
|
|
181
|
-
const commandPicks = ( additionalCommandPicks.map(commandPick => this.toCommandPick(commandPick, runOptions)));
|
|
166
|
+
const commandPicks = ( (additionalCommandPicks.map(commandPick => this.toCommandPick(commandPick, runOptions))));
|
|
182
167
|
if (addSuggestedSeparator && commandPicks[0]?.type !== 'separator') {
|
|
183
|
-
commandPicks.unshift({ type: 'separator', label: ( localizeWithPath(
|
|
184
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
185
|
-
'suggested',
|
|
186
|
-
"similar commands"
|
|
187
|
-
)) });
|
|
168
|
+
commandPicks.unshift({ type: 'separator', label: ( localizeWithPath(_moduleId, 1, "similar commands")) });
|
|
188
169
|
}
|
|
189
170
|
return commandPicks;
|
|
190
171
|
})()
|
|
@@ -196,13 +177,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
196
177
|
}
|
|
197
178
|
const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);
|
|
198
179
|
const ariaLabel = keybinding ?
|
|
199
|
-
( localizeWithPath(
|
|
200
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
201
|
-
'commandPickAriaLabelWithKeybinding',
|
|
202
|
-
"{0}, {1}",
|
|
203
|
-
commandPick.label,
|
|
204
|
-
keybinding.getAriaLabel()
|
|
205
|
-
)) :
|
|
180
|
+
( localizeWithPath(_moduleId, 4, "{0}, {1}", commandPick.label, keybinding.getAriaLabel())) :
|
|
206
181
|
commandPick.label;
|
|
207
182
|
return {
|
|
208
183
|
...commandPick,
|
|
@@ -222,12 +197,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
222
197
|
}
|
|
223
198
|
catch (error) {
|
|
224
199
|
if (!isCancellationError(error)) {
|
|
225
|
-
this.dialogService.error(( localizeWithPath(
|
|
226
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
227
|
-
'canNotRun',
|
|
228
|
-
"Command '{0}' resulted in an error",
|
|
229
|
-
commandPick.label
|
|
230
|
-
)), toErrorMessage(error));
|
|
200
|
+
this.dialogService.error(( localizeWithPath(_moduleId, 5, "Command '{0}' resulted in an error", commandPick.label)), toErrorMessage(error));
|
|
231
201
|
}
|
|
232
202
|
}
|
|
233
203
|
}
|
|
@@ -244,13 +214,13 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
244
214
|
return chunk;
|
|
245
215
|
}
|
|
246
216
|
};
|
|
247
|
-
AbstractCommandsQuickAccessProvider = AbstractCommandsQuickAccessProvider_1 = ( __decorate([
|
|
248
|
-
( __param(1, IInstantiationService)),
|
|
249
|
-
( __param(2, IKeybindingService)),
|
|
250
|
-
( __param(3, ICommandService)),
|
|
251
|
-
( __param(4, ITelemetryService)),
|
|
252
|
-
( __param(5, IDialogService))
|
|
253
|
-
], AbstractCommandsQuickAccessProvider));
|
|
217
|
+
AbstractCommandsQuickAccessProvider = AbstractCommandsQuickAccessProvider_1 = ( (__decorate([
|
|
218
|
+
( (__param(1, IInstantiationService))),
|
|
219
|
+
( (__param(2, IKeybindingService))),
|
|
220
|
+
( (__param(3, ICommandService))),
|
|
221
|
+
( (__param(4, ITelemetryService))),
|
|
222
|
+
( (__param(5, IDialogService)))
|
|
223
|
+
], AbstractCommandsQuickAccessProvider)));
|
|
254
224
|
let CommandsHistory = class CommandsHistory extends Disposable {
|
|
255
225
|
static { CommandsHistory_1 = this; }
|
|
256
226
|
static { this.DEFAULT_COMMANDS_HISTORY_LENGTH = 50; }
|
|
@@ -297,7 +267,7 @@ let CommandsHistory = class CommandsHistory extends Disposable {
|
|
|
297
267
|
this.logService.error(`[CommandsHistory] invalid data: ${error}`);
|
|
298
268
|
}
|
|
299
269
|
}
|
|
300
|
-
const cache = CommandsHistory_1.cache = ( new LRUCache(this.configuredCommandsHistoryLength, 1));
|
|
270
|
+
const cache = CommandsHistory_1.cache = ( (new LRUCache(this.configuredCommandsHistoryLength, 1)));
|
|
301
271
|
if (serializedCache) {
|
|
302
272
|
let entries;
|
|
303
273
|
if (serializedCache.usesLRU) {
|
|
@@ -343,15 +313,15 @@ let CommandsHistory = class CommandsHistory extends Disposable {
|
|
|
343
313
|
}
|
|
344
314
|
static clearHistory(configurationService, storageService) {
|
|
345
315
|
const commandHistoryLength = CommandsHistory_1.getConfiguredCommandHistoryLength(configurationService);
|
|
346
|
-
CommandsHistory_1.cache = ( new LRUCache(commandHistoryLength));
|
|
316
|
+
CommandsHistory_1.cache = ( (new LRUCache(commandHistoryLength)));
|
|
347
317
|
CommandsHistory_1.counter = 1;
|
|
348
318
|
CommandsHistory_1.hasChanges = true;
|
|
349
319
|
}
|
|
350
320
|
};
|
|
351
|
-
CommandsHistory = CommandsHistory_1 = ( __decorate([
|
|
352
|
-
( __param(0, IStorageService)),
|
|
353
|
-
( __param(1, IConfigurationService)),
|
|
354
|
-
( __param(2, ILogService))
|
|
355
|
-
], CommandsHistory));
|
|
321
|
+
CommandsHistory = CommandsHistory_1 = ( (__decorate([
|
|
322
|
+
( (__param(0, IStorageService))),
|
|
323
|
+
( (__param(1, IConfigurationService))),
|
|
324
|
+
( (__param(2, ILogService)))
|
|
325
|
+
], CommandsHistory)));
|
|
356
326
|
|
|
357
327
|
export { AbstractCommandsQuickAccessProvider, CommandsHistory };
|
|
@@ -7,16 +7,17 @@ import { Extensions } from 'vscode/vscode/vs/platform/quickinput/common/quickAcc
|
|
|
7
7
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
8
8
|
|
|
9
9
|
var HelpQuickAccessProvider_1;
|
|
10
|
+
const _moduleId = "vs/platform/quickinput/browser/helpQuickAccess";
|
|
10
11
|
let HelpQuickAccessProvider = class HelpQuickAccessProvider {
|
|
11
12
|
static { HelpQuickAccessProvider_1 = this; }
|
|
12
13
|
static { this.PREFIX = '?'; }
|
|
13
14
|
constructor(quickInputService, keybindingService) {
|
|
14
15
|
this.quickInputService = quickInputService;
|
|
15
16
|
this.keybindingService = keybindingService;
|
|
16
|
-
this.registry = ( Registry.as(Extensions.Quickaccess));
|
|
17
|
+
this.registry = ( (Registry.as(Extensions.Quickaccess)));
|
|
17
18
|
}
|
|
18
19
|
provide(picker) {
|
|
19
|
-
const disposables = ( new DisposableStore());
|
|
20
|
+
const disposables = ( (new DisposableStore()));
|
|
20
21
|
disposables.add(picker.onDidAccept(() => {
|
|
21
22
|
const [item] = picker.selectedItems;
|
|
22
23
|
if (item) {
|
|
@@ -40,28 +41,24 @@ let HelpQuickAccessProvider = class HelpQuickAccessProvider {
|
|
|
40
41
|
return providers;
|
|
41
42
|
}
|
|
42
43
|
createPicks(provider) {
|
|
43
|
-
return (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
keybinding: helpEntry.commandId ? this.keybindingService.lookupKeybinding(helpEntry.commandId) : undefined,
|
|
50
|
-
ariaLabel: ( localizeWithPath(
|
|
51
|
-
'vs/platform/quickinput/browser/helpQuickAccess',
|
|
52
|
-
'helpPickAriaLabel',
|
|
53
|
-
"{0}, {1}",
|
|
44
|
+
return (
|
|
45
|
+
(provider.helpEntries.map(helpEntry => {
|
|
46
|
+
const prefix = helpEntry.prefix || provider.prefix;
|
|
47
|
+
const label = prefix || '\u2026' ;
|
|
48
|
+
return {
|
|
49
|
+
prefix,
|
|
54
50
|
label,
|
|
55
|
-
helpEntry.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
keybinding: helpEntry.commandId ? this.keybindingService.lookupKeybinding(helpEntry.commandId) : undefined,
|
|
52
|
+
ariaLabel: ( localizeWithPath(_moduleId, 0, "{0}, {1}", label, helpEntry.description)),
|
|
53
|
+
description: helpEntry.description
|
|
54
|
+
};
|
|
55
|
+
}))
|
|
56
|
+
);
|
|
60
57
|
}
|
|
61
58
|
};
|
|
62
|
-
HelpQuickAccessProvider = HelpQuickAccessProvider_1 = ( __decorate([
|
|
63
|
-
( __param(0, IQuickInputService)),
|
|
64
|
-
( __param(1, IKeybindingService))
|
|
65
|
-
], HelpQuickAccessProvider));
|
|
59
|
+
HelpQuickAccessProvider = HelpQuickAccessProvider_1 = ( (__decorate([
|
|
60
|
+
( (__param(0, IQuickInputService))),
|
|
61
|
+
( (__param(1, IKeybindingService)))
|
|
62
|
+
], HelpQuickAccessProvider)));
|
|
66
63
|
|
|
67
64
|
export { HelpQuickAccessProvider };
|
|
@@ -8,6 +8,7 @@ import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/comm
|
|
|
8
8
|
import { inQuickPickContext, getQuickNavigateHandler, defaultQuickAccessContext } from 'vscode/vscode/vs/workbench/browser/quickaccess';
|
|
9
9
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
10
10
|
|
|
11
|
+
const _moduleId = "vs/workbench/browser/actions/quickAccessActions";
|
|
11
12
|
const globalQuickAccessKeybinding = {
|
|
12
13
|
primary: 2048 | 46 ,
|
|
13
14
|
secondary: [2048 | 35 ],
|
|
@@ -103,11 +104,7 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
103
104
|
constructor() {
|
|
104
105
|
super({
|
|
105
106
|
id: 'workbench.action.quickOpen',
|
|
106
|
-
title: ( localize2WithPath(
|
|
107
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
108
|
-
'quickOpen',
|
|
109
|
-
"Go to File..."
|
|
110
|
-
)),
|
|
107
|
+
title: ( localize2WithPath(_moduleId, 0, "Go to File...")),
|
|
111
108
|
metadata: {
|
|
112
109
|
description: `Quick access`,
|
|
113
110
|
args: [{
|
|
@@ -135,11 +132,7 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
135
132
|
constructor() {
|
|
136
133
|
super({
|
|
137
134
|
id: 'workbench.action.quickOpenWithModes',
|
|
138
|
-
title: ( localizeWithPath(
|
|
139
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
140
|
-
'quickOpenWithModes',
|
|
141
|
-
"Quick Open"
|
|
142
|
-
)),
|
|
135
|
+
title: ( localizeWithPath(_moduleId, 1, "Quick Open")),
|
|
143
136
|
icon: Codicon.search,
|
|
144
137
|
menu: {
|
|
145
138
|
id: MenuId.CommandCenterCenter,
|
|
@@ -179,29 +172,17 @@ class BaseQuickAccessNavigateAction extends Action2 {
|
|
|
179
172
|
}
|
|
180
173
|
class QuickAccessNavigateNextAction extends BaseQuickAccessNavigateAction {
|
|
181
174
|
constructor() {
|
|
182
|
-
super('workbench.action.quickOpenNavigateNext', ( localize2WithPath(
|
|
183
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
184
|
-
'quickNavigateNext',
|
|
185
|
-
'Navigate Next in Quick Open'
|
|
186
|
-
)), true, true);
|
|
175
|
+
super('workbench.action.quickOpenNavigateNext', ( localize2WithPath(_moduleId, 2, 'Navigate Next in Quick Open')), true, true);
|
|
187
176
|
}
|
|
188
177
|
}
|
|
189
178
|
class QuickAccessNavigatePreviousAction extends BaseQuickAccessNavigateAction {
|
|
190
179
|
constructor() {
|
|
191
|
-
super('workbench.action.quickOpenNavigatePrevious', ( localize2WithPath(
|
|
192
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
193
|
-
'quickNavigatePrevious',
|
|
194
|
-
'Navigate Previous in Quick Open'
|
|
195
|
-
)), false, true);
|
|
180
|
+
super('workbench.action.quickOpenNavigatePrevious', ( localize2WithPath(_moduleId, 3, 'Navigate Previous in Quick Open')), false, true);
|
|
196
181
|
}
|
|
197
182
|
}
|
|
198
183
|
class QuickAccessSelectNextAction extends BaseQuickAccessNavigateAction {
|
|
199
184
|
constructor() {
|
|
200
|
-
super('workbench.action.quickOpenSelectNext', ( localize2WithPath(
|
|
201
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
202
|
-
'quickSelectNext',
|
|
203
|
-
'Select Next in Quick Open'
|
|
204
|
-
)), true, false, {
|
|
185
|
+
super('workbench.action.quickOpenSelectNext', ( localize2WithPath(_moduleId, 4, 'Select Next in Quick Open')), true, false, {
|
|
205
186
|
weight: 200 + 50,
|
|
206
187
|
when: inQuickPickContext,
|
|
207
188
|
primary: 0,
|
|
@@ -211,11 +192,7 @@ class QuickAccessSelectNextAction extends BaseQuickAccessNavigateAction {
|
|
|
211
192
|
}
|
|
212
193
|
class QuickAccessSelectPreviousAction extends BaseQuickAccessNavigateAction {
|
|
213
194
|
constructor() {
|
|
214
|
-
super('workbench.action.quickOpenSelectPrevious', ( localize2WithPath(
|
|
215
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
216
|
-
'quickSelectPrevious',
|
|
217
|
-
'Select Previous in Quick Open'
|
|
218
|
-
)), false, false, {
|
|
195
|
+
super('workbench.action.quickOpenSelectPrevious', ( localize2WithPath(_moduleId, 5, 'Select Previous in Quick Open')), false, false, {
|
|
219
196
|
weight: 200 + 50,
|
|
220
197
|
when: inQuickPickContext,
|
|
221
198
|
primary: 0,
|
package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js
CHANGED
|
@@ -9,6 +9,7 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
|
|
|
9
9
|
import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
10
10
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
11
11
|
|
|
12
|
+
const _moduleId = "vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess";
|
|
12
13
|
let GotoLineQuickAccessProvider = class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {
|
|
13
14
|
constructor(editorService, editorGroupService, configurationService) {
|
|
14
15
|
super();
|
|
@@ -41,21 +42,17 @@ let GotoLineQuickAccessProvider = class GotoLineQuickAccessProvider extends Abst
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
|
-
GotoLineQuickAccessProvider = ( __decorate([
|
|
45
|
-
( __param(0, IEditorService)),
|
|
46
|
-
( __param(1, IEditorGroupsService)),
|
|
47
|
-
( __param(2, IConfigurationService))
|
|
48
|
-
], GotoLineQuickAccessProvider));
|
|
45
|
+
GotoLineQuickAccessProvider = ( (__decorate([
|
|
46
|
+
( (__param(0, IEditorService))),
|
|
47
|
+
( (__param(1, IEditorGroupsService))),
|
|
48
|
+
( (__param(2, IConfigurationService)))
|
|
49
|
+
], GotoLineQuickAccessProvider)));
|
|
49
50
|
class GotoLineAction extends Action2 {
|
|
50
51
|
static { this.ID = 'workbench.action.gotoLine'; }
|
|
51
52
|
constructor() {
|
|
52
53
|
super({
|
|
53
54
|
id: GotoLineAction.ID,
|
|
54
|
-
title: ( localize2WithPath(
|
|
55
|
-
'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess',
|
|
56
|
-
'gotoLine',
|
|
57
|
-
'Go to Line/Column...'
|
|
58
|
-
)),
|
|
55
|
+
title: ( localize2WithPath(_moduleId, 0, 'Go to Line/Column...')),
|
|
59
56
|
f1: true,
|
|
60
57
|
keybinding: {
|
|
61
58
|
weight: 200 ,
|
|
@@ -70,19 +67,15 @@ class GotoLineAction extends Action2 {
|
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
registerAction2(GotoLineAction);
|
|
73
|
-
( Registry.as(Extensions.Quickaccess)).registerQuickAccessProvider({
|
|
70
|
+
( (Registry.as(Extensions.Quickaccess))).registerQuickAccessProvider({
|
|
74
71
|
ctor: GotoLineQuickAccessProvider,
|
|
75
72
|
prefix: AbstractGotoLineQuickAccessProvider.PREFIX,
|
|
76
73
|
placeholder: ( localizeWithPath(
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
_moduleId,
|
|
75
|
+
1,
|
|
79
76
|
"Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."
|
|
80
77
|
)),
|
|
81
|
-
helpEntries: [{ description: ( localizeWithPath(
|
|
82
|
-
'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess',
|
|
83
|
-
'gotoLineQuickAccess',
|
|
84
|
-
"Go to Line/Column"
|
|
85
|
-
)), commandId: GotoLineAction.ID }]
|
|
78
|
+
helpEntries: [{ description: ( localizeWithPath(_moduleId, 2, "Go to Line/Column")), commandId: GotoLineAction.ID }]
|
|
86
79
|
});
|
|
87
80
|
|
|
88
81
|
export { GotoLineQuickAccessProvider };
|
|
@@ -34,6 +34,7 @@ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extension
|
|
|
34
34
|
import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
35
35
|
|
|
36
36
|
var CommandsQuickAccessProvider_1;
|
|
37
|
+
const _moduleId = "vs/workbench/contrib/quickaccess/browser/commandsQuickAccess";
|
|
37
38
|
let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends AbstractEditorCommandsQuickAccessProvider {
|
|
38
39
|
static { CommandsQuickAccessProvider_1 = this; }
|
|
39
40
|
static { this.AI_RELATED_INFORMATION_MAX_PICKS = 5; }
|
|
@@ -50,11 +51,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
50
51
|
super({
|
|
51
52
|
showAlias: !Language.isDefaultVariant(),
|
|
52
53
|
noResultsPick: () => ({
|
|
53
|
-
label: ( localizeWithPath(
|
|
54
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
55
|
-
'noCommandResults',
|
|
56
|
-
"No matching commands"
|
|
57
|
-
)),
|
|
54
|
+
label: ( localizeWithPath(_moduleId, 0, "No matching commands")),
|
|
58
55
|
commandId: ''
|
|
59
56
|
}),
|
|
60
57
|
}, instantiationService, keybindingService, commandService, telemetryService, dialogService);
|
|
@@ -85,7 +82,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
85
82
|
}
|
|
86
83
|
const config = this.configuration;
|
|
87
84
|
const suggestedCommandIds = config.experimental.suggestCommands && this.productService.commandPaletteSuggestedCommandIds?.length
|
|
88
|
-
? ( new Set(this.productService.commandPaletteSuggestedCommandIds))
|
|
85
|
+
? ( (new Set(this.productService.commandPaletteSuggestedCommandIds)))
|
|
89
86
|
: undefined;
|
|
90
87
|
this.options.suggestedCommandIds = suggestedCommandIds;
|
|
91
88
|
this.useAiRelatedInfo = config.experimental.enableNaturalLanguageSearch;
|
|
@@ -95,24 +92,22 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
95
92
|
if (token.isCancellationRequested) {
|
|
96
93
|
return [];
|
|
97
94
|
}
|
|
98
|
-
return (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
})));
|
|
95
|
+
return (
|
|
96
|
+
([
|
|
97
|
+
...this.getCodeEditorCommandPicks(),
|
|
98
|
+
...this.getGlobalCommandPicks()
|
|
99
|
+
].map(picks => ({
|
|
100
|
+
...picks,
|
|
101
|
+
buttons: [{
|
|
102
|
+
iconClass: ThemeIcon.asClassName(Codicon.gear),
|
|
103
|
+
tooltip: ( localizeWithPath(_moduleId, 1, "Configure Keybinding")),
|
|
104
|
+
}],
|
|
105
|
+
trigger: () => {
|
|
106
|
+
this.preferencesService.openGlobalKeybindingSettings(false, { query: `@command:${picks.commandId}` });
|
|
107
|
+
return TriggerAction.CLOSE_PICKER;
|
|
108
|
+
},
|
|
109
|
+
})))
|
|
110
|
+
);
|
|
116
111
|
}
|
|
117
112
|
hasAdditionalCommandPicks(filter, token) {
|
|
118
113
|
if (!this.useAiRelatedInfo
|
|
@@ -143,13 +138,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
143
138
|
const defaultAgent = this.chatAgentService.getDefaultAgent(ChatAgentLocation.Panel);
|
|
144
139
|
if (defaultAgent) {
|
|
145
140
|
additionalPicks.push({
|
|
146
|
-
label: ( localizeWithPath(
|
|
147
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
148
|
-
'askXInChat',
|
|
149
|
-
"Ask {0}: {1}",
|
|
150
|
-
defaultAgent.metadata.fullName,
|
|
151
|
-
filter
|
|
152
|
-
)),
|
|
141
|
+
label: ( localizeWithPath(_moduleId, 2, "Ask {0}: {1}", defaultAgent.metadata.fullName, filter)),
|
|
153
142
|
commandId: this.configuration.experimental.askChatLocation === 'quickChat' ? ASK_QUICK_QUESTION_ACTION_ID : CHAT_OPEN_ACTION_ID,
|
|
154
143
|
args: [filter]
|
|
155
144
|
});
|
|
@@ -159,13 +148,13 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
159
148
|
async getRelatedInformationPicks(allPicks, picksSoFar, filter, token) {
|
|
160
149
|
const relatedInformation = await this.aiRelatedInformationService.getRelatedInformation(filter, [RelatedInformationType.CommandInformation], token);
|
|
161
150
|
relatedInformation.sort((a, b) => b.weight - a.weight);
|
|
162
|
-
const setOfPicksSoFar = ( new Set((
|
|
163
|
-
const additionalPicks = ( new Array());
|
|
151
|
+
const setOfPicksSoFar = ( (new Set( (picksSoFar.map(p => p.commandId)))));
|
|
152
|
+
const additionalPicks = ( (new Array()));
|
|
164
153
|
for (const info of relatedInformation) {
|
|
165
154
|
if (info.weight < CommandsQuickAccessProvider_1.AI_RELATED_INFORMATION_THRESHOLD || additionalPicks.length === CommandsQuickAccessProvider_1.AI_RELATED_INFORMATION_MAX_PICKS) {
|
|
166
155
|
break;
|
|
167
156
|
}
|
|
168
|
-
const pick = allPicks.find(p => p.commandId === info.command && !( setOfPicksSoFar.has(p.commandId)));
|
|
157
|
+
const pick = allPicks.find(p => p.commandId === info.command && !( (setOfPicksSoFar.has(p.commandId))));
|
|
169
158
|
if (pick) {
|
|
170
159
|
additionalPicks.push(pick);
|
|
171
160
|
}
|
|
@@ -183,13 +172,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
183
172
|
let label = (typeof action.item.title === 'string' ? action.item.title : action.item.title.value) || action.item.id;
|
|
184
173
|
const category = typeof action.item.category === 'string' ? action.item.category : action.item.category?.value;
|
|
185
174
|
if (category) {
|
|
186
|
-
label = ( localizeWithPath(
|
|
187
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
188
|
-
'commandWithCategory',
|
|
189
|
-
"{0}: {1}",
|
|
190
|
-
category,
|
|
191
|
-
label
|
|
192
|
-
));
|
|
175
|
+
label = ( localizeWithPath(_moduleId, 3, "{0}: {1}", category, label));
|
|
193
176
|
}
|
|
194
177
|
const aliasLabel = typeof action.item.title !== 'string' ? action.item.title.original : undefined;
|
|
195
178
|
const aliasCategory = (category && action.item.category && typeof action.item.category !== 'string') ? action.item.category.original : undefined;
|
|
@@ -211,32 +194,28 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
211
194
|
return globalCommandPicks;
|
|
212
195
|
}
|
|
213
196
|
};
|
|
214
|
-
CommandsQuickAccessProvider = CommandsQuickAccessProvider_1 = ( __decorate([
|
|
215
|
-
( __param(0, IEditorService)),
|
|
216
|
-
( __param(1, IMenuService)),
|
|
217
|
-
( __param(2, IExtensionService)),
|
|
218
|
-
( __param(3, IInstantiationService)),
|
|
219
|
-
( __param(4, IKeybindingService)),
|
|
220
|
-
( __param(5, ICommandService)),
|
|
221
|
-
( __param(6, ITelemetryService)),
|
|
222
|
-
( __param(7, IDialogService)),
|
|
223
|
-
( __param(8, IConfigurationService)),
|
|
224
|
-
( __param(9, IEditorGroupsService)),
|
|
225
|
-
( __param(10, IPreferencesService)),
|
|
226
|
-
( __param(11, IProductService)),
|
|
227
|
-
( __param(12, IAiRelatedInformationService)),
|
|
228
|
-
( __param(13, IChatAgentService))
|
|
229
|
-
], CommandsQuickAccessProvider));
|
|
197
|
+
CommandsQuickAccessProvider = CommandsQuickAccessProvider_1 = ( (__decorate([
|
|
198
|
+
( (__param(0, IEditorService))),
|
|
199
|
+
( (__param(1, IMenuService))),
|
|
200
|
+
( (__param(2, IExtensionService))),
|
|
201
|
+
( (__param(3, IInstantiationService))),
|
|
202
|
+
( (__param(4, IKeybindingService))),
|
|
203
|
+
( (__param(5, ICommandService))),
|
|
204
|
+
( (__param(6, ITelemetryService))),
|
|
205
|
+
( (__param(7, IDialogService))),
|
|
206
|
+
( (__param(8, IConfigurationService))),
|
|
207
|
+
( (__param(9, IEditorGroupsService))),
|
|
208
|
+
( (__param(10, IPreferencesService))),
|
|
209
|
+
( (__param(11, IProductService))),
|
|
210
|
+
( (__param(12, IAiRelatedInformationService))),
|
|
211
|
+
( (__param(13, IChatAgentService)))
|
|
212
|
+
], CommandsQuickAccessProvider)));
|
|
230
213
|
class ShowAllCommandsAction extends Action2 {
|
|
231
214
|
static { this.ID = 'workbench.action.showCommands'; }
|
|
232
215
|
constructor() {
|
|
233
216
|
super({
|
|
234
217
|
id: ShowAllCommandsAction.ID,
|
|
235
|
-
title: ( localize2WithPath(
|
|
236
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
237
|
-
'showTriggerActions',
|
|
238
|
-
'Show All Commands'
|
|
239
|
-
)),
|
|
218
|
+
title: ( localize2WithPath(_moduleId, 4, 'Show All Commands')),
|
|
240
219
|
keybinding: {
|
|
241
220
|
weight: 200 ,
|
|
242
221
|
when: undefined,
|
|
@@ -254,11 +233,7 @@ class ClearCommandHistoryAction extends Action2 {
|
|
|
254
233
|
constructor() {
|
|
255
234
|
super({
|
|
256
235
|
id: 'workbench.action.clearCommandHistory',
|
|
257
|
-
title: ( localize2WithPath(
|
|
258
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
259
|
-
'clearCommandHistory',
|
|
260
|
-
'Clear Command History'
|
|
261
|
-
)),
|
|
236
|
+
title: ( localize2WithPath(_moduleId, 5, 'Clear Command History')),
|
|
262
237
|
f1: true
|
|
263
238
|
});
|
|
264
239
|
}
|
|
@@ -271,20 +246,12 @@ class ClearCommandHistoryAction extends Action2 {
|
|
|
271
246
|
const { confirmed } = await dialogService.confirm({
|
|
272
247
|
type: 'warning',
|
|
273
248
|
message: ( localizeWithPath(
|
|
274
|
-
|
|
275
|
-
|
|
249
|
+
_moduleId,
|
|
250
|
+
6,
|
|
276
251
|
"Do you want to clear the history of recently used commands?"
|
|
277
252
|
)),
|
|
278
|
-
detail: ( localizeWithPath(
|
|
279
|
-
|
|
280
|
-
'confirmClearDetail',
|
|
281
|
-
"This action is irreversible!"
|
|
282
|
-
)),
|
|
283
|
-
primaryButton: ( localizeWithPath(
|
|
284
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
285
|
-
{ key: 'clearButtonLabel', comment: ['&& denotes a mnemonic'] },
|
|
286
|
-
"&&Clear"
|
|
287
|
-
))
|
|
253
|
+
detail: ( localizeWithPath(_moduleId, 7, "This action is irreversible!")),
|
|
254
|
+
primaryButton: ( localizeWithPath(_moduleId, 8, "&&Clear"))
|
|
288
255
|
});
|
|
289
256
|
if (!confirmed) {
|
|
290
257
|
return;
|