@codingame/monaco-vscode-quickaccess-service-override 4.5.1 → 5.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-quickaccess-service-override",
3
- "version": "4.5.1",
3
+ "version": "5.0.0",
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.1"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@5.0.0"
30
30
  }
31
31
  }
@@ -1,4 +1,5 @@
1
1
  import { stripIcons } from 'vscode/vscode/vs/base/common/iconLabels';
2
+ import { isLocalizedString } from 'vscode/vscode/vs/platform/action/common/action';
2
3
  import { AbstractCommandsQuickAccessProvider } from '../../../../platform/quickinput/browser/commandsQuickAccess.js';
3
4
 
4
5
  class AbstractEditorCommandsQuickAccessProvider extends AbstractCommandsQuickAccessProvider {
@@ -12,9 +13,19 @@ class AbstractEditorCommandsQuickAccessProvider extends AbstractCommandsQuickAcc
12
13
  }
13
14
  const editorCommandPicks = [];
14
15
  for (const editorAction of activeTextEditorControl.getSupportedActions()) {
16
+ let commandDescription;
17
+ if (editorAction.metadata?.description) {
18
+ if (isLocalizedString(editorAction.metadata.description)) {
19
+ commandDescription = editorAction.metadata.description;
20
+ }
21
+ else {
22
+ commandDescription = { original: editorAction.metadata.description, value: editorAction.metadata.description };
23
+ }
24
+ }
15
25
  editorCommandPicks.push({
16
26
  commandId: editorAction.id,
17
27
  commandAlias: editorAction.alias,
28
+ commandDescription,
18
29
  label: stripIcons(editorAction.label) || editorAction.id,
19
30
  });
20
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 ( provider.helpEntries.map(helpEntry => {
44
- const prefix = helpEntry.prefix || provider.prefix;
45
- const label = prefix || '\u2026' ;
46
- return {
47
- prefix,
48
- label,
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.description
56
- )),
57
- description: helpEntry.description
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,
@@ -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
- 'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess',
78
- 'gotoLineQuickAccessPlaceholder',
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 };
@@ -31,9 +31,11 @@ import { IAiRelatedInformationService } from 'vscode/vscode/vs/workbench/service
31
31
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
32
32
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
33
33
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
34
+ import { createKeybindingCommandQuery } from 'vscode/vscode/vs/workbench/services/preferences/browser/keybindingsEditorModel';
34
35
  import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences.service';
35
36
 
36
37
  var CommandsQuickAccessProvider_1;
38
+ const _moduleId = "vs/workbench/contrib/quickaccess/browser/commandsQuickAccess";
37
39
  let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends AbstractEditorCommandsQuickAccessProvider {
38
40
  static { CommandsQuickAccessProvider_1 = this; }
39
41
  static { this.AI_RELATED_INFORMATION_MAX_PICKS = 5; }
@@ -50,11 +52,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
50
52
  super({
51
53
  showAlias: !Language.isDefaultVariant(),
52
54
  noResultsPick: () => ({
53
- label: ( localizeWithPath(
54
- 'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
55
- 'noCommandResults',
56
- "No matching commands"
57
- )),
55
+ label: ( localizeWithPath(_moduleId, 0, "No matching commands")),
58
56
  commandId: ''
59
57
  }),
60
58
  }, instantiationService, keybindingService, commandService, telemetryService, dialogService);
@@ -85,7 +83,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
85
83
  }
86
84
  const config = this.configuration;
87
85
  const suggestedCommandIds = config.experimental.suggestCommands && this.productService.commandPaletteSuggestedCommandIds?.length
88
- ? ( new Set(this.productService.commandPaletteSuggestedCommandIds))
86
+ ? ( (new Set(this.productService.commandPaletteSuggestedCommandIds)))
89
87
  : undefined;
90
88
  this.options.suggestedCommandIds = suggestedCommandIds;
91
89
  this.useAiRelatedInfo = config.experimental.enableNaturalLanguageSearch;
@@ -95,24 +93,22 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
95
93
  if (token.isCancellationRequested) {
96
94
  return [];
97
95
  }
98
- return ( [
99
- ...this.getCodeEditorCommandPicks(),
100
- ...this.getGlobalCommandPicks()
101
- ].map(picks => ({
102
- ...picks,
103
- buttons: [{
104
- iconClass: ThemeIcon.asClassName(Codicon.gear),
105
- tooltip: ( localizeWithPath(
106
- 'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
107
- 'configure keybinding',
108
- "Configure Keybinding"
109
- )),
110
- }],
111
- trigger: () => {
112
- this.preferencesService.openGlobalKeybindingSettings(false, { query: `@command:${picks.commandId}` });
113
- return TriggerAction.CLOSE_PICKER;
114
- },
115
- })));
96
+ return (
97
+ ([
98
+ ...this.getCodeEditorCommandPicks(),
99
+ ...this.getGlobalCommandPicks()
100
+ ].map(picks => ({
101
+ ...picks,
102
+ buttons: [{
103
+ iconClass: ThemeIcon.asClassName(Codicon.gear),
104
+ tooltip: ( localizeWithPath(_moduleId, 1, "Configure Keybinding")),
105
+ }],
106
+ trigger: () => {
107
+ this.preferencesService.openGlobalKeybindingSettings(false, { query: createKeybindingCommandQuery(picks.commandId, picks.commandWhen) });
108
+ return TriggerAction.CLOSE_PICKER;
109
+ },
110
+ })))
111
+ );
116
112
  }
117
113
  hasAdditionalCommandPicks(filter, token) {
118
114
  if (!this.useAiRelatedInfo
@@ -143,13 +139,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
143
139
  const defaultAgent = this.chatAgentService.getDefaultAgent(ChatAgentLocation.Panel);
144
140
  if (defaultAgent) {
145
141
  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
- )),
142
+ label: ( localizeWithPath(_moduleId, 2, "Ask {0}: {1}", defaultAgent.metadata.fullName, filter)),
153
143
  commandId: this.configuration.experimental.askChatLocation === 'quickChat' ? ASK_QUICK_QUESTION_ACTION_ID : CHAT_OPEN_ACTION_ID,
154
144
  args: [filter]
155
145
  });
@@ -159,13 +149,13 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
159
149
  async getRelatedInformationPicks(allPicks, picksSoFar, filter, token) {
160
150
  const relatedInformation = await this.aiRelatedInformationService.getRelatedInformation(filter, [RelatedInformationType.CommandInformation], token);
161
151
  relatedInformation.sort((a, b) => b.weight - a.weight);
162
- const setOfPicksSoFar = ( new Set(( picksSoFar.map(p => p.commandId))));
163
- const additionalPicks = ( new Array());
152
+ const setOfPicksSoFar = ( (new Set( (picksSoFar.map(p => p.commandId)))));
153
+ const additionalPicks = ( (new Array()));
164
154
  for (const info of relatedInformation) {
165
155
  if (info.weight < CommandsQuickAccessProvider_1.AI_RELATED_INFORMATION_THRESHOLD || additionalPicks.length === CommandsQuickAccessProvider_1.AI_RELATED_INFORMATION_MAX_PICKS) {
166
156
  break;
167
157
  }
168
- const pick = allPicks.find(p => p.commandId === info.command && !( setOfPicksSoFar.has(p.commandId)));
158
+ const pick = allPicks.find(p => p.commandId === info.command && !( (setOfPicksSoFar.has(p.commandId))));
169
159
  if (pick) {
170
160
  additionalPicks.push(pick);
171
161
  }
@@ -183,13 +173,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
183
173
  let label = (typeof action.item.title === 'string' ? action.item.title : action.item.title.value) || action.item.id;
184
174
  const category = typeof action.item.category === 'string' ? action.item.category : action.item.category?.value;
185
175
  if (category) {
186
- label = ( localizeWithPath(
187
- 'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
188
- 'commandWithCategory',
189
- "{0}: {1}",
190
- category,
191
- label
192
- ));
176
+ label = ( localizeWithPath(_moduleId, 3, "{0}: {1}", category, label));
193
177
  }
194
178
  const aliasLabel = typeof action.item.title !== 'string' ? action.item.title.original : undefined;
195
179
  const aliasCategory = (category && action.item.category && typeof action.item.category !== 'string') ? action.item.category.original : undefined;
@@ -202,6 +186,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
202
186
  : { value: metadataDescription, original: metadataDescription };
203
187
  globalCommandPicks.push({
204
188
  commandId: action.item.id,
189
+ commandWhen: action.item.precondition?.serialize(),
205
190
  commandAlias,
206
191
  label: stripIcons(label),
207
192
  commandDescription,
@@ -211,32 +196,28 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
211
196
  return globalCommandPicks;
212
197
  }
213
198
  };
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));
199
+ CommandsQuickAccessProvider = CommandsQuickAccessProvider_1 = ( (__decorate([
200
+ ( (__param(0, IEditorService))),
201
+ ( (__param(1, IMenuService))),
202
+ ( (__param(2, IExtensionService))),
203
+ ( (__param(3, IInstantiationService))),
204
+ ( (__param(4, IKeybindingService))),
205
+ ( (__param(5, ICommandService))),
206
+ ( (__param(6, ITelemetryService))),
207
+ ( (__param(7, IDialogService))),
208
+ ( (__param(8, IConfigurationService))),
209
+ ( (__param(9, IEditorGroupsService))),
210
+ ( (__param(10, IPreferencesService))),
211
+ ( (__param(11, IProductService))),
212
+ ( (__param(12, IAiRelatedInformationService))),
213
+ ( (__param(13, IChatAgentService)))
214
+ ], CommandsQuickAccessProvider)));
230
215
  class ShowAllCommandsAction extends Action2 {
231
216
  static { this.ID = 'workbench.action.showCommands'; }
232
217
  constructor() {
233
218
  super({
234
219
  id: ShowAllCommandsAction.ID,
235
- title: ( localize2WithPath(
236
- 'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
237
- 'showTriggerActions',
238
- 'Show All Commands'
239
- )),
220
+ title: ( localize2WithPath(_moduleId, 4, 'Show All Commands')),
240
221
  keybinding: {
241
222
  weight: 200 ,
242
223
  when: undefined,
@@ -254,11 +235,7 @@ class ClearCommandHistoryAction extends Action2 {
254
235
  constructor() {
255
236
  super({
256
237
  id: 'workbench.action.clearCommandHistory',
257
- title: ( localize2WithPath(
258
- 'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
259
- 'clearCommandHistory',
260
- 'Clear Command History'
261
- )),
238
+ title: ( localize2WithPath(_moduleId, 5, 'Clear Command History')),
262
239
  f1: true
263
240
  });
264
241
  }
@@ -271,20 +248,12 @@ class ClearCommandHistoryAction extends Action2 {
271
248
  const { confirmed } = await dialogService.confirm({
272
249
  type: 'warning',
273
250
  message: ( localizeWithPath(
274
- 'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
275
- 'confirmClearMessage',
251
+ _moduleId,
252
+ 6,
276
253
  "Do you want to clear the history of recently used commands?"
277
254
  )),
278
- detail: ( localizeWithPath(
279
- 'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
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
- ))
255
+ detail: ( localizeWithPath(_moduleId, 7, "This action is irreversible!")),
256
+ primaryButton: ( localizeWithPath(_moduleId, 8, "&&Clear"))
288
257
  });
289
258
  if (!confirmed) {
290
259
  return;