@codingame/monaco-vscode-quickaccess-service-override 23.3.0 → 24.1.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/index.js +2 -2
- package/package.json +2 -9
- package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.d.ts +2 -8
- package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.js +49 -36
- package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +29 -6
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +13 -13
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +14 -14
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +11 -11
- package/vscode/src/vs/workbench/contrib/url/browser/externalUriResolver.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/url/browser/externalUriResolver.js +1 -1
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainsFileSystemProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainsValidator.js +6 -6
- package/vscode/src/vs/workbench/contrib/url/browser/url.contribution.js +5 -5
- package/vscode/src/vs/workbench/services/quickinput/browser/quickInputService.js +1 -1
- package/vscode/src/vs/base/common/normalization.d.ts +0 -3
- package/vscode/src/vs/base/common/normalization.js +0 -34
package/index.js
CHANGED
|
@@ -12,11 +12,11 @@ import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/edito
|
|
|
12
12
|
import { StandaloneCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneCodeEditor';
|
|
13
13
|
import { CommandsQuickAccessProvider } from './vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js';
|
|
14
14
|
import './vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js';
|
|
15
|
-
import '@codingame/monaco-vscode-
|
|
15
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess';
|
|
16
16
|
import './vscode/src/vs/workbench/browser/actions/quickAccessActions.js';
|
|
17
17
|
import './vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js';
|
|
18
18
|
import './vscode/src/vs/workbench/contrib/url/browser/url.contribution.js';
|
|
19
|
-
import '@codingame/monaco-vscode-
|
|
19
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/workbench.contribution';
|
|
20
20
|
|
|
21
21
|
let isKeybindingConfigurationVisible = () => {
|
|
22
22
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-quickaccess-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - quickaccess service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,14 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-
|
|
19
|
-
"@codingame/monaco-vscode-3b5a5cd1-d4ff-500a-b609-57e0cd4afa0a-common": "23.3.0",
|
|
20
|
-
"@codingame/monaco-vscode-40cada32-7e9c-528a-81fc-766e4da54147-common": "23.3.0",
|
|
21
|
-
"@codingame/monaco-vscode-4bf376c2-03c7-58cb-8303-c67aeefa3d3d-common": "23.3.0",
|
|
22
|
-
"@codingame/monaco-vscode-9a1a5840-af83-5d07-a156-ba32a36c5c4b-common": "23.3.0",
|
|
23
|
-
"@codingame/monaco-vscode-api": "23.3.0",
|
|
24
|
-
"@codingame/monaco-vscode-d609a7d3-bf87-551a-884f-550a8b327ec5-common": "23.3.0",
|
|
25
|
-
"@codingame/monaco-vscode-eda30bac-0984-5b42-9362-c68996b85232-common": "23.3.0"
|
|
18
|
+
"@codingame/monaco-vscode-api": "24.1.0"
|
|
26
19
|
},
|
|
27
20
|
"main": "index.js",
|
|
28
21
|
"module": "index.js",
|
|
@@ -7,7 +7,7 @@ import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
7
7
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
8
8
|
import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
9
9
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
10
|
-
import { FastAndSlowPicks, IPickerQuickAccessItem, IPickerQuickAccessProviderOptions, PickerQuickAccessProvider, Picks } from "@codingame/monaco-vscode-
|
|
10
|
+
import { FastAndSlowPicks, IPickerQuickAccessItem, IPickerQuickAccessProviderOptions, PickerQuickAccessProvider, Picks } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/browser/pickerQuickAccess";
|
|
11
11
|
import { IQuickAccessProviderRunOptions } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickAccess";
|
|
12
12
|
import { IQuickPickSeparator } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
13
13
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
@@ -20,8 +20,6 @@ export interface ICommandQuickPick extends IPickerQuickAccessItem {
|
|
|
20
20
|
readonly commandCategory?: string;
|
|
21
21
|
readonly args?: unknown[];
|
|
22
22
|
tfIdfScore?: number;
|
|
23
|
-
labelNoAccents?: string;
|
|
24
|
-
aliasNoAccents?: string;
|
|
25
23
|
}
|
|
26
24
|
export interface ICommandsQuickAccessOptions extends IPickerQuickAccessProviderOptions<ICommandQuickPick> {
|
|
27
25
|
readonly showAlias: boolean;
|
|
@@ -42,11 +40,6 @@ export declare abstract class AbstractCommandsQuickAccessProvider extends Picker
|
|
|
42
40
|
protected _getPicks(filter: string, _disposables: DisposableStore, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): Promise<Picks<ICommandQuickPick> | FastAndSlowPicks<ICommandQuickPick>>;
|
|
43
41
|
private toCommandPick;
|
|
44
42
|
private getTfIdfChunk;
|
|
45
|
-
/**
|
|
46
|
-
* Normalizes a string for filtering by removing accents, but only if
|
|
47
|
-
* the result has the same length, otherwise returns the original string.
|
|
48
|
-
*/
|
|
49
|
-
private normalizeForFiltering;
|
|
50
43
|
protected abstract getCommandPicks(token: CancellationToken): Promise<Array<ICommandQuickPick>>;
|
|
51
44
|
protected abstract hasAdditionalCommandPicks(filter: string, token: CancellationToken): boolean;
|
|
52
45
|
protected abstract getAdditionalCommandPicks(allPicks: ICommandQuickPick[], picksSoFar: ICommandQuickPick[], filter: string, token: CancellationToken): Promise<Array<ICommandQuickPick | IQuickPickSeparator>>;
|
|
@@ -68,6 +61,7 @@ export declare class CommandsHistory extends Disposable {
|
|
|
68
61
|
private load;
|
|
69
62
|
push(commandId: string): void;
|
|
70
63
|
peek(commandId: string): number | undefined;
|
|
64
|
+
remove(commandId: string): void;
|
|
71
65
|
private saveState;
|
|
72
66
|
static getConfiguredCommandHistoryLength(configurationService: IConfigurationService): number;
|
|
73
67
|
static clearHistory(configurationService: IConfigurationService, storageService: IStorageService): void;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
4
|
import { toErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errorMessage';
|
|
4
5
|
import { isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
|
-
import { or,
|
|
6
|
+
import { or, matchesBaseContiguousSubString, matchesWords } from '@codingame/monaco-vscode-api/vscode/vs/base/common/filters';
|
|
6
7
|
import { createSingleCallFunction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/functional';
|
|
7
8
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
9
|
import { LRUCache } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
9
|
-
import {
|
|
10
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
11
|
+
import { TfIdfCalculator, normalizeTfIdfScores } from '@codingame/monaco-vscode-api/vscode/vs/base/common/tfIdf';
|
|
10
12
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
11
13
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
12
14
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
@@ -14,11 +16,10 @@ import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
14
16
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
17
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
16
18
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
17
|
-
import { PickerQuickAccessProvider } from '@codingame/monaco-vscode-
|
|
19
|
+
import { PickerQuickAccessProvider, TriggerAction } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/browser/pickerQuickAccess';
|
|
18
20
|
import { WillSaveStateReason, StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
19
21
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
20
22
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
21
|
-
import { removeAccents } from '../../../base/common/normalization.js';
|
|
22
23
|
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
23
24
|
|
|
24
25
|
var AbstractCommandsQuickAccessProvider_1, CommandsHistory_1;
|
|
@@ -27,7 +28,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
27
28
|
static { this.PREFIX = '>'; }
|
|
28
29
|
static { this.TFIDF_THRESHOLD = 0.5; }
|
|
29
30
|
static { this.TFIDF_MAX_RESULTS = 5; }
|
|
30
|
-
static { this.WORD_FILTER = or(
|
|
31
|
+
static { this.WORD_FILTER = or(matchesBaseContiguousSubString, matchesWords); }
|
|
31
32
|
constructor(options, instantiationService, keybindingService, commandService, telemetryService, dialogService) {
|
|
32
33
|
super(AbstractCommandsQuickAccessProvider_1.PREFIX, options);
|
|
33
34
|
this.keybindingService = keybindingService;
|
|
@@ -53,15 +54,12 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
53
54
|
.filter(score => score.score > AbstractCommandsQuickAccessProvider_1.TFIDF_THRESHOLD)
|
|
54
55
|
.slice(0, AbstractCommandsQuickAccessProvider_1.TFIDF_MAX_RESULTS);
|
|
55
56
|
});
|
|
56
|
-
const noAccentsFilter = this.normalizeForFiltering(filter);
|
|
57
57
|
const filteredCommandPicks = [];
|
|
58
58
|
for (const commandPick of allCommandPicks) {
|
|
59
|
-
|
|
60
|
-
const labelHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(noAccentsFilter, commandPick.labelNoAccents) ?? undefined;
|
|
59
|
+
const labelHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(filter, commandPick.label) ?? undefined;
|
|
61
60
|
let aliasHighlights;
|
|
62
61
|
if (commandPick.commandAlias) {
|
|
63
|
-
|
|
64
|
-
aliasHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(noAccentsFilter, commandPick.aliasNoAccents) ?? undefined;
|
|
62
|
+
aliasHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(filter, commandPick.commandAlias) ?? undefined;
|
|
65
63
|
}
|
|
66
64
|
if (labelHighlights || aliasHighlights) {
|
|
67
65
|
commandPick.highlights = {
|
|
@@ -149,24 +147,25 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
149
147
|
let addCommonlyUsedSeparator = !!this.options.suggestedCommandIds;
|
|
150
148
|
for (let i = 0; i < filteredCommandPicks.length; i++) {
|
|
151
149
|
const commandPick = filteredCommandPicks[i];
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
const isInHistory = !!this.commandsHistory.peek(commandPick.commandId);
|
|
151
|
+
if (i === 0 && isInHistory) {
|
|
152
|
+
commandPicks.push({ type: 'separator', label: ( localize(2000, "recently used")) });
|
|
154
153
|
addOtherSeparator = true;
|
|
155
154
|
}
|
|
156
155
|
if (addSuggestedSeparator && commandPick.tfIdfScore !== undefined) {
|
|
157
|
-
commandPicks.push({ type: 'separator', label: ( localize(
|
|
156
|
+
commandPicks.push({ type: 'separator', label: ( localize(2001, "similar commands")) });
|
|
158
157
|
addSuggestedSeparator = false;
|
|
159
158
|
}
|
|
160
|
-
if (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !
|
|
161
|
-
commandPicks.push({ type: 'separator', label: ( localize(
|
|
159
|
+
if (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !isInHistory && this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
160
|
+
commandPicks.push({ type: 'separator', label: ( localize(2002, "commonly used")) });
|
|
162
161
|
addOtherSeparator = true;
|
|
163
162
|
addCommonlyUsedSeparator = false;
|
|
164
163
|
}
|
|
165
|
-
if (addOtherSeparator && commandPick.tfIdfScore === undefined && !
|
|
166
|
-
commandPicks.push({ type: 'separator', label: ( localize(
|
|
164
|
+
if (addOtherSeparator && commandPick.tfIdfScore === undefined && !isInHistory && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
165
|
+
commandPicks.push({ type: 'separator', label: ( localize(2003, "other commands")) });
|
|
167
166
|
addOtherSeparator = false;
|
|
168
167
|
}
|
|
169
|
-
commandPicks.push(this.toCommandPick(commandPick, runOptions));
|
|
168
|
+
commandPicks.push(this.toCommandPick(commandPick, runOptions, isInHistory));
|
|
170
169
|
}
|
|
171
170
|
if (!this.hasAdditionalCommandPicks(filter, token)) {
|
|
172
171
|
return commandPicks;
|
|
@@ -180,25 +179,34 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
180
179
|
}
|
|
181
180
|
const commandPicks = ( additionalCommandPicks.map(commandPick => this.toCommandPick(commandPick, runOptions)));
|
|
182
181
|
if (addSuggestedSeparator && commandPicks[0]?.type !== 'separator') {
|
|
183
|
-
commandPicks.unshift({ type: 'separator', label: ( localize(
|
|
182
|
+
commandPicks.unshift({ type: 'separator', label: ( localize(2001, "similar commands")) });
|
|
184
183
|
}
|
|
185
184
|
return commandPicks;
|
|
186
185
|
})()
|
|
187
186
|
};
|
|
188
187
|
}
|
|
189
|
-
toCommandPick(commandPick, runOptions) {
|
|
188
|
+
toCommandPick(commandPick, runOptions, isRecentlyUsed = false) {
|
|
190
189
|
if (commandPick.type === 'separator') {
|
|
191
190
|
return commandPick;
|
|
192
191
|
}
|
|
193
192
|
const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);
|
|
194
193
|
const ariaLabel = keybinding ?
|
|
195
|
-
( localize(
|
|
194
|
+
( localize(2004, "{0}, {1}", commandPick.label, keybinding.getAriaLabel())) :
|
|
196
195
|
commandPick.label;
|
|
196
|
+
const existingButtons = commandPick.buttons || [];
|
|
197
|
+
const buttons = isRecentlyUsed ? [
|
|
198
|
+
...existingButtons,
|
|
199
|
+
{
|
|
200
|
+
iconClass: ThemeIcon.asClassName(Codicon.close),
|
|
201
|
+
tooltip: ( localize(2005, "Remove from Recently Used"))
|
|
202
|
+
}
|
|
203
|
+
] : commandPick.buttons;
|
|
197
204
|
return {
|
|
198
205
|
...commandPick,
|
|
199
206
|
ariaLabel,
|
|
200
207
|
detail: this.options.showAlias && commandPick.commandAlias !== commandPick.label ? commandPick.commandAlias : undefined,
|
|
201
208
|
keybinding,
|
|
209
|
+
buttons,
|
|
202
210
|
accept: async () => {
|
|
203
211
|
this.commandsHistory.push(commandPick.commandId);
|
|
204
212
|
this.telemetryService.publicLog2('workbenchActionExecuted', {
|
|
@@ -212,10 +220,21 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
212
220
|
}
|
|
213
221
|
catch (error) {
|
|
214
222
|
if (!isCancellationError(error)) {
|
|
215
|
-
this.dialogService.error(( localize(
|
|
223
|
+
this.dialogService.error(( localize(2006, "Command '{0}' resulted in an error", commandPick.label)), toErrorMessage(error));
|
|
216
224
|
}
|
|
217
225
|
}
|
|
218
|
-
}
|
|
226
|
+
},
|
|
227
|
+
trigger: isRecentlyUsed ? (buttonIndex, keyMods) => {
|
|
228
|
+
const removeButtonIndex = existingButtons.length;
|
|
229
|
+
if (buttonIndex === removeButtonIndex) {
|
|
230
|
+
this.commandsHistory.remove(commandPick.commandId);
|
|
231
|
+
return TriggerAction.REMOVE_ITEM;
|
|
232
|
+
}
|
|
233
|
+
if (commandPick.trigger) {
|
|
234
|
+
return commandPick.trigger(buttonIndex, keyMods);
|
|
235
|
+
}
|
|
236
|
+
return TriggerAction.NO_ACTION;
|
|
237
|
+
} : commandPick.trigger
|
|
219
238
|
};
|
|
220
239
|
}
|
|
221
240
|
getTfIdfChunk({ label, commandAlias, commandDescription }) {
|
|
@@ -228,19 +247,6 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
228
247
|
}
|
|
229
248
|
return chunk;
|
|
230
249
|
}
|
|
231
|
-
normalizeForFiltering(value) {
|
|
232
|
-
const withoutAccents = removeAccents(value);
|
|
233
|
-
if (withoutAccents.length !== value.length) {
|
|
234
|
-
this.telemetryService.publicLog2('QuickAccess:FilterLengthMismatch', {
|
|
235
|
-
originalLength: value.length,
|
|
236
|
-
normalizedLength: withoutAccents.length
|
|
237
|
-
});
|
|
238
|
-
return value;
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
return withoutAccents;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
250
|
};
|
|
245
251
|
AbstractCommandsQuickAccessProvider = AbstractCommandsQuickAccessProvider_1 = ( __decorate([
|
|
246
252
|
( __param(1, IInstantiationService)),
|
|
@@ -318,6 +324,13 @@ let CommandsHistory = class CommandsHistory extends Disposable {
|
|
|
318
324
|
peek(commandId) {
|
|
319
325
|
return CommandsHistory_1.cache?.peek(commandId);
|
|
320
326
|
}
|
|
327
|
+
remove(commandId) {
|
|
328
|
+
if (!CommandsHistory_1.cache) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
CommandsHistory_1.cache.delete(commandId);
|
|
332
|
+
CommandsHistory_1.hasChanges = true;
|
|
333
|
+
}
|
|
321
334
|
saveState() {
|
|
322
335
|
if (!CommandsHistory_1.cache) {
|
|
323
336
|
return;
|
|
@@ -48,7 +48,7 @@ let HelpQuickAccessProvider = class HelpQuickAccessProvider {
|
|
|
48
48
|
prefix,
|
|
49
49
|
label,
|
|
50
50
|
keybinding: helpEntry.commandId ? this.keybindingService.lookupKeybinding(helpEntry.commandId) : undefined,
|
|
51
|
-
ariaLabel: ( localize(
|
|
51
|
+
ariaLabel: ( localize(2007, "{0}, {1}", label, helpEntry.description)),
|
|
52
52
|
description: helpEntry.description
|
|
53
53
|
};
|
|
54
54
|
}));
|
|
@@ -3,11 +3,11 @@ import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls'
|
|
|
3
3
|
import { registerAction2, Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
4
4
|
import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
5
5
|
import { KeybindingsRegistry, KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
6
|
-
import { ItemActivation } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput';
|
|
6
|
+
import { QuickInputHideReason, ItemActivation } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput';
|
|
7
7
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
8
8
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
9
9
|
import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
|
|
10
|
-
import { inQuickPickContext, defaultQuickAccessContext, getQuickNavigateHandler } from '@codingame/monaco-vscode-
|
|
10
|
+
import { inQuickPickContext, defaultQuickAccessContext, getQuickNavigateHandler } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/quickaccess';
|
|
11
11
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
12
12
|
|
|
13
13
|
const globalQuickAccessKeybinding = {
|
|
@@ -22,7 +22,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
22
22
|
primary: KeyCode.Escape, secondary: [KeyMod.Shift | KeyCode.Escape],
|
|
23
23
|
handler: accessor => {
|
|
24
24
|
const quickInputService = accessor.get(IQuickInputService);
|
|
25
|
-
return quickInputService.cancel();
|
|
25
|
+
return quickInputService.cancel(QuickInputHideReason.Gesture);
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
@@ -105,7 +105,7 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
105
105
|
constructor() {
|
|
106
106
|
super({
|
|
107
107
|
id: 'workbench.action.quickOpen',
|
|
108
|
-
title: ( localize2(
|
|
108
|
+
title: ( localize2(2890, "Go to File...")),
|
|
109
109
|
metadata: {
|
|
110
110
|
description: `Quick access`,
|
|
111
111
|
args: [{
|
|
@@ -133,7 +133,7 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
133
133
|
constructor() {
|
|
134
134
|
super({
|
|
135
135
|
id: 'workbench.action.quickOpenWithModes',
|
|
136
|
-
title: ( localize(
|
|
136
|
+
title: ( localize(2891, "Quick Open")),
|
|
137
137
|
icon: Codicon.search,
|
|
138
138
|
menu: {
|
|
139
139
|
id: MenuId.CommandCenterCenter,
|
|
@@ -174,17 +174,17 @@ class BaseQuickAccessNavigateAction extends Action2 {
|
|
|
174
174
|
}
|
|
175
175
|
class QuickAccessNavigateNextAction extends BaseQuickAccessNavigateAction {
|
|
176
176
|
constructor() {
|
|
177
|
-
super('workbench.action.quickOpenNavigateNext', ( localize2(
|
|
177
|
+
super('workbench.action.quickOpenNavigateNext', ( localize2(2892, 'Navigate Next in Quick Open')), true, true);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
class QuickAccessNavigatePreviousAction extends BaseQuickAccessNavigateAction {
|
|
181
181
|
constructor() {
|
|
182
|
-
super('workbench.action.quickOpenNavigatePrevious', ( localize2(
|
|
182
|
+
super('workbench.action.quickOpenNavigatePrevious', ( localize2(2893, 'Navigate Previous in Quick Open')), false, true);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
class QuickAccessSelectNextAction extends BaseQuickAccessNavigateAction {
|
|
186
186
|
constructor() {
|
|
187
|
-
super('workbench.action.quickOpenSelectNext', ( localize2(
|
|
187
|
+
super('workbench.action.quickOpenSelectNext', ( localize2(2894, 'Select Next in Quick Open')), true, false, {
|
|
188
188
|
weight: KeybindingWeight.WorkbenchContrib + 50,
|
|
189
189
|
when: inQuickPickContext,
|
|
190
190
|
primary: 0,
|
|
@@ -194,7 +194,7 @@ class QuickAccessSelectNextAction extends BaseQuickAccessNavigateAction {
|
|
|
194
194
|
}
|
|
195
195
|
class QuickAccessSelectPreviousAction extends BaseQuickAccessNavigateAction {
|
|
196
196
|
constructor() {
|
|
197
|
-
super('workbench.action.quickOpenSelectPrevious', ( localize2(
|
|
197
|
+
super('workbench.action.quickOpenSelectPrevious', ( localize2(2895, 'Select Previous in Quick Open')), false, false, {
|
|
198
198
|
weight: KeybindingWeight.WorkbenchContrib + 50,
|
|
199
199
|
when: inQuickPickContext,
|
|
200
200
|
primary: 0,
|
package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"
|
|
|
2
2
|
import { IKeyMods } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
3
3
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
4
4
|
import { IRange } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range";
|
|
5
|
-
import { AbstractGotoLineQuickAccessProvider } from "@codingame/monaco-vscode-
|
|
5
|
+
import { AbstractGotoLineQuickAccessProvider } from "@codingame/monaco-vscode-api/vscode/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess";
|
|
6
6
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
7
|
-
import { IQuickAccessTextEditorContext } from "@codingame/monaco-vscode-
|
|
7
|
+
import { IQuickAccessTextEditorContext } from "@codingame/monaco-vscode-api/vscode/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess";
|
|
8
8
|
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
9
9
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
10
10
|
export declare class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {
|
package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js
CHANGED
|
@@ -3,7 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
4
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
5
5
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
6
|
-
import { AbstractGotoLineQuickAccessProvider } from '@codingame/monaco-vscode-
|
|
6
|
+
import { AbstractGotoLineQuickAccessProvider } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess';
|
|
7
7
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
8
8
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickAccess';
|
|
9
9
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
@@ -57,7 +57,7 @@ class GotoLineAction extends Action2 {
|
|
|
57
57
|
constructor() {
|
|
58
58
|
super({
|
|
59
59
|
id: GotoLineAction.ID,
|
|
60
|
-
title: ( localize2(
|
|
60
|
+
title: ( localize2(6163, 'Go to Line/Column...')),
|
|
61
61
|
f1: true,
|
|
62
62
|
keybinding: {
|
|
63
63
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
@@ -68,18 +68,41 @@ class GotoLineAction extends Action2 {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
async run(accessor) {
|
|
71
|
-
accessor.get(IQuickInputService).quickAccess.show(GotoLineQuickAccessProvider.
|
|
71
|
+
accessor.get(IQuickInputService).quickAccess.show(GotoLineQuickAccessProvider.GO_TO_LINE_PREFIX);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
registerAction2(GotoLineAction);
|
|
75
75
|
( Registry.as(Extensions.Quickaccess)).registerQuickAccessProvider({
|
|
76
76
|
ctor: GotoLineQuickAccessProvider,
|
|
77
|
-
prefix: AbstractGotoLineQuickAccessProvider.
|
|
77
|
+
prefix: AbstractGotoLineQuickAccessProvider.GO_TO_LINE_PREFIX,
|
|
78
78
|
placeholder: ( localize(
|
|
79
|
-
|
|
79
|
+
6164,
|
|
80
80
|
"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
81
|
)),
|
|
82
|
-
helpEntries: [{ description: ( localize(
|
|
82
|
+
helpEntries: [{ description: ( localize(6165, "Go to Line/Column")), commandId: GotoLineAction.ID }]
|
|
83
|
+
});
|
|
84
|
+
class GotoOffsetAction extends Action2 {
|
|
85
|
+
static { this.ID = 'workbench.action.gotoOffset'; }
|
|
86
|
+
constructor() {
|
|
87
|
+
super({
|
|
88
|
+
id: GotoOffsetAction.ID,
|
|
89
|
+
title: ( localize2(6166, 'Go to Offset...')),
|
|
90
|
+
f1: true
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async run(accessor) {
|
|
94
|
+
accessor.get(IQuickInputService).quickAccess.show(GotoLineQuickAccessProvider.GO_TO_OFFSET_PREFIX);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
registerAction2(GotoOffsetAction);
|
|
98
|
+
( Registry.as(Extensions.Quickaccess)).registerQuickAccessProvider({
|
|
99
|
+
ctor: GotoLineQuickAccessProvider,
|
|
100
|
+
prefix: GotoLineQuickAccessProvider.GO_TO_OFFSET_PREFIX,
|
|
101
|
+
placeholder: ( localize(
|
|
102
|
+
6164,
|
|
103
|
+
"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
|
+
)),
|
|
105
|
+
helpEntries: [{ description: ( localize(6167, "Go to Offset")), commandId: GotoOffsetAction.ID }]
|
|
83
106
|
});
|
|
84
107
|
|
|
85
108
|
export { GotoLineQuickAccessProvider };
|
|
@@ -20,18 +20,18 @@ import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
20
20
|
import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
21
21
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
22
22
|
import { CommandsHistory } from '../../../../platform/quickinput/browser/commandsQuickAccess.js';
|
|
23
|
-
import { TriggerAction } from '@codingame/monaco-vscode-
|
|
23
|
+
import { TriggerAction } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/browser/pickerQuickAccess';
|
|
24
24
|
import { DefaultQuickAccessFilterValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickAccess';
|
|
25
25
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
26
26
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
27
27
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
28
|
-
import { ASK_QUICK_QUESTION_ACTION_ID, CHAT_OPEN_ACTION_ID } from '@codingame/monaco-vscode-
|
|
28
|
+
import { ASK_QUICK_QUESTION_ACTION_ID, CHAT_OPEN_ACTION_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatConstants';
|
|
29
29
|
import { RelatedInformationType } from '../../../services/aiRelatedInformation/common/aiRelatedInformation.js';
|
|
30
30
|
import { IAiRelatedInformationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation.service';
|
|
31
31
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
32
32
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
33
33
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
34
|
-
import { createKeybindingCommandQuery } from '@codingame/monaco-vscode-
|
|
34
|
+
import { createKeybindingCommandQuery } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/browser/keybindingsEditorModel';
|
|
35
35
|
import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
36
36
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
37
37
|
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
@@ -52,7 +52,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
52
52
|
super({
|
|
53
53
|
showAlias: !Language.isDefaultVariant(),
|
|
54
54
|
noResultsPick: () => ({
|
|
55
|
-
label: ( localize(
|
|
55
|
+
label: ( localize(10160, "No matching commands")),
|
|
56
56
|
commandId: ''
|
|
57
57
|
}),
|
|
58
58
|
}, instantiationService, keybindingService, commandService, telemetryService, dialogService);
|
|
@@ -100,7 +100,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
100
100
|
...picks,
|
|
101
101
|
buttons: [{
|
|
102
102
|
iconClass: ThemeIcon.asClassName(Codicon.gear),
|
|
103
|
-
tooltip: ( localize(
|
|
103
|
+
tooltip: ( localize(10161, "Configure Keybinding")),
|
|
104
104
|
}],
|
|
105
105
|
trigger: () => {
|
|
106
106
|
this.preferencesService.openGlobalKeybindingSettings(false, { query: createKeybindingCommandQuery(picks.commandId, picks.commandWhen) });
|
|
@@ -137,12 +137,12 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
additionalPicks.push({
|
|
140
|
-
label: ( localize(
|
|
140
|
+
label: ( localize(10162, "Ask in Chat: {0}", filter)),
|
|
141
141
|
commandId: this.configuration.experimental.askChatLocation === 'quickChat' ? ASK_QUICK_QUESTION_ACTION_ID : CHAT_OPEN_ACTION_ID,
|
|
142
142
|
args: [filter],
|
|
143
143
|
buttons: [{
|
|
144
144
|
iconClass: ThemeIcon.asClassName(Codicon.gear),
|
|
145
|
-
tooltip: ( localize(
|
|
145
|
+
tooltip: ( localize(10163, "Configure visibility")),
|
|
146
146
|
}],
|
|
147
147
|
trigger: () => {
|
|
148
148
|
void this.preferencesService.openSettings({ jsonEditor: false, query: 'workbench.commandPalette.showAskInChat' });
|
|
@@ -180,7 +180,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
180
180
|
let label = (typeof action.item.title === 'string' ? action.item.title : action.item.title.value) || action.item.id;
|
|
181
181
|
const category = typeof action.item.category === 'string' ? action.item.category : action.item.category?.value;
|
|
182
182
|
if (category) {
|
|
183
|
-
label = ( localize(
|
|
183
|
+
label = ( localize(10164, "{0}: {1}", category, label));
|
|
184
184
|
}
|
|
185
185
|
const aliasLabel = typeof action.item.title !== 'string' ? action.item.title.original : undefined;
|
|
186
186
|
const aliasCategory = (category && action.item.category && typeof action.item.category !== 'string') ? action.item.category.original : undefined;
|
|
@@ -224,7 +224,7 @@ class ShowAllCommandsAction extends Action2 {
|
|
|
224
224
|
constructor() {
|
|
225
225
|
super({
|
|
226
226
|
id: ShowAllCommandsAction.ID,
|
|
227
|
-
title: ( localize2(
|
|
227
|
+
title: ( localize2(10165, 'Show All Commands')),
|
|
228
228
|
keybinding: {
|
|
229
229
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
230
230
|
when: undefined,
|
|
@@ -242,7 +242,7 @@ class ClearCommandHistoryAction extends Action2 {
|
|
|
242
242
|
constructor() {
|
|
243
243
|
super({
|
|
244
244
|
id: 'workbench.action.clearCommandHistory',
|
|
245
|
-
title: ( localize2(
|
|
245
|
+
title: ( localize2(10166, 'Clear Command History')),
|
|
246
246
|
f1: true
|
|
247
247
|
});
|
|
248
248
|
}
|
|
@@ -254,9 +254,9 @@ class ClearCommandHistoryAction extends Action2 {
|
|
|
254
254
|
if (commandHistoryLength > 0) {
|
|
255
255
|
const { confirmed } = await dialogService.confirm({
|
|
256
256
|
type: 'warning',
|
|
257
|
-
message: ( localize(
|
|
258
|
-
detail: ( localize(
|
|
259
|
-
primaryButton: ( localize(
|
|
257
|
+
message: ( localize(10167, "Do you want to clear the history of recently used commands?")),
|
|
258
|
+
detail: ( localize(10168, "This action is irreversible!")),
|
|
259
|
+
primaryButton: ( localize(10169, "&&Clear"))
|
|
260
260
|
});
|
|
261
261
|
if (!confirmed) {
|
|
262
262
|
return;
|
|
@@ -8,7 +8,7 @@ import { ShowAllCommandsAction, CommandsQuickAccessProvider, ClearCommandHistory
|
|
|
8
8
|
import { MenuRegistry, MenuId, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
9
9
|
import { KeyMod } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
10
10
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
|
-
import { inQuickPickContext, getQuickNavigateHandler } from '@codingame/monaco-vscode-
|
|
11
|
+
import { inQuickPickContext, getQuickNavigateHandler } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/quickaccess';
|
|
12
12
|
import { KeybindingsRegistry, KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
13
13
|
import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorContextKeys';
|
|
14
14
|
|
|
@@ -17,35 +17,35 @@ quickAccessRegistry.registerQuickAccessProvider({
|
|
|
17
17
|
ctor: HelpQuickAccessProvider,
|
|
18
18
|
prefix: HelpQuickAccessProvider.PREFIX,
|
|
19
19
|
placeholder: ( localize(
|
|
20
|
-
|
|
20
|
+
10170,
|
|
21
21
|
"Type '{0}' to get help on the actions you can take from here.",
|
|
22
22
|
HelpQuickAccessProvider.PREFIX
|
|
23
23
|
)),
|
|
24
24
|
helpEntries: [{
|
|
25
|
-
description: ( localize(
|
|
25
|
+
description: ( localize(10171, "Show all Quick Access Providers")),
|
|
26
26
|
commandCenterOrder: 70,
|
|
27
|
-
commandCenterLabel: ( localize(
|
|
27
|
+
commandCenterLabel: ( localize(10172, 'More'))
|
|
28
28
|
}]
|
|
29
29
|
});
|
|
30
30
|
quickAccessRegistry.registerQuickAccessProvider({
|
|
31
31
|
ctor: ViewQuickAccessProvider,
|
|
32
32
|
prefix: ViewQuickAccessProvider.PREFIX,
|
|
33
33
|
contextKey: 'inViewsPicker',
|
|
34
|
-
placeholder: ( localize(
|
|
35
|
-
helpEntries: [{ description: ( localize(
|
|
34
|
+
placeholder: ( localize(10173, "Type the name of a view, output channel or terminal to open.")),
|
|
35
|
+
helpEntries: [{ description: ( localize(10174, "Open View")), commandId: OpenViewPickerAction.ID }]
|
|
36
36
|
});
|
|
37
37
|
quickAccessRegistry.registerQuickAccessProvider({
|
|
38
38
|
ctor: CommandsQuickAccessProvider,
|
|
39
39
|
prefix: CommandsQuickAccessProvider.PREFIX,
|
|
40
40
|
contextKey: 'inCommandsPicker',
|
|
41
|
-
placeholder: ( localize(
|
|
42
|
-
helpEntries: [{ description: ( localize(
|
|
41
|
+
placeholder: ( localize(10175, "Type the name of a command to run.")),
|
|
42
|
+
helpEntries: [{ description: ( localize(10176, "Show and Run Commands")), commandId: ShowAllCommandsAction.ID, commandCenterOrder: 20 }]
|
|
43
43
|
});
|
|
44
44
|
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
45
45
|
group: '1_open',
|
|
46
46
|
command: {
|
|
47
47
|
id: ShowAllCommandsAction.ID,
|
|
48
|
-
title: ( localize(
|
|
48
|
+
title: ( localize(10177, "&&Command Palette..."))
|
|
49
49
|
},
|
|
50
50
|
order: 1
|
|
51
51
|
});
|
|
@@ -53,7 +53,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
|
|
|
53
53
|
group: '1_welcome',
|
|
54
54
|
command: {
|
|
55
55
|
id: ShowAllCommandsAction.ID,
|
|
56
|
-
title: ( localize(
|
|
56
|
+
title: ( localize(10178, "Show All Commands"))
|
|
57
57
|
},
|
|
58
58
|
order: 2
|
|
59
59
|
});
|
|
@@ -61,7 +61,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
|
61
61
|
group: '1_open',
|
|
62
62
|
command: {
|
|
63
63
|
id: OpenViewPickerAction.ID,
|
|
64
|
-
title: ( localize(
|
|
64
|
+
title: ( localize(10179, "&&Open View..."))
|
|
65
65
|
},
|
|
66
66
|
order: 2
|
|
67
67
|
});
|
|
@@ -69,7 +69,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
|
69
69
|
group: '5_infile_nav',
|
|
70
70
|
command: {
|
|
71
71
|
id: 'workbench.action.gotoLine',
|
|
72
|
-
title: ( localize(
|
|
72
|
+
title: ( localize(10180, "Go to &&Line/Column..."))
|
|
73
73
|
},
|
|
74
74
|
order: 1
|
|
75
75
|
});
|
|
@@ -77,7 +77,7 @@ MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
|
77
77
|
group: '1_command',
|
|
78
78
|
command: {
|
|
79
79
|
id: ShowAllCommandsAction.ID,
|
|
80
|
-
title: ( localize(
|
|
80
|
+
title: ( localize(10181, "Command Palette..."))
|
|
81
81
|
},
|
|
82
82
|
order: 1
|
|
83
83
|
});
|
|
@@ -86,7 +86,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorContext, {
|
|
|
86
86
|
when: ( EditorContextKeys.editorSimpleInput.toNegated()),
|
|
87
87
|
command: {
|
|
88
88
|
id: ShowAllCommandsAction.ID,
|
|
89
|
-
title: ( localize(
|
|
89
|
+
title: ( localize(10181, "Command Palette...")),
|
|
90
90
|
},
|
|
91
91
|
order: 1
|
|
92
92
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IQuickPickSeparator } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
2
|
-
import { IPickerQuickAccessItem, PickerQuickAccessProvider } from "@codingame/monaco-vscode-
|
|
2
|
+
import { IPickerQuickAccessItem, PickerQuickAccessProvider } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/browser/pickerQuickAccess";
|
|
3
3
|
import { IViewDescriptorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service";
|
|
4
4
|
import { IViewsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service";
|
|
5
5
|
import { IOutputService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output.service";
|
|
@@ -3,7 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
4
|
import { ItemActivation } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput';
|
|
5
5
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
6
|
-
import { PickerQuickAccessProvider } from '@codingame/monaco-vscode-
|
|
6
|
+
import { PickerQuickAccessProvider } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/browser/pickerQuickAccess';
|
|
7
7
|
import { ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
8
8
|
import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
|
|
9
9
|
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
@@ -28,7 +28,7 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
28
28
|
constructor(viewDescriptorService, viewsService, outputService, terminalService, terminalGroupService, debugService, paneCompositeService, contextKeyService) {
|
|
29
29
|
super(ViewQuickAccessProvider_1.PREFIX, {
|
|
30
30
|
noResultsPick: {
|
|
31
|
-
label: ( localize(
|
|
31
|
+
label: ( localize(10182, "No matching views")),
|
|
32
32
|
containerLabel: ''
|
|
33
33
|
}
|
|
34
34
|
});
|
|
@@ -116,9 +116,9 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
addPaneComposites(ViewContainerLocation.Sidebar, ( localize(
|
|
120
|
-
addPaneComposites(ViewContainerLocation.Panel, ( localize(
|
|
121
|
-
addPaneComposites(ViewContainerLocation.AuxiliaryBar, ( localize(
|
|
119
|
+
addPaneComposites(ViewContainerLocation.Sidebar, ( localize(10183, "Side Bar")));
|
|
120
|
+
addPaneComposites(ViewContainerLocation.Panel, ( localize(10184, "Panel")));
|
|
121
|
+
addPaneComposites(ViewContainerLocation.AuxiliaryBar, ( localize(10185, "Secondary Side Bar")));
|
|
122
122
|
const addPaneCompositeViews = (location) => {
|
|
123
123
|
const paneComposites = this.paneCompositeService.getPaneComposites(location);
|
|
124
124
|
for (const paneComposite of paneComposites) {
|
|
@@ -134,14 +134,14 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
134
134
|
this.terminalGroupService.groups.forEach((group, groupIndex) => {
|
|
135
135
|
group.terminalInstances.forEach((terminal, terminalIndex) => {
|
|
136
136
|
const label = ( localize(
|
|
137
|
-
|
|
137
|
+
10186,
|
|
138
138
|
"{0}: {1}",
|
|
139
139
|
`${groupIndex + 1}.${terminalIndex + 1}`,
|
|
140
140
|
terminal.title
|
|
141
141
|
));
|
|
142
142
|
viewEntries.push({
|
|
143
143
|
label,
|
|
144
|
-
containerLabel: ( localize(
|
|
144
|
+
containerLabel: ( localize(10187, "Terminal")),
|
|
145
145
|
accept: async () => {
|
|
146
146
|
await this.terminalGroupService.showPanel(true);
|
|
147
147
|
this.terminalService.setActiveInstance(terminal);
|
|
@@ -153,7 +153,7 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
153
153
|
const label = session.name;
|
|
154
154
|
viewEntries.push({
|
|
155
155
|
label,
|
|
156
|
-
containerLabel: ( localize(
|
|
156
|
+
containerLabel: ( localize(10188, "Debug Console")),
|
|
157
157
|
accept: async () => {
|
|
158
158
|
await this.debugService.focusStackFrame(undefined, undefined, session, { explicit: true });
|
|
159
159
|
if (!this.viewsService.isViewVisible(REPL_VIEW_ID)) {
|
|
@@ -166,7 +166,7 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
166
166
|
for (const channel of channels) {
|
|
167
167
|
viewEntries.push({
|
|
168
168
|
label: channel.label,
|
|
169
|
-
containerLabel: ( localize(
|
|
169
|
+
containerLabel: ( localize(10189, "Output")),
|
|
170
170
|
accept: () => this.outputService.showChannel(channel.id)
|
|
171
171
|
});
|
|
172
172
|
}
|
|
@@ -195,7 +195,7 @@ class OpenViewPickerAction extends Action2 {
|
|
|
195
195
|
constructor() {
|
|
196
196
|
super({
|
|
197
197
|
id: OpenViewPickerAction.ID,
|
|
198
|
-
title: ( localize2(
|
|
198
|
+
title: ( localize2(10190, 'Open View')),
|
|
199
199
|
category: Categories.View,
|
|
200
200
|
f1: true
|
|
201
201
|
});
|
|
@@ -214,7 +214,7 @@ class QuickAccessViewPickerAction extends Action2 {
|
|
|
214
214
|
constructor() {
|
|
215
215
|
super({
|
|
216
216
|
id: QuickAccessViewPickerAction.ID,
|
|
217
|
-
title: ( localize2(
|
|
217
|
+
title: ( localize2(10191, 'Quick Open View')),
|
|
218
218
|
category: Categories.View,
|
|
219
219
|
f1: false,
|
|
220
220
|
keybinding: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
2
|
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
3
3
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
4
|
-
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-
|
|
4
|
+
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service";
|
|
5
5
|
export declare class ExternalUriResolverContribution extends Disposable implements IWorkbenchContribution {
|
|
6
6
|
static readonly ID = "workbench.contrib.externalUriResolver";
|
|
7
7
|
constructor(_openerService: IOpenerService, _workbenchEnvironmentService: IBrowserWorkbenchEnvironmentService);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
5
|
-
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-
|
|
5
|
+
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
6
6
|
|
|
7
7
|
let ExternalUriResolverContribution = class ExternalUriResolverContribution extends Disposable {
|
|
8
8
|
static { this.ID = 'workbench.contrib.externalUriResolver'; }
|
|
@@ -7,7 +7,7 @@ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/fi
|
|
|
7
7
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
8
8
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
9
9
|
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
10
|
-
import { TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, readTrustedDomains, TRUSTED_DOMAINS_STORAGE_KEY } from '@codingame/monaco-vscode-
|
|
10
|
+
import { TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, readTrustedDomains, TRUSTED_DOMAINS_STORAGE_KEY } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/browser/trustedDomains';
|
|
11
11
|
import { assertReturnsDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
12
12
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
13
|
|
|
@@ -15,8 +15,8 @@ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
15
15
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
16
16
|
import { IWorkspaceTrustManagementService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
17
17
|
import { ITrustedDomainService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/browser/trustedDomainService.service';
|
|
18
|
-
import { isURLDomainTrusted } from '@codingame/monaco-vscode-
|
|
19
|
-
import { readStaticTrustedDomains, configureOpenerTrustedDomainsHandler } from '@codingame/monaco-vscode-
|
|
18
|
+
import { isURLDomainTrusted } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/common/trustedDomains';
|
|
19
|
+
import { readStaticTrustedDomains, configureOpenerTrustedDomainsHandler } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/browser/trustedDomains';
|
|
20
20
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
21
21
|
|
|
22
22
|
let OpenerValidatorContributions = class OpenerValidatorContributions {
|
|
@@ -68,25 +68,25 @@ let OpenerValidatorContributions = class OpenerValidatorContributions {
|
|
|
68
68
|
const { result } = await this._dialogService.prompt({
|
|
69
69
|
type: Severity.Info,
|
|
70
70
|
message: ( localize(
|
|
71
|
-
|
|
71
|
+
12865,
|
|
72
72
|
'Do you want {0} to open the external website?',
|
|
73
73
|
this._productService.nameShort
|
|
74
74
|
)),
|
|
75
75
|
detail: typeof originalResource === 'string' ? originalResource : formattedLink,
|
|
76
76
|
buttons: [
|
|
77
77
|
{
|
|
78
|
-
label: ( localize(
|
|
78
|
+
label: ( localize(12866, '&&Open')),
|
|
79
79
|
run: () => true
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
|
-
label: ( localize(
|
|
82
|
+
label: ( localize(12867, '&&Copy')),
|
|
83
83
|
run: () => {
|
|
84
84
|
this._clipboardService.writeText(typeof originalResource === 'string' ? originalResource : ( resourceUri.toString(true)));
|
|
85
85
|
return false;
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
label: ( localize(
|
|
89
|
+
label: ( localize(12868, 'Configure &&Trusted Domains')),
|
|
90
90
|
run: async () => {
|
|
91
91
|
const { trustedDomains, } = this._instantiationService.invokeFunction(readStaticTrustedDomains);
|
|
92
92
|
const domainToOpen = `${scheme}://${authority}`;
|
|
@@ -9,13 +9,13 @@ import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/regist
|
|
|
9
9
|
import { IURLService } from '@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service';
|
|
10
10
|
import { Extensions, registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
11
11
|
import { ExternalUriResolverContribution } from './externalUriResolver.js';
|
|
12
|
-
import { manageTrustedDomainSettingsCommand } from '@codingame/monaco-vscode-
|
|
12
|
+
import { manageTrustedDomainSettingsCommand } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/browser/trustedDomains';
|
|
13
13
|
import { TrustedDomainsFileSystemProvider } from './trustedDomainsFileSystemProvider.js';
|
|
14
14
|
import { OpenerValidatorContributions } from './trustedDomainsValidator.js';
|
|
15
15
|
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
16
16
|
import { Extensions as Extensions$1, ConfigurationScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
17
17
|
import { workbenchConfigurationNodeBase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/configuration';
|
|
18
|
-
import '@codingame/monaco-vscode-
|
|
18
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/browser/trustedDomainService';
|
|
19
19
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
20
20
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
21
21
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
@@ -26,7 +26,7 @@ class OpenUrlAction extends Action2 {
|
|
|
26
26
|
constructor() {
|
|
27
27
|
super({
|
|
28
28
|
id: 'workbench.action.url.openUrl',
|
|
29
|
-
title: ( localize2(
|
|
29
|
+
title: ( localize2(12869, 'Open URL')),
|
|
30
30
|
category: Categories.Developer,
|
|
31
31
|
f1: true
|
|
32
32
|
});
|
|
@@ -36,7 +36,7 @@ class OpenUrlAction extends Action2 {
|
|
|
36
36
|
const urlService = accessor.get(IURLService);
|
|
37
37
|
const storageService = accessor.get(IStorageService);
|
|
38
38
|
const value = storageService.get(OpenUrlAction.STORAGE_KEY, StorageScope.WORKSPACE, '');
|
|
39
|
-
return quickInputService.input({ prompt: ( localize(
|
|
39
|
+
return quickInputService.input({ prompt: ( localize(12870, "URL to open")), value }).then(input => {
|
|
40
40
|
if (input) {
|
|
41
41
|
const uri = ( URI.parse(input));
|
|
42
42
|
urlService.open(uri, { originalUrl: input });
|
|
@@ -67,7 +67,7 @@ configurationRegistry.registerConfiguration({
|
|
|
67
67
|
type: 'boolean',
|
|
68
68
|
default: false,
|
|
69
69
|
description: ( localize(
|
|
70
|
-
|
|
70
|
+
12871,
|
|
71
71
|
"When enabled, trusted domain prompts will appear when opening links in trusted workspaces."
|
|
72
72
|
))
|
|
73
73
|
}
|
|
@@ -8,7 +8,7 @@ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
8
8
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
9
9
|
import { QuickInputService as QuickInputService$1 } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/browser/quickInputService';
|
|
10
10
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
11
|
-
import { InQuickPickContextKey } from '@codingame/monaco-vscode-
|
|
11
|
+
import { InQuickPickContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/quickaccess';
|
|
12
12
|
|
|
13
13
|
let QuickInputService = class QuickInputService extends QuickInputService$1 {
|
|
14
14
|
constructor(configurationService, instantiationService, keybindingService, contextKeyService, themeService, layoutService) {
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { LRUCache } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
3
|
-
|
|
4
|
-
const nfdCache = ( new LRUCache(10000));
|
|
5
|
-
function normalizeNFD(str) {
|
|
6
|
-
return normalize(str, 'NFD', nfdCache);
|
|
7
|
-
}
|
|
8
|
-
const nonAsciiCharactersPattern = /[^\u0000-\u0080]/;
|
|
9
|
-
function normalize(str, form, normalizedCache) {
|
|
10
|
-
if (!str) {
|
|
11
|
-
return str;
|
|
12
|
-
}
|
|
13
|
-
const cached = normalizedCache.get(str);
|
|
14
|
-
if (cached) {
|
|
15
|
-
return cached;
|
|
16
|
-
}
|
|
17
|
-
let res;
|
|
18
|
-
if (nonAsciiCharactersPattern.test(str)) {
|
|
19
|
-
res = str.normalize(form);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
res = str;
|
|
23
|
-
}
|
|
24
|
-
normalizedCache.set(str, res);
|
|
25
|
-
return res;
|
|
26
|
-
}
|
|
27
|
-
const removeAccents = (function () {
|
|
28
|
-
const regex = /[\u0300-\u036f]/g;
|
|
29
|
-
return function (str) {
|
|
30
|
-
return normalizeNFD(str).replace(regex, '');
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
|
-
|
|
34
|
-
export { normalizeNFD, removeAccents };
|