@codingame/monaco-vscode-quickaccess-service-override 25.1.2 → 26.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 +2 -2
- package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.js +121 -73
- package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.d.ts +3 -1
- package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.js +24 -17
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +63 -35
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +22 -15
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +82 -77
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +34 -27
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +63 -38
- package/vscode/src/vs/workbench/contrib/url/browser/externalUriResolver.js +6 -8
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainsFileSystemProvider.js +27 -23
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainsValidator.js +67 -56
- package/vscode/src/vs/workbench/contrib/url/browser/url.contribution.js +30 -12
- package/vscode/src/vs/workbench/services/quickinput/browser/quickInputService.js +18 -12
|
@@ -13,20 +13,24 @@ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codi
|
|
|
13
13
|
const globalQuickAccessKeybinding = {
|
|
14
14
|
primary: KeyMod.CtrlCmd | KeyCode.KeyP,
|
|
15
15
|
secondary: [KeyMod.CtrlCmd | KeyCode.KeyE],
|
|
16
|
-
mac: {
|
|
16
|
+
mac: {
|
|
17
|
+
primary: KeyMod.CtrlCmd | KeyCode.KeyP,
|
|
18
|
+
secondary: undefined
|
|
19
|
+
}
|
|
17
20
|
};
|
|
18
21
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
19
|
-
id:
|
|
22
|
+
id: "workbench.action.closeQuickOpen",
|
|
20
23
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
21
24
|
when: inQuickPickContext,
|
|
22
|
-
primary: KeyCode.Escape,
|
|
25
|
+
primary: KeyCode.Escape,
|
|
26
|
+
secondary: [KeyMod.Shift | KeyCode.Escape],
|
|
23
27
|
handler: accessor => {
|
|
24
28
|
const quickInputService = accessor.get(IQuickInputService);
|
|
25
29
|
return quickInputService.cancel(QuickInputHideReason.Gesture);
|
|
26
30
|
}
|
|
27
31
|
});
|
|
28
32
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
29
|
-
id:
|
|
33
|
+
id: "workbench.action.acceptSelectedQuickOpenItem",
|
|
30
34
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
31
35
|
when: inQuickPickContext,
|
|
32
36
|
primary: 0,
|
|
@@ -36,17 +40,20 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
36
40
|
}
|
|
37
41
|
});
|
|
38
42
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
39
|
-
id:
|
|
43
|
+
id: "workbench.action.alternativeAcceptSelectedQuickOpenItem",
|
|
40
44
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
41
45
|
when: inQuickPickContext,
|
|
42
46
|
primary: 0,
|
|
43
47
|
handler: accessor => {
|
|
44
48
|
const quickInputService = accessor.get(IQuickInputService);
|
|
45
|
-
return quickInputService.accept({
|
|
49
|
+
return quickInputService.accept({
|
|
50
|
+
ctrlCmd: true,
|
|
51
|
+
alt: false
|
|
52
|
+
});
|
|
46
53
|
}
|
|
47
54
|
});
|
|
48
55
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
49
|
-
id:
|
|
56
|
+
id: "workbench.action.focusQuickOpen",
|
|
50
57
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
51
58
|
when: inQuickPickContext,
|
|
52
59
|
primary: 0,
|
|
@@ -55,7 +62,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
55
62
|
quickInputService.focus();
|
|
56
63
|
}
|
|
57
64
|
});
|
|
58
|
-
const quickAccessNavigateNextInFilePickerId =
|
|
65
|
+
const quickAccessNavigateNextInFilePickerId = "workbench.action.quickOpenNavigateNextInFilePicker";
|
|
59
66
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
60
67
|
id: quickAccessNavigateNextInFilePickerId,
|
|
61
68
|
weight: KeybindingWeight.WorkbenchContrib + 50,
|
|
@@ -65,7 +72,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
65
72
|
secondary: globalQuickAccessKeybinding.secondary,
|
|
66
73
|
mac: globalQuickAccessKeybinding.mac
|
|
67
74
|
});
|
|
68
|
-
const quickAccessNavigatePreviousInFilePickerId =
|
|
75
|
+
const quickAccessNavigatePreviousInFilePickerId = "workbench.action.quickOpenNavigatePreviousInFilePicker";
|
|
69
76
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
70
77
|
id: quickAccessNavigatePreviousInFilePickerId,
|
|
71
78
|
weight: KeybindingWeight.WorkbenchContrib + 50,
|
|
@@ -79,7 +86,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
79
86
|
}
|
|
80
87
|
});
|
|
81
88
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
82
|
-
id:
|
|
89
|
+
id: "workbench.action.quickPickManyToggle",
|
|
83
90
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
84
91
|
when: inQuickPickContext,
|
|
85
92
|
primary: 0,
|
|
@@ -89,13 +96,19 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
89
96
|
}
|
|
90
97
|
});
|
|
91
98
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
92
|
-
id:
|
|
99
|
+
id: "workbench.action.quickInputBack",
|
|
93
100
|
weight: KeybindingWeight.WorkbenchContrib + 50,
|
|
94
101
|
when: inQuickPickContext,
|
|
95
102
|
primary: 0,
|
|
96
|
-
win: {
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
win: {
|
|
104
|
+
primary: KeyMod.Alt | KeyCode.LeftArrow
|
|
105
|
+
},
|
|
106
|
+
mac: {
|
|
107
|
+
primary: KeyMod.WinCtrl | KeyCode.Minus
|
|
108
|
+
},
|
|
109
|
+
linux: {
|
|
110
|
+
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Minus
|
|
111
|
+
},
|
|
99
112
|
handler: accessor => {
|
|
100
113
|
const quickInputService = accessor.get(IQuickInputService);
|
|
101
114
|
quickInputService.back();
|
|
@@ -104,16 +117,16 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
104
117
|
registerAction2(class QuickAccessAction extends Action2 {
|
|
105
118
|
constructor() {
|
|
106
119
|
super({
|
|
107
|
-
id:
|
|
108
|
-
title: ( localize2(
|
|
120
|
+
id: "workbench.action.quickOpen",
|
|
121
|
+
title: ( localize2(2915, "Go to File...")),
|
|
109
122
|
metadata: {
|
|
110
123
|
description: `Quick access`,
|
|
111
124
|
args: [{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
125
|
+
name: "prefix",
|
|
126
|
+
schema: {
|
|
127
|
+
"type": "string"
|
|
128
|
+
}
|
|
129
|
+
}]
|
|
117
130
|
},
|
|
118
131
|
keybinding: {
|
|
119
132
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
@@ -126,14 +139,16 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
126
139
|
}
|
|
127
140
|
run(accessor, prefix) {
|
|
128
141
|
const quickInputService = accessor.get(IQuickInputService);
|
|
129
|
-
quickInputService.quickAccess.show(typeof prefix ===
|
|
142
|
+
quickInputService.quickAccess.show(typeof prefix === "string" ? prefix : undefined, {
|
|
143
|
+
preserveValue: typeof prefix === "string"
|
|
144
|
+
});
|
|
130
145
|
}
|
|
131
146
|
});
|
|
132
147
|
registerAction2(class QuickAccessAction extends Action2 {
|
|
133
148
|
constructor() {
|
|
134
149
|
super({
|
|
135
|
-
id:
|
|
136
|
-
title: ( localize(
|
|
150
|
+
id: "workbench.action.quickOpenWithModes",
|
|
151
|
+
title: ( localize(2916, "Quick Open")),
|
|
137
152
|
icon: Codicon.search,
|
|
138
153
|
menu: {
|
|
139
154
|
id: MenuId.CommandCenterCenter,
|
|
@@ -145,7 +160,7 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
145
160
|
const quickInputService = accessor.get(IQuickInputService);
|
|
146
161
|
const providerOptions = {
|
|
147
162
|
includeHelp: true,
|
|
148
|
-
from:
|
|
163
|
+
from: "commandCenter"
|
|
149
164
|
};
|
|
150
165
|
quickInputService.quickAccess.show(undefined, {
|
|
151
166
|
preserveValue: true,
|
|
@@ -153,13 +168,20 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
153
168
|
});
|
|
154
169
|
}
|
|
155
170
|
});
|
|
156
|
-
CommandsRegistry.registerCommand(
|
|
171
|
+
CommandsRegistry.registerCommand("workbench.action.quickOpenPreviousEditor", async accessor => {
|
|
157
172
|
const quickInputService = accessor.get(IQuickInputService);
|
|
158
|
-
quickInputService.quickAccess.show(
|
|
173
|
+
quickInputService.quickAccess.show("", {
|
|
174
|
+
itemActivation: ItemActivation.SECOND
|
|
175
|
+
});
|
|
159
176
|
});
|
|
160
177
|
class BaseQuickAccessNavigateAction extends Action2 {
|
|
161
178
|
constructor(id, title, next, quickNavigate, keybinding) {
|
|
162
|
-
super({
|
|
179
|
+
super({
|
|
180
|
+
id,
|
|
181
|
+
title,
|
|
182
|
+
f1: true,
|
|
183
|
+
keybinding
|
|
184
|
+
});
|
|
163
185
|
this.id = id;
|
|
164
186
|
this.next = next;
|
|
165
187
|
this.quickNavigate = quickNavigate;
|
|
@@ -168,37 +190,43 @@ class BaseQuickAccessNavigateAction extends Action2 {
|
|
|
168
190
|
const keybindingService = accessor.get(IKeybindingService);
|
|
169
191
|
const quickInputService = accessor.get(IQuickInputService);
|
|
170
192
|
const keys = keybindingService.lookupKeybindings(this.id);
|
|
171
|
-
const quickNavigate = this.quickNavigate ? {
|
|
193
|
+
const quickNavigate = this.quickNavigate ? {
|
|
194
|
+
keybindings: keys
|
|
195
|
+
} : undefined;
|
|
172
196
|
quickInputService.navigate(this.next, quickNavigate);
|
|
173
197
|
}
|
|
174
198
|
}
|
|
175
199
|
class QuickAccessNavigateNextAction extends BaseQuickAccessNavigateAction {
|
|
176
200
|
constructor() {
|
|
177
|
-
super(
|
|
201
|
+
super("workbench.action.quickOpenNavigateNext", ( localize2(2917, "Navigate Next in Quick Open")), true, true);
|
|
178
202
|
}
|
|
179
203
|
}
|
|
180
204
|
class QuickAccessNavigatePreviousAction extends BaseQuickAccessNavigateAction {
|
|
181
205
|
constructor() {
|
|
182
|
-
super(
|
|
206
|
+
super("workbench.action.quickOpenNavigatePrevious", ( localize2(2918, "Navigate Previous in Quick Open")), false, true);
|
|
183
207
|
}
|
|
184
208
|
}
|
|
185
209
|
class QuickAccessSelectNextAction extends BaseQuickAccessNavigateAction {
|
|
186
210
|
constructor() {
|
|
187
|
-
super(
|
|
211
|
+
super("workbench.action.quickOpenSelectNext", ( localize2(2919, "Select Next in Quick Open")), true, false, {
|
|
188
212
|
weight: KeybindingWeight.WorkbenchContrib + 50,
|
|
189
213
|
when: inQuickPickContext,
|
|
190
214
|
primary: 0,
|
|
191
|
-
mac: {
|
|
215
|
+
mac: {
|
|
216
|
+
primary: KeyMod.WinCtrl | KeyCode.KeyN
|
|
217
|
+
}
|
|
192
218
|
});
|
|
193
219
|
}
|
|
194
220
|
}
|
|
195
221
|
class QuickAccessSelectPreviousAction extends BaseQuickAccessNavigateAction {
|
|
196
222
|
constructor() {
|
|
197
|
-
super(
|
|
223
|
+
super("workbench.action.quickOpenSelectPrevious", ( localize2(2920, "Select Previous in Quick Open")), false, false, {
|
|
198
224
|
weight: KeybindingWeight.WorkbenchContrib + 50,
|
|
199
225
|
when: inQuickPickContext,
|
|
200
226
|
primary: 0,
|
|
201
|
-
mac: {
|
|
227
|
+
mac: {
|
|
228
|
+
primary: KeyMod.WinCtrl | KeyCode.KeyP
|
|
229
|
+
}
|
|
202
230
|
});
|
|
203
231
|
}
|
|
204
232
|
}
|
package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js
CHANGED
|
@@ -46,24 +46,23 @@ let GotoLineQuickAccessProvider = class GotoLineQuickAccessProvider extends Abst
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
GotoLineQuickAccessProvider = ( __decorate([
|
|
50
|
-
( __param(0, IEditorService)),
|
|
51
|
-
( __param(1, IEditorGroupsService)),
|
|
52
|
-
( __param(2, IConfigurationService)),
|
|
53
|
-
( __param(3, IStorageService))
|
|
54
|
-
], GotoLineQuickAccessProvider));
|
|
49
|
+
GotoLineQuickAccessProvider = ( __decorate([( __param(0, IEditorService)), ( __param(1, IEditorGroupsService)), ( __param(2, IConfigurationService)), ( __param(3, IStorageService))], GotoLineQuickAccessProvider));
|
|
55
50
|
class GotoLineAction extends Action2 {
|
|
56
|
-
static {
|
|
51
|
+
static {
|
|
52
|
+
this.ID = "workbench.action.gotoLine";
|
|
53
|
+
}
|
|
57
54
|
constructor() {
|
|
58
55
|
super({
|
|
59
56
|
id: GotoLineAction.ID,
|
|
60
|
-
title: ( localize2(
|
|
57
|
+
title: ( localize2(6498, "Go to Line/Column...")),
|
|
61
58
|
f1: true,
|
|
62
59
|
keybinding: {
|
|
63
60
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
64
61
|
when: null,
|
|
65
62
|
primary: KeyMod.CtrlCmd | KeyCode.KeyG,
|
|
66
|
-
mac: {
|
|
63
|
+
mac: {
|
|
64
|
+
primary: KeyMod.WinCtrl | KeyCode.KeyG
|
|
65
|
+
}
|
|
67
66
|
}
|
|
68
67
|
});
|
|
69
68
|
}
|
|
@@ -76,17 +75,22 @@ registerAction2(GotoLineAction);
|
|
|
76
75
|
ctor: GotoLineQuickAccessProvider,
|
|
77
76
|
prefix: AbstractGotoLineQuickAccessProvider.GO_TO_LINE_PREFIX,
|
|
78
77
|
placeholder: ( localize(
|
|
79
|
-
|
|
78
|
+
6499,
|
|
80
79
|
"Type the line number and optional column to go to (e.g. :42:5 for line 42, column 5). Type :: to go to a character offset (e.g. ::1024 for character 1024 from the start of the file). Use negative values to navigate backwards."
|
|
81
80
|
)),
|
|
82
|
-
helpEntries: [{
|
|
81
|
+
helpEntries: [{
|
|
82
|
+
description: ( localize(6500, "Go to Line/Column")),
|
|
83
|
+
commandId: GotoLineAction.ID
|
|
84
|
+
}]
|
|
83
85
|
});
|
|
84
86
|
class GotoOffsetAction extends Action2 {
|
|
85
|
-
static {
|
|
87
|
+
static {
|
|
88
|
+
this.ID = "workbench.action.gotoOffset";
|
|
89
|
+
}
|
|
86
90
|
constructor() {
|
|
87
91
|
super({
|
|
88
92
|
id: GotoOffsetAction.ID,
|
|
89
|
-
title: ( localize2(
|
|
93
|
+
title: ( localize2(6501, "Go to Offset...")),
|
|
90
94
|
f1: true
|
|
91
95
|
});
|
|
92
96
|
}
|
|
@@ -99,10 +103,13 @@ registerAction2(GotoOffsetAction);
|
|
|
99
103
|
ctor: GotoLineQuickAccessProvider,
|
|
100
104
|
prefix: GotoLineQuickAccessProvider.GO_TO_OFFSET_PREFIX,
|
|
101
105
|
placeholder: ( localize(
|
|
102
|
-
|
|
106
|
+
6499,
|
|
103
107
|
"Type the line number and optional column to go to (e.g. :42:5 for line 42, column 5). Type :: to go to a character offset (e.g. ::1024 for character 1024 from the start of the file). Use negative values to navigate backwards."
|
|
104
108
|
)),
|
|
105
|
-
helpEntries: [{
|
|
109
|
+
helpEntries: [{
|
|
110
|
+
description: ( localize(6502, "Go to Offset")),
|
|
111
|
+
commandId: GotoOffsetAction.ID
|
|
112
|
+
}]
|
|
106
113
|
});
|
|
107
114
|
|
|
108
115
|
export { GotoLineQuickAccessProvider };
|
|
@@ -38,23 +38,46 @@ import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbe
|
|
|
38
38
|
|
|
39
39
|
var CommandsQuickAccessProvider_1;
|
|
40
40
|
let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends AbstractEditorCommandsQuickAccessProvider {
|
|
41
|
-
static {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
static {
|
|
42
|
+
CommandsQuickAccessProvider_1 = this;
|
|
43
|
+
}
|
|
44
|
+
static {
|
|
45
|
+
this.AI_RELATED_INFORMATION_MAX_PICKS = 5;
|
|
46
|
+
}
|
|
47
|
+
static {
|
|
48
|
+
this.AI_RELATED_INFORMATION_DEBOUNCE = 200;
|
|
49
|
+
}
|
|
50
|
+
get activeTextEditorControl() {
|
|
51
|
+
return this.editorService.activeTextEditorControl;
|
|
52
|
+
}
|
|
45
53
|
get defaultFilterValue() {
|
|
46
54
|
if (this.configuration.preserveInput) {
|
|
47
55
|
return DefaultQuickAccessFilterValue.LAST;
|
|
48
56
|
}
|
|
49
57
|
return undefined;
|
|
50
58
|
}
|
|
51
|
-
constructor(
|
|
59
|
+
constructor(
|
|
60
|
+
editorService,
|
|
61
|
+
menuService,
|
|
62
|
+
extensionService,
|
|
63
|
+
instantiationService,
|
|
64
|
+
keybindingService,
|
|
65
|
+
commandService,
|
|
66
|
+
telemetryService,
|
|
67
|
+
dialogService,
|
|
68
|
+
configurationService,
|
|
69
|
+
editorGroupService,
|
|
70
|
+
preferencesService,
|
|
71
|
+
productService,
|
|
72
|
+
aiRelatedInformationService,
|
|
73
|
+
chatAgentService
|
|
74
|
+
) {
|
|
52
75
|
super({
|
|
53
76
|
showAlias: !Language.isDefaultVariant(),
|
|
54
77
|
noResultsPick: () => ({
|
|
55
|
-
label: ( localize(
|
|
56
|
-
commandId:
|
|
57
|
-
})
|
|
78
|
+
label: ( localize(10508, "No matching commands")),
|
|
79
|
+
commandId: ""
|
|
80
|
+
})
|
|
58
81
|
}, instantiationService, keybindingService, commandService, telemetryService, dialogService);
|
|
59
82
|
this.editorService = editorService;
|
|
60
83
|
this.menuService = menuService;
|
|
@@ -66,7 +89,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
66
89
|
this.chatAgentService = chatAgentService;
|
|
67
90
|
this.useAiRelatedInfo = false;
|
|
68
91
|
this.extensionRegistrationRace = raceTimeout(extensionService.whenInstalledExtensionsRegistered(), 800);
|
|
69
|
-
this._register(configurationService.onDidChangeConfiguration(
|
|
92
|
+
this._register(configurationService.onDidChangeConfiguration(e => this.updateOptions(e)));
|
|
70
93
|
this.updateOptions();
|
|
71
94
|
}
|
|
72
95
|
get configuration() {
|
|
@@ -78,13 +101,11 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
78
101
|
};
|
|
79
102
|
}
|
|
80
103
|
updateOptions(e) {
|
|
81
|
-
if (e && !e.affectsConfiguration(
|
|
104
|
+
if (e && !e.affectsConfiguration("workbench.commandPalette.experimental")) {
|
|
82
105
|
return;
|
|
83
106
|
}
|
|
84
107
|
const config = this.configuration;
|
|
85
|
-
const suggestedCommandIds = config.experimental.suggestCommands && this.productService.commandPaletteSuggestedCommandIds?.length
|
|
86
|
-
? ( new Set(this.productService.commandPaletteSuggestedCommandIds))
|
|
87
|
-
: undefined;
|
|
108
|
+
const suggestedCommandIds = config.experimental.suggestCommands && this.productService.commandPaletteSuggestedCommandIds?.length ? ( new Set(this.productService.commandPaletteSuggestedCommandIds)) : undefined;
|
|
88
109
|
this.options.suggestedCommandIds = suggestedCommandIds;
|
|
89
110
|
this.useAiRelatedInfo = config.experimental.enableNaturalLanguageSearch;
|
|
90
111
|
}
|
|
@@ -93,26 +114,22 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
93
114
|
if (token.isCancellationRequested) {
|
|
94
115
|
return [];
|
|
95
116
|
}
|
|
96
|
-
return ([
|
|
97
|
-
...this.getCodeEditorCommandPicks(),
|
|
98
|
-
...this.getGlobalCommandPicks()
|
|
99
|
-
].map(picks => ({
|
|
117
|
+
return ([...this.getCodeEditorCommandPicks(), ...this.getGlobalCommandPicks()].map(picks => ({
|
|
100
118
|
...picks,
|
|
101
119
|
buttons: [{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
iconClass: ThemeIcon.asClassName(Codicon.gear),
|
|
121
|
+
tooltip: ( localize(10509, "Configure Keybinding"))
|
|
122
|
+
}],
|
|
105
123
|
trigger: () => {
|
|
106
|
-
this.preferencesService.openGlobalKeybindingSettings(false, {
|
|
124
|
+
this.preferencesService.openGlobalKeybindingSettings(false, {
|
|
125
|
+
query: createKeybindingCommandQuery(picks.commandId, picks.commandWhen)
|
|
126
|
+
});
|
|
107
127
|
return TriggerAction.CLOSE_PICKER;
|
|
108
|
-
}
|
|
128
|
+
}
|
|
109
129
|
})));
|
|
110
130
|
}
|
|
111
131
|
hasAdditionalCommandPicks(filter, token) {
|
|
112
|
-
if (!this.useAiRelatedInfo
|
|
113
|
-
|| token.isCancellationRequested
|
|
114
|
-
|| filter === ''
|
|
115
|
-
|| !this.aiRelatedInformationService.isEnabled()) {
|
|
132
|
+
if (!this.useAiRelatedInfo || token.isCancellationRequested || filter === "" || !this.aiRelatedInformationService.isEnabled()) {
|
|
116
133
|
return false;
|
|
117
134
|
}
|
|
118
135
|
return true;
|
|
@@ -125,29 +142,30 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
125
142
|
try {
|
|
126
143
|
await timeout(CommandsQuickAccessProvider_1.AI_RELATED_INFORMATION_DEBOUNCE, token);
|
|
127
144
|
additionalPicks = await this.getRelatedInformationPicks(allPicks, picksSoFar, filter, token);
|
|
128
|
-
}
|
|
129
|
-
catch (e) {
|
|
130
|
-
}
|
|
145
|
+
} catch (e) {}
|
|
131
146
|
if (this.configuration.showAskInChat) {
|
|
132
147
|
const defaultAgent = this.chatAgentService.getDefaultAgent(ChatAgentLocation.Chat);
|
|
133
148
|
if (defaultAgent) {
|
|
134
149
|
if (picksSoFar.length || additionalPicks.length) {
|
|
135
150
|
additionalPicks.push({
|
|
136
|
-
type:
|
|
151
|
+
type: "separator"
|
|
137
152
|
});
|
|
138
153
|
}
|
|
139
154
|
additionalPicks.push({
|
|
140
|
-
label: ( localize(
|
|
141
|
-
commandId: this.configuration.experimental.askChatLocation ===
|
|
155
|
+
label: ( localize(10510, "Ask in Chat: {0}", filter)),
|
|
156
|
+
commandId: this.configuration.experimental.askChatLocation === "quickChat" ? ASK_QUICK_QUESTION_ACTION_ID : CHAT_OPEN_ACTION_ID,
|
|
142
157
|
args: [filter],
|
|
143
158
|
buttons: [{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
159
|
+
iconClass: ThemeIcon.asClassName(Codicon.gear),
|
|
160
|
+
tooltip: ( localize(10511, "Configure visibility"))
|
|
161
|
+
}],
|
|
147
162
|
trigger: () => {
|
|
148
|
-
void this.preferencesService.openSettings({
|
|
163
|
+
void this.preferencesService.openSettings({
|
|
164
|
+
jsonEditor: false,
|
|
165
|
+
query: "workbench.commandPalette.showAskInChat"
|
|
166
|
+
});
|
|
149
167
|
return TriggerAction.CLOSE_PICKER;
|
|
150
|
-
}
|
|
168
|
+
}
|
|
151
169
|
});
|
|
152
170
|
}
|
|
153
171
|
}
|
|
@@ -173,58 +191,43 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
173
191
|
const globalCommandPicks = [];
|
|
174
192
|
const scopedContextKeyService = this.editorService.activeEditorPane?.scopedContextKeyService || this.editorGroupService.activeGroup.scopedContextKeyService;
|
|
175
193
|
const globalCommandsMenu = this.menuService.getMenuActions(MenuId.CommandPalette, scopedContextKeyService);
|
|
176
|
-
const globalCommandsMenuActions = globalCommandsMenu
|
|
177
|
-
.reduce((r, [, actions]) => [...r, ...actions], [])
|
|
178
|
-
.filter(action => action instanceof MenuItemAction && action.enabled);
|
|
194
|
+
const globalCommandsMenuActions = globalCommandsMenu.reduce((r, [, actions]) => [...r, ...actions], []).filter(action => action instanceof MenuItemAction && action.enabled);
|
|
179
195
|
for (const action of globalCommandsMenuActions) {
|
|
180
|
-
let label = (typeof action.item.title ===
|
|
181
|
-
const category = typeof action.item.category ===
|
|
196
|
+
let label = (typeof action.item.title === "string" ? action.item.title : action.item.title.value) || action.item.id;
|
|
197
|
+
const category = typeof action.item.category === "string" ? action.item.category : action.item.category?.value;
|
|
182
198
|
if (category) {
|
|
183
|
-
label = ( localize(
|
|
199
|
+
label = ( localize(10512, "{0}: {1}", category, label));
|
|
184
200
|
}
|
|
185
|
-
const aliasLabel = typeof action.item.title !==
|
|
186
|
-
const aliasCategory = (category && action.item.category && typeof action.item.category !==
|
|
187
|
-
const commandAlias = (aliasLabel && category) ?
|
|
188
|
-
aliasCategory ? `${aliasCategory}: ${aliasLabel}` : `${category}: ${aliasLabel}` :
|
|
189
|
-
aliasLabel;
|
|
201
|
+
const aliasLabel = typeof action.item.title !== "string" ? action.item.title.original : undefined;
|
|
202
|
+
const aliasCategory = (category && action.item.category && typeof action.item.category !== "string") ? action.item.category.original : undefined;
|
|
203
|
+
const commandAlias = (aliasLabel && category) ? aliasCategory ? `${aliasCategory}: ${aliasLabel}` : `${category}: ${aliasLabel}` : aliasLabel;
|
|
190
204
|
const metadataDescription = action.item.metadata?.description;
|
|
191
|
-
const commandDescription = metadataDescription === undefined || isLocalizedString(metadataDescription)
|
|
192
|
-
|
|
193
|
-
|
|
205
|
+
const commandDescription = metadataDescription === undefined || isLocalizedString(metadataDescription) ?
|
|
206
|
+
metadataDescription : {
|
|
207
|
+
value: metadataDescription,
|
|
208
|
+
original: metadataDescription
|
|
209
|
+
};
|
|
194
210
|
globalCommandPicks.push({
|
|
195
211
|
commandId: action.item.id,
|
|
196
212
|
commandWhen: action.item.precondition?.serialize(),
|
|
197
213
|
commandAlias,
|
|
198
214
|
label: stripIcons(label),
|
|
199
215
|
commandDescription,
|
|
200
|
-
commandCategory: category
|
|
216
|
+
commandCategory: category
|
|
201
217
|
});
|
|
202
218
|
}
|
|
203
219
|
return globalCommandPicks;
|
|
204
220
|
}
|
|
205
221
|
};
|
|
206
|
-
CommandsQuickAccessProvider = CommandsQuickAccessProvider_1 = ( __decorate([
|
|
207
|
-
( __param(0, IEditorService)),
|
|
208
|
-
( __param(1, IMenuService)),
|
|
209
|
-
( __param(2, IExtensionService)),
|
|
210
|
-
( __param(3, IInstantiationService)),
|
|
211
|
-
( __param(4, IKeybindingService)),
|
|
212
|
-
( __param(5, ICommandService)),
|
|
213
|
-
( __param(6, ITelemetryService)),
|
|
214
|
-
( __param(7, IDialogService)),
|
|
215
|
-
( __param(8, IConfigurationService)),
|
|
216
|
-
( __param(9, IEditorGroupsService)),
|
|
217
|
-
( __param(10, IPreferencesService)),
|
|
218
|
-
( __param(11, IProductService)),
|
|
219
|
-
( __param(12, IAiRelatedInformationService)),
|
|
220
|
-
( __param(13, IChatAgentService))
|
|
221
|
-
], CommandsQuickAccessProvider));
|
|
222
|
+
CommandsQuickAccessProvider = CommandsQuickAccessProvider_1 = ( __decorate([( __param(0, IEditorService)), ( __param(1, IMenuService)), ( __param(2, IExtensionService)), ( __param(3, IInstantiationService)), ( __param(4, IKeybindingService)), ( __param(5, ICommandService)), ( __param(6, ITelemetryService)), ( __param(7, IDialogService)), ( __param(8, IConfigurationService)), ( __param(9, IEditorGroupsService)), ( __param(10, IPreferencesService)), ( __param(11, IProductService)), ( __param(12, IAiRelatedInformationService)), ( __param(13, IChatAgentService))], CommandsQuickAccessProvider));
|
|
222
223
|
class ShowAllCommandsAction extends Action2 {
|
|
223
|
-
static {
|
|
224
|
+
static {
|
|
225
|
+
this.ID = "workbench.action.showCommands";
|
|
226
|
+
}
|
|
224
227
|
constructor() {
|
|
225
228
|
super({
|
|
226
229
|
id: ShowAllCommandsAction.ID,
|
|
227
|
-
title: ( localize2(
|
|
230
|
+
title: ( localize2(10513, "Show All Commands")),
|
|
228
231
|
keybinding: {
|
|
229
232
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
230
233
|
when: undefined,
|
|
@@ -241,8 +244,8 @@ class ShowAllCommandsAction extends Action2 {
|
|
|
241
244
|
class ClearCommandHistoryAction extends Action2 {
|
|
242
245
|
constructor() {
|
|
243
246
|
super({
|
|
244
|
-
id:
|
|
245
|
-
title: ( localize2(
|
|
247
|
+
id: "workbench.action.clearCommandHistory",
|
|
248
|
+
title: ( localize2(10514, "Clear Command History")),
|
|
246
249
|
f1: true
|
|
247
250
|
});
|
|
248
251
|
}
|
|
@@ -252,11 +255,13 @@ class ClearCommandHistoryAction extends Action2 {
|
|
|
252
255
|
const dialogService = accessor.get(IDialogService);
|
|
253
256
|
const commandHistoryLength = CommandsHistory.getConfiguredCommandHistoryLength(configurationService);
|
|
254
257
|
if (commandHistoryLength > 0) {
|
|
255
|
-
const {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
const {
|
|
259
|
+
confirmed
|
|
260
|
+
} = await dialogService.confirm({
|
|
261
|
+
type: "warning",
|
|
262
|
+
message: ( localize(10515, "Do you want to clear the history of recently used commands?")),
|
|
263
|
+
detail: ( localize(10516, "This action is irreversible!")),
|
|
264
|
+
primaryButton: ( localize(10517, "&&Clear"))
|
|
260
265
|
});
|
|
261
266
|
if (!confirmed) {
|
|
262
267
|
return;
|