@codingame/monaco-vscode-quickaccess-service-override 1.83.7 → 1.83.9

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.
@@ -0,0 +1,67 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
3
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
4
+ import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
5
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
6
+ import { Extensions } from 'monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js';
7
+ import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
8
+
9
+ var HelpQuickAccessProvider_1;
10
+ let HelpQuickAccessProvider = class HelpQuickAccessProvider {
11
+ static { HelpQuickAccessProvider_1 = this; }
12
+ static { this.PREFIX = '?'; }
13
+ constructor(quickInputService, keybindingService) {
14
+ this.quickInputService = quickInputService;
15
+ this.keybindingService = keybindingService;
16
+ this.registry = ( Registry.as(Extensions.Quickaccess));
17
+ }
18
+ provide(picker) {
19
+ const disposables = ( new DisposableStore());
20
+ disposables.add(picker.onDidAccept(() => {
21
+ const [item] = picker.selectedItems;
22
+ if (item) {
23
+ this.quickInputService.quickAccess.show(item.prefix, { preserveValue: true });
24
+ }
25
+ }));
26
+ disposables.add(picker.onDidChangeValue(value => {
27
+ const providerDescriptor = this.registry.getQuickAccessProvider(value.substr(HelpQuickAccessProvider_1.PREFIX.length));
28
+ if (providerDescriptor && providerDescriptor.prefix && providerDescriptor.prefix !== HelpQuickAccessProvider_1.PREFIX) {
29
+ this.quickInputService.quickAccess.show(providerDescriptor.prefix, { preserveValue: true });
30
+ }
31
+ }));
32
+ picker.items = this.getQuickAccessProviders().filter(p => p.prefix !== HelpQuickAccessProvider_1.PREFIX);
33
+ return disposables;
34
+ }
35
+ getQuickAccessProviders() {
36
+ const providers = this.registry
37
+ .getQuickAccessProviders()
38
+ .sort((providerA, providerB) => providerA.prefix.localeCompare(providerB.prefix))
39
+ .flatMap(provider => this.createPicks(provider));
40
+ return providers;
41
+ }
42
+ 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}",
54
+ label,
55
+ helpEntry.description
56
+ )),
57
+ description: helpEntry.description
58
+ };
59
+ }));
60
+ }
61
+ };
62
+ HelpQuickAccessProvider = HelpQuickAccessProvider_1 = ( __decorate([
63
+ ( __param(0, IQuickInputService)),
64
+ ( __param(1, IKeybindingService))
65
+ ], HelpQuickAccessProvider));
66
+
67
+ export { HelpQuickAccessProvider };
@@ -0,0 +1,231 @@
1
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
2
+ import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
3
+ import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
4
+ import { IQuickInputService, ItemActivation } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
5
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
6
+ import { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
7
+ import { inQuickPickContext, getQuickNavigateHandler, defaultQuickAccessContext } from 'vscode/vscode/vs/workbench/browser/quickaccess';
8
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
9
+
10
+ const globalQuickAccessKeybinding = {
11
+ primary: 2048 | 46 ,
12
+ secondary: [2048 | 35 ],
13
+ mac: { primary: 2048 | 46 , secondary: undefined }
14
+ };
15
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
16
+ id: 'workbench.action.closeQuickOpen',
17
+ weight: 200 ,
18
+ when: inQuickPickContext,
19
+ primary: 9 , secondary: [1024 | 9 ],
20
+ handler: accessor => {
21
+ const quickInputService = accessor.get(IQuickInputService);
22
+ return quickInputService.cancel();
23
+ }
24
+ });
25
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
26
+ id: 'workbench.action.acceptSelectedQuickOpenItem',
27
+ weight: 200 ,
28
+ when: inQuickPickContext,
29
+ primary: 0,
30
+ handler: accessor => {
31
+ const quickInputService = accessor.get(IQuickInputService);
32
+ return quickInputService.accept();
33
+ }
34
+ });
35
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
36
+ id: 'workbench.action.alternativeAcceptSelectedQuickOpenItem',
37
+ weight: 200 ,
38
+ when: inQuickPickContext,
39
+ primary: 0,
40
+ handler: accessor => {
41
+ const quickInputService = accessor.get(IQuickInputService);
42
+ return quickInputService.accept({ ctrlCmd: true, alt: false });
43
+ }
44
+ });
45
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
46
+ id: 'workbench.action.focusQuickOpen',
47
+ weight: 200 ,
48
+ when: inQuickPickContext,
49
+ primary: 0,
50
+ handler: accessor => {
51
+ const quickInputService = accessor.get(IQuickInputService);
52
+ quickInputService.focus();
53
+ }
54
+ });
55
+ const quickAccessNavigateNextInFilePickerId = 'workbench.action.quickOpenNavigateNextInFilePicker';
56
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
57
+ id: quickAccessNavigateNextInFilePickerId,
58
+ weight: 200 + 50,
59
+ handler: getQuickNavigateHandler(quickAccessNavigateNextInFilePickerId, true),
60
+ when: defaultQuickAccessContext,
61
+ primary: globalQuickAccessKeybinding.primary,
62
+ secondary: globalQuickAccessKeybinding.secondary,
63
+ mac: globalQuickAccessKeybinding.mac
64
+ });
65
+ const quickAccessNavigatePreviousInFilePickerId = 'workbench.action.quickOpenNavigatePreviousInFilePicker';
66
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
67
+ id: quickAccessNavigatePreviousInFilePickerId,
68
+ weight: 200 + 50,
69
+ handler: getQuickNavigateHandler(quickAccessNavigatePreviousInFilePickerId, false),
70
+ when: defaultQuickAccessContext,
71
+ primary: globalQuickAccessKeybinding.primary | 1024 ,
72
+ secondary: [globalQuickAccessKeybinding.secondary[0] | 1024 ],
73
+ mac: {
74
+ primary: globalQuickAccessKeybinding.mac.primary | 1024 ,
75
+ secondary: undefined
76
+ }
77
+ });
78
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
79
+ id: 'workbench.action.quickPickManyToggle',
80
+ weight: 200 ,
81
+ when: inQuickPickContext,
82
+ primary: 0,
83
+ handler: accessor => {
84
+ const quickInputService = accessor.get(IQuickInputService);
85
+ quickInputService.toggle();
86
+ }
87
+ });
88
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
89
+ id: 'workbench.action.quickInputBack',
90
+ weight: 200 + 50,
91
+ when: inQuickPickContext,
92
+ primary: 0,
93
+ win: { primary: 512 | 15 },
94
+ mac: { primary: 256 | 88 },
95
+ linux: { primary: 2048 | 512 | 88 },
96
+ handler: accessor => {
97
+ const quickInputService = accessor.get(IQuickInputService);
98
+ quickInputService.back();
99
+ }
100
+ });
101
+ registerAction2(class QuickAccessAction extends Action2 {
102
+ constructor() {
103
+ super({
104
+ id: 'workbench.action.quickOpen',
105
+ title: {
106
+ value: ( localizeWithPath(
107
+ 'vs/workbench/browser/actions/quickAccessActions',
108
+ 'quickOpen',
109
+ "Go to File..."
110
+ )),
111
+ original: 'Go to File...'
112
+ },
113
+ description: {
114
+ description: `Quick access`,
115
+ args: [{
116
+ name: 'prefix',
117
+ schema: {
118
+ 'type': 'string'
119
+ }
120
+ }]
121
+ },
122
+ keybinding: {
123
+ weight: 200 ,
124
+ primary: globalQuickAccessKeybinding.primary,
125
+ secondary: globalQuickAccessKeybinding.secondary,
126
+ mac: globalQuickAccessKeybinding.mac
127
+ },
128
+ f1: true
129
+ });
130
+ }
131
+ run(accessor, prefix) {
132
+ const quickInputService = accessor.get(IQuickInputService);
133
+ quickInputService.quickAccess.show(typeof prefix === 'string' ? prefix : undefined, { preserveValue: typeof prefix === 'string' });
134
+ }
135
+ });
136
+ registerAction2(class QuickAccessAction extends Action2 {
137
+ constructor() {
138
+ super({
139
+ id: 'workbench.action.quickOpenWithModes',
140
+ title: ( localizeWithPath(
141
+ 'vs/workbench/browser/actions/quickAccessActions',
142
+ 'quickOpenWithModes',
143
+ "Quick Open"
144
+ )),
145
+ icon: Codicon.search,
146
+ menu: {
147
+ id: MenuId.CommandCenterCenter,
148
+ order: 100
149
+ }
150
+ });
151
+ }
152
+ run(accessor) {
153
+ const quickInputService = accessor.get(IQuickInputService);
154
+ quickInputService.quickAccess.show(undefined, {
155
+ preserveValue: true,
156
+ providerOptions: {
157
+ includeHelp: true,
158
+ from: 'commandCenter',
159
+ }
160
+ });
161
+ }
162
+ });
163
+ CommandsRegistry.registerCommand('workbench.action.quickOpenPreviousEditor', async (accessor) => {
164
+ const quickInputService = accessor.get(IQuickInputService);
165
+ quickInputService.quickAccess.show('', { itemActivation: ItemActivation.SECOND });
166
+ });
167
+ class BaseQuickAccessNavigateAction extends Action2 {
168
+ constructor(id, title, next, quickNavigate, keybinding) {
169
+ super({ id, title, f1: true, keybinding });
170
+ this.id = id;
171
+ this.next = next;
172
+ this.quickNavigate = quickNavigate;
173
+ }
174
+ async run(accessor) {
175
+ const keybindingService = accessor.get(IKeybindingService);
176
+ const quickInputService = accessor.get(IQuickInputService);
177
+ const keys = keybindingService.lookupKeybindings(this.id);
178
+ const quickNavigate = this.quickNavigate ? { keybindings: keys } : undefined;
179
+ quickInputService.navigate(this.next, quickNavigate);
180
+ }
181
+ }
182
+ class QuickAccessNavigateNextAction extends BaseQuickAccessNavigateAction {
183
+ constructor() {
184
+ super('workbench.action.quickOpenNavigateNext', { value: ( localizeWithPath(
185
+ 'vs/workbench/browser/actions/quickAccessActions',
186
+ 'quickNavigateNext',
187
+ "Navigate Next in Quick Open"
188
+ )), original: 'Navigate Next in Quick Open' }, true, true);
189
+ }
190
+ }
191
+ class QuickAccessNavigatePreviousAction extends BaseQuickAccessNavigateAction {
192
+ constructor() {
193
+ super('workbench.action.quickOpenNavigatePrevious', { value: ( localizeWithPath(
194
+ 'vs/workbench/browser/actions/quickAccessActions',
195
+ 'quickNavigatePrevious',
196
+ "Navigate Previous in Quick Open"
197
+ )), original: 'Navigate Previous in Quick Open' }, false, true);
198
+ }
199
+ }
200
+ class QuickAccessSelectNextAction extends BaseQuickAccessNavigateAction {
201
+ constructor() {
202
+ super('workbench.action.quickOpenSelectNext', { value: ( localizeWithPath(
203
+ 'vs/workbench/browser/actions/quickAccessActions',
204
+ 'quickSelectNext',
205
+ "Select Next in Quick Open"
206
+ )), original: 'Select Next in Quick Open' }, true, false, {
207
+ weight: 200 + 50,
208
+ when: inQuickPickContext,
209
+ primary: 0,
210
+ mac: { primary: 256 | 44 }
211
+ });
212
+ }
213
+ }
214
+ class QuickAccessSelectPreviousAction extends BaseQuickAccessNavigateAction {
215
+ constructor() {
216
+ super('workbench.action.quickOpenSelectPrevious', { value: ( localizeWithPath(
217
+ 'vs/workbench/browser/actions/quickAccessActions',
218
+ 'quickSelectPrevious',
219
+ "Select Previous in Quick Open"
220
+ )), original: 'Select Previous in Quick Open' }, false, false, {
221
+ weight: 200 + 50,
222
+ when: inQuickPickContext,
223
+ primary: 0,
224
+ mac: { primary: 256 | 46 }
225
+ });
226
+ }
227
+ }
228
+ registerAction2(QuickAccessSelectNextAction);
229
+ registerAction2(QuickAccessSelectPreviousAction);
230
+ registerAction2(QuickAccessNavigateNextAction);
231
+ registerAction2(QuickAccessNavigatePreviousAction);
@@ -0,0 +1,3 @@
1
+ const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open';
2
+
3
+ export { CHAT_OPEN_ACTION_ID };
@@ -0,0 +1,88 @@
1
+ import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
2
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
3
+ import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
4
+ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
5
+ import { AbstractGotoLineQuickAccessProvider } from 'vscode/vscode/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess';
6
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
7
+ import { Extensions } from 'monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js';
8
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
9
+ import { Action2, registerAction2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
10
+ import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
11
+
12
+ let GotoLineQuickAccessProvider = class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {
13
+ constructor(editorService, editorGroupService, configurationService) {
14
+ super();
15
+ this.editorService = editorService;
16
+ this.editorGroupService = editorGroupService;
17
+ this.configurationService = configurationService;
18
+ this.onDidActiveTextEditorControlChange = this.editorService.onDidActiveEditorChange;
19
+ }
20
+ get configuration() {
21
+ const editorConfig = this.configurationService.getValue().workbench?.editor;
22
+ return {
23
+ openEditorPinned: !editorConfig?.enablePreviewFromQuickOpen || !editorConfig?.enablePreview
24
+ };
25
+ }
26
+ get activeTextEditorControl() {
27
+ return this.editorService.activeTextEditorControl;
28
+ }
29
+ gotoLocation(context, options) {
30
+ if ((options.keyMods.alt || (this.configuration.openEditorPinned && options.keyMods.ctrlCmd) || options.forceSideBySide) && this.editorService.activeEditor) {
31
+ context.restoreViewState?.();
32
+ const editorOptions = {
33
+ selection: options.range,
34
+ pinned: options.keyMods.ctrlCmd || this.configuration.openEditorPinned,
35
+ preserveFocus: options.preserveFocus
36
+ };
37
+ this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor, editorOptions);
38
+ }
39
+ else {
40
+ super.gotoLocation(context, options);
41
+ }
42
+ }
43
+ };
44
+ GotoLineQuickAccessProvider = ( __decorate([
45
+ ( __param(0, IEditorService)),
46
+ ( __param(1, IEditorGroupsService)),
47
+ ( __param(2, IConfigurationService))
48
+ ], GotoLineQuickAccessProvider));
49
+ class GotoLineAction extends Action2 {
50
+ static { this.ID = 'workbench.action.gotoLine'; }
51
+ constructor() {
52
+ super({
53
+ id: GotoLineAction.ID,
54
+ title: { value: ( localizeWithPath(
55
+ 'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess',
56
+ 'gotoLine',
57
+ "Go to Line/Column..."
58
+ )), original: 'Go to Line/Column...' },
59
+ f1: true,
60
+ keybinding: {
61
+ weight: 200 ,
62
+ when: null,
63
+ primary: 2048 | 37 ,
64
+ mac: { primary: 256 | 37 }
65
+ }
66
+ });
67
+ }
68
+ async run(accessor) {
69
+ accessor.get(IQuickInputService).quickAccess.show(GotoLineQuickAccessProvider.PREFIX);
70
+ }
71
+ }
72
+ registerAction2(GotoLineAction);
73
+ ( Registry.as(Extensions.Quickaccess)).registerQuickAccessProvider({
74
+ ctor: GotoLineQuickAccessProvider,
75
+ prefix: AbstractGotoLineQuickAccessProvider.PREFIX,
76
+ placeholder: ( localizeWithPath(
77
+ 'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess',
78
+ 'gotoLineQuickAccessPlaceholder',
79
+ "Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."
80
+ )),
81
+ helpEntries: [{ description: ( localizeWithPath(
82
+ 'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess',
83
+ 'gotoLineQuickAccess',
84
+ "Go to Line/Column"
85
+ )), commandId: GotoLineAction.ID }]
86
+ });
87
+
88
+ export { GotoLineQuickAccessProvider };