@codingame/monaco-vscode-quickaccess-service-override 4.5.1 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.js +29 -59
- package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.js +19 -22
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +7 -30
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +11 -18
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +46 -79
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +22 -62
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +25 -60
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +16 -42
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainsValidator.js +43 -48
- package/vscode/src/vs/workbench/contrib/url/browser/url.contribution.js +8 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-quickaccess-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -19,6 +19,7 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
|
|
|
19
19
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
20
20
|
|
|
21
21
|
var AbstractCommandsQuickAccessProvider_1, CommandsHistory_1;
|
|
22
|
+
const _moduleId = "vs/platform/quickinput/browser/commandsQuickAccess";
|
|
22
23
|
let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvider extends PickerQuickAccessProvider {
|
|
23
24
|
static { AbstractCommandsQuickAccessProvider_1 = this; }
|
|
24
25
|
static { this.PREFIX = '>'; }
|
|
@@ -41,11 +42,11 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
41
42
|
return [];
|
|
42
43
|
}
|
|
43
44
|
const runTfidf = createSingleCallFunction(() => {
|
|
44
|
-
const tfidf = ( new TfIdfCalculator());
|
|
45
|
-
tfidf.updateDocuments(( allCommandPicks.map(commandPick => ({
|
|
45
|
+
const tfidf = ( (new TfIdfCalculator()));
|
|
46
|
+
tfidf.updateDocuments(( (allCommandPicks.map(commandPick => ({
|
|
46
47
|
key: commandPick.commandId,
|
|
47
48
|
textChunks: [this.getTfIdfChunk(commandPick)]
|
|
48
|
-
}))));
|
|
49
|
+
})))));
|
|
49
50
|
const result = tfidf.calculateScores(filter, token);
|
|
50
51
|
return normalizeTfIdfScores(result)
|
|
51
52
|
.filter(score => score.score > AbstractCommandsQuickAccessProvider_1.TFIDF_THRESHOLD)
|
|
@@ -77,7 +78,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
const mapLabelToCommand = ( new Map());
|
|
81
|
+
const mapLabelToCommand = ( (new Map()));
|
|
81
82
|
for (const commandPick of filteredCommandPicks) {
|
|
82
83
|
const existingCommandForLabel = mapLabelToCommand.get(commandPick.label);
|
|
83
84
|
if (existingCommandForLabel) {
|
|
@@ -113,8 +114,8 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
113
114
|
return 1;
|
|
114
115
|
}
|
|
115
116
|
if (this.options.suggestedCommandIds) {
|
|
116
|
-
const commandASuggestion = ( this.options.suggestedCommandIds.has(commandPickA.commandId));
|
|
117
|
-
const commandBSuggestion = ( this.options.suggestedCommandIds.has(commandPickB.commandId));
|
|
117
|
+
const commandASuggestion = ( (this.options.suggestedCommandIds.has(commandPickA.commandId)));
|
|
118
|
+
const commandBSuggestion = ( (this.options.suggestedCommandIds.has(commandPickB.commandId)));
|
|
118
119
|
if (commandASuggestion && commandBSuggestion) {
|
|
119
120
|
return 0;
|
|
120
121
|
}
|
|
@@ -134,36 +135,20 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
134
135
|
for (let i = 0; i < filteredCommandPicks.length; i++) {
|
|
135
136
|
const commandPick = filteredCommandPicks[i];
|
|
136
137
|
if (i === 0 && this.commandsHistory.peek(commandPick.commandId)) {
|
|
137
|
-
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
138
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
139
|
-
'recentlyUsed',
|
|
140
|
-
"recently used"
|
|
141
|
-
)) });
|
|
138
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 0, "recently used")) });
|
|
142
139
|
addOtherSeparator = true;
|
|
143
140
|
}
|
|
144
141
|
if (addSuggestedSeparator && commandPick.tfIdfScore !== undefined) {
|
|
145
|
-
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
146
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
147
|
-
'suggested',
|
|
148
|
-
"similar commands"
|
|
149
|
-
)) });
|
|
142
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 1, "similar commands")) });
|
|
150
143
|
addSuggestedSeparator = false;
|
|
151
144
|
}
|
|
152
145
|
if (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
153
|
-
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
154
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
155
|
-
'commonlyUsed',
|
|
156
|
-
"commonly used"
|
|
157
|
-
)) });
|
|
146
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 2, "commonly used")) });
|
|
158
147
|
addOtherSeparator = true;
|
|
159
148
|
addCommonlyUsedSeparator = false;
|
|
160
149
|
}
|
|
161
150
|
if (addOtherSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {
|
|
162
|
-
commandPicks.push({ type: 'separator', label: ( localizeWithPath(
|
|
163
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
164
|
-
'morecCommands',
|
|
165
|
-
"other commands"
|
|
166
|
-
)) });
|
|
151
|
+
commandPicks.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 3, "other commands")) });
|
|
167
152
|
addOtherSeparator = false;
|
|
168
153
|
}
|
|
169
154
|
commandPicks.push(this.toCommandPick(commandPick, runOptions));
|
|
@@ -178,13 +163,9 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
178
163
|
if (token.isCancellationRequested) {
|
|
179
164
|
return [];
|
|
180
165
|
}
|
|
181
|
-
const commandPicks = ( additionalCommandPicks.map(commandPick => this.toCommandPick(commandPick, runOptions)));
|
|
166
|
+
const commandPicks = ( (additionalCommandPicks.map(commandPick => this.toCommandPick(commandPick, runOptions))));
|
|
182
167
|
if (addSuggestedSeparator && commandPicks[0]?.type !== 'separator') {
|
|
183
|
-
commandPicks.unshift({ type: 'separator', label: ( localizeWithPath(
|
|
184
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
185
|
-
'suggested',
|
|
186
|
-
"similar commands"
|
|
187
|
-
)) });
|
|
168
|
+
commandPicks.unshift({ type: 'separator', label: ( localizeWithPath(_moduleId, 1, "similar commands")) });
|
|
188
169
|
}
|
|
189
170
|
return commandPicks;
|
|
190
171
|
})()
|
|
@@ -196,13 +177,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
196
177
|
}
|
|
197
178
|
const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);
|
|
198
179
|
const ariaLabel = keybinding ?
|
|
199
|
-
( localizeWithPath(
|
|
200
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
201
|
-
'commandPickAriaLabelWithKeybinding',
|
|
202
|
-
"{0}, {1}",
|
|
203
|
-
commandPick.label,
|
|
204
|
-
keybinding.getAriaLabel()
|
|
205
|
-
)) :
|
|
180
|
+
( localizeWithPath(_moduleId, 4, "{0}, {1}", commandPick.label, keybinding.getAriaLabel())) :
|
|
206
181
|
commandPick.label;
|
|
207
182
|
return {
|
|
208
183
|
...commandPick,
|
|
@@ -222,12 +197,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
222
197
|
}
|
|
223
198
|
catch (error) {
|
|
224
199
|
if (!isCancellationError(error)) {
|
|
225
|
-
this.dialogService.error(( localizeWithPath(
|
|
226
|
-
'vs/platform/quickinput/browser/commandsQuickAccess',
|
|
227
|
-
'canNotRun',
|
|
228
|
-
"Command '{0}' resulted in an error",
|
|
229
|
-
commandPick.label
|
|
230
|
-
)), toErrorMessage(error));
|
|
200
|
+
this.dialogService.error(( localizeWithPath(_moduleId, 5, "Command '{0}' resulted in an error", commandPick.label)), toErrorMessage(error));
|
|
231
201
|
}
|
|
232
202
|
}
|
|
233
203
|
}
|
|
@@ -244,13 +214,13 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
|
|
|
244
214
|
return chunk;
|
|
245
215
|
}
|
|
246
216
|
};
|
|
247
|
-
AbstractCommandsQuickAccessProvider = AbstractCommandsQuickAccessProvider_1 = ( __decorate([
|
|
248
|
-
( __param(1, IInstantiationService)),
|
|
249
|
-
( __param(2, IKeybindingService)),
|
|
250
|
-
( __param(3, ICommandService)),
|
|
251
|
-
( __param(4, ITelemetryService)),
|
|
252
|
-
( __param(5, IDialogService))
|
|
253
|
-
], AbstractCommandsQuickAccessProvider));
|
|
217
|
+
AbstractCommandsQuickAccessProvider = AbstractCommandsQuickAccessProvider_1 = ( (__decorate([
|
|
218
|
+
( (__param(1, IInstantiationService))),
|
|
219
|
+
( (__param(2, IKeybindingService))),
|
|
220
|
+
( (__param(3, ICommandService))),
|
|
221
|
+
( (__param(4, ITelemetryService))),
|
|
222
|
+
( (__param(5, IDialogService)))
|
|
223
|
+
], AbstractCommandsQuickAccessProvider)));
|
|
254
224
|
let CommandsHistory = class CommandsHistory extends Disposable {
|
|
255
225
|
static { CommandsHistory_1 = this; }
|
|
256
226
|
static { this.DEFAULT_COMMANDS_HISTORY_LENGTH = 50; }
|
|
@@ -297,7 +267,7 @@ let CommandsHistory = class CommandsHistory extends Disposable {
|
|
|
297
267
|
this.logService.error(`[CommandsHistory] invalid data: ${error}`);
|
|
298
268
|
}
|
|
299
269
|
}
|
|
300
|
-
const cache = CommandsHistory_1.cache = ( new LRUCache(this.configuredCommandsHistoryLength, 1));
|
|
270
|
+
const cache = CommandsHistory_1.cache = ( (new LRUCache(this.configuredCommandsHistoryLength, 1)));
|
|
301
271
|
if (serializedCache) {
|
|
302
272
|
let entries;
|
|
303
273
|
if (serializedCache.usesLRU) {
|
|
@@ -343,15 +313,15 @@ let CommandsHistory = class CommandsHistory extends Disposable {
|
|
|
343
313
|
}
|
|
344
314
|
static clearHistory(configurationService, storageService) {
|
|
345
315
|
const commandHistoryLength = CommandsHistory_1.getConfiguredCommandHistoryLength(configurationService);
|
|
346
|
-
CommandsHistory_1.cache = ( new LRUCache(commandHistoryLength));
|
|
316
|
+
CommandsHistory_1.cache = ( (new LRUCache(commandHistoryLength)));
|
|
347
317
|
CommandsHistory_1.counter = 1;
|
|
348
318
|
CommandsHistory_1.hasChanges = true;
|
|
349
319
|
}
|
|
350
320
|
};
|
|
351
|
-
CommandsHistory = CommandsHistory_1 = ( __decorate([
|
|
352
|
-
( __param(0, IStorageService)),
|
|
353
|
-
( __param(1, IConfigurationService)),
|
|
354
|
-
( __param(2, ILogService))
|
|
355
|
-
], CommandsHistory));
|
|
321
|
+
CommandsHistory = CommandsHistory_1 = ( (__decorate([
|
|
322
|
+
( (__param(0, IStorageService))),
|
|
323
|
+
( (__param(1, IConfigurationService))),
|
|
324
|
+
( (__param(2, ILogService)))
|
|
325
|
+
], CommandsHistory)));
|
|
356
326
|
|
|
357
327
|
export { AbstractCommandsQuickAccessProvider, CommandsHistory };
|
|
@@ -7,16 +7,17 @@ import { Extensions } from 'vscode/vscode/vs/platform/quickinput/common/quickAcc
|
|
|
7
7
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
8
8
|
|
|
9
9
|
var HelpQuickAccessProvider_1;
|
|
10
|
+
const _moduleId = "vs/platform/quickinput/browser/helpQuickAccess";
|
|
10
11
|
let HelpQuickAccessProvider = class HelpQuickAccessProvider {
|
|
11
12
|
static { HelpQuickAccessProvider_1 = this; }
|
|
12
13
|
static { this.PREFIX = '?'; }
|
|
13
14
|
constructor(quickInputService, keybindingService) {
|
|
14
15
|
this.quickInputService = quickInputService;
|
|
15
16
|
this.keybindingService = keybindingService;
|
|
16
|
-
this.registry = ( Registry.as(Extensions.Quickaccess));
|
|
17
|
+
this.registry = ( (Registry.as(Extensions.Quickaccess)));
|
|
17
18
|
}
|
|
18
19
|
provide(picker) {
|
|
19
|
-
const disposables = ( new DisposableStore());
|
|
20
|
+
const disposables = ( (new DisposableStore()));
|
|
20
21
|
disposables.add(picker.onDidAccept(() => {
|
|
21
22
|
const [item] = picker.selectedItems;
|
|
22
23
|
if (item) {
|
|
@@ -40,28 +41,24 @@ let HelpQuickAccessProvider = class HelpQuickAccessProvider {
|
|
|
40
41
|
return providers;
|
|
41
42
|
}
|
|
42
43
|
createPicks(provider) {
|
|
43
|
-
return (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
keybinding: helpEntry.commandId ? this.keybindingService.lookupKeybinding(helpEntry.commandId) : undefined,
|
|
50
|
-
ariaLabel: ( localizeWithPath(
|
|
51
|
-
'vs/platform/quickinput/browser/helpQuickAccess',
|
|
52
|
-
'helpPickAriaLabel',
|
|
53
|
-
"{0}, {1}",
|
|
44
|
+
return (
|
|
45
|
+
(provider.helpEntries.map(helpEntry => {
|
|
46
|
+
const prefix = helpEntry.prefix || provider.prefix;
|
|
47
|
+
const label = prefix || '\u2026' ;
|
|
48
|
+
return {
|
|
49
|
+
prefix,
|
|
54
50
|
label,
|
|
55
|
-
helpEntry.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
keybinding: helpEntry.commandId ? this.keybindingService.lookupKeybinding(helpEntry.commandId) : undefined,
|
|
52
|
+
ariaLabel: ( localizeWithPath(_moduleId, 0, "{0}, {1}", label, helpEntry.description)),
|
|
53
|
+
description: helpEntry.description
|
|
54
|
+
};
|
|
55
|
+
}))
|
|
56
|
+
);
|
|
60
57
|
}
|
|
61
58
|
};
|
|
62
|
-
HelpQuickAccessProvider = HelpQuickAccessProvider_1 = ( __decorate([
|
|
63
|
-
( __param(0, IQuickInputService)),
|
|
64
|
-
( __param(1, IKeybindingService))
|
|
65
|
-
], HelpQuickAccessProvider));
|
|
59
|
+
HelpQuickAccessProvider = HelpQuickAccessProvider_1 = ( (__decorate([
|
|
60
|
+
( (__param(0, IQuickInputService))),
|
|
61
|
+
( (__param(1, IKeybindingService)))
|
|
62
|
+
], HelpQuickAccessProvider)));
|
|
66
63
|
|
|
67
64
|
export { HelpQuickAccessProvider };
|
|
@@ -8,6 +8,7 @@ import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/comm
|
|
|
8
8
|
import { inQuickPickContext, getQuickNavigateHandler, defaultQuickAccessContext } from 'vscode/vscode/vs/workbench/browser/quickaccess';
|
|
9
9
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
10
10
|
|
|
11
|
+
const _moduleId = "vs/workbench/browser/actions/quickAccessActions";
|
|
11
12
|
const globalQuickAccessKeybinding = {
|
|
12
13
|
primary: 2048 | 46 ,
|
|
13
14
|
secondary: [2048 | 35 ],
|
|
@@ -103,11 +104,7 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
103
104
|
constructor() {
|
|
104
105
|
super({
|
|
105
106
|
id: 'workbench.action.quickOpen',
|
|
106
|
-
title: ( localize2WithPath(
|
|
107
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
108
|
-
'quickOpen',
|
|
109
|
-
"Go to File..."
|
|
110
|
-
)),
|
|
107
|
+
title: ( localize2WithPath(_moduleId, 0, "Go to File...")),
|
|
111
108
|
metadata: {
|
|
112
109
|
description: `Quick access`,
|
|
113
110
|
args: [{
|
|
@@ -135,11 +132,7 @@ registerAction2(class QuickAccessAction extends Action2 {
|
|
|
135
132
|
constructor() {
|
|
136
133
|
super({
|
|
137
134
|
id: 'workbench.action.quickOpenWithModes',
|
|
138
|
-
title: ( localizeWithPath(
|
|
139
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
140
|
-
'quickOpenWithModes',
|
|
141
|
-
"Quick Open"
|
|
142
|
-
)),
|
|
135
|
+
title: ( localizeWithPath(_moduleId, 1, "Quick Open")),
|
|
143
136
|
icon: Codicon.search,
|
|
144
137
|
menu: {
|
|
145
138
|
id: MenuId.CommandCenterCenter,
|
|
@@ -179,29 +172,17 @@ class BaseQuickAccessNavigateAction extends Action2 {
|
|
|
179
172
|
}
|
|
180
173
|
class QuickAccessNavigateNextAction extends BaseQuickAccessNavigateAction {
|
|
181
174
|
constructor() {
|
|
182
|
-
super('workbench.action.quickOpenNavigateNext', ( localize2WithPath(
|
|
183
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
184
|
-
'quickNavigateNext',
|
|
185
|
-
'Navigate Next in Quick Open'
|
|
186
|
-
)), true, true);
|
|
175
|
+
super('workbench.action.quickOpenNavigateNext', ( localize2WithPath(_moduleId, 2, 'Navigate Next in Quick Open')), true, true);
|
|
187
176
|
}
|
|
188
177
|
}
|
|
189
178
|
class QuickAccessNavigatePreviousAction extends BaseQuickAccessNavigateAction {
|
|
190
179
|
constructor() {
|
|
191
|
-
super('workbench.action.quickOpenNavigatePrevious', ( localize2WithPath(
|
|
192
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
193
|
-
'quickNavigatePrevious',
|
|
194
|
-
'Navigate Previous in Quick Open'
|
|
195
|
-
)), false, true);
|
|
180
|
+
super('workbench.action.quickOpenNavigatePrevious', ( localize2WithPath(_moduleId, 3, 'Navigate Previous in Quick Open')), false, true);
|
|
196
181
|
}
|
|
197
182
|
}
|
|
198
183
|
class QuickAccessSelectNextAction extends BaseQuickAccessNavigateAction {
|
|
199
184
|
constructor() {
|
|
200
|
-
super('workbench.action.quickOpenSelectNext', ( localize2WithPath(
|
|
201
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
202
|
-
'quickSelectNext',
|
|
203
|
-
'Select Next in Quick Open'
|
|
204
|
-
)), true, false, {
|
|
185
|
+
super('workbench.action.quickOpenSelectNext', ( localize2WithPath(_moduleId, 4, 'Select Next in Quick Open')), true, false, {
|
|
205
186
|
weight: 200 + 50,
|
|
206
187
|
when: inQuickPickContext,
|
|
207
188
|
primary: 0,
|
|
@@ -211,11 +192,7 @@ class QuickAccessSelectNextAction extends BaseQuickAccessNavigateAction {
|
|
|
211
192
|
}
|
|
212
193
|
class QuickAccessSelectPreviousAction extends BaseQuickAccessNavigateAction {
|
|
213
194
|
constructor() {
|
|
214
|
-
super('workbench.action.quickOpenSelectPrevious', ( localize2WithPath(
|
|
215
|
-
'vs/workbench/browser/actions/quickAccessActions',
|
|
216
|
-
'quickSelectPrevious',
|
|
217
|
-
'Select Previous in Quick Open'
|
|
218
|
-
)), false, false, {
|
|
195
|
+
super('workbench.action.quickOpenSelectPrevious', ( localize2WithPath(_moduleId, 5, 'Select Previous in Quick Open')), false, false, {
|
|
219
196
|
weight: 200 + 50,
|
|
220
197
|
when: inQuickPickContext,
|
|
221
198
|
primary: 0,
|
package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js
CHANGED
|
@@ -9,6 +9,7 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
|
|
|
9
9
|
import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
10
10
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
11
11
|
|
|
12
|
+
const _moduleId = "vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess";
|
|
12
13
|
let GotoLineQuickAccessProvider = class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {
|
|
13
14
|
constructor(editorService, editorGroupService, configurationService) {
|
|
14
15
|
super();
|
|
@@ -41,21 +42,17 @@ let GotoLineQuickAccessProvider = class GotoLineQuickAccessProvider extends Abst
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
|
-
GotoLineQuickAccessProvider = ( __decorate([
|
|
45
|
-
( __param(0, IEditorService)),
|
|
46
|
-
( __param(1, IEditorGroupsService)),
|
|
47
|
-
( __param(2, IConfigurationService))
|
|
48
|
-
], GotoLineQuickAccessProvider));
|
|
45
|
+
GotoLineQuickAccessProvider = ( (__decorate([
|
|
46
|
+
( (__param(0, IEditorService))),
|
|
47
|
+
( (__param(1, IEditorGroupsService))),
|
|
48
|
+
( (__param(2, IConfigurationService)))
|
|
49
|
+
], GotoLineQuickAccessProvider)));
|
|
49
50
|
class GotoLineAction extends Action2 {
|
|
50
51
|
static { this.ID = 'workbench.action.gotoLine'; }
|
|
51
52
|
constructor() {
|
|
52
53
|
super({
|
|
53
54
|
id: GotoLineAction.ID,
|
|
54
|
-
title: ( localize2WithPath(
|
|
55
|
-
'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess',
|
|
56
|
-
'gotoLine',
|
|
57
|
-
'Go to Line/Column...'
|
|
58
|
-
)),
|
|
55
|
+
title: ( localize2WithPath(_moduleId, 0, 'Go to Line/Column...')),
|
|
59
56
|
f1: true,
|
|
60
57
|
keybinding: {
|
|
61
58
|
weight: 200 ,
|
|
@@ -70,19 +67,15 @@ class GotoLineAction extends Action2 {
|
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
registerAction2(GotoLineAction);
|
|
73
|
-
( Registry.as(Extensions.Quickaccess)).registerQuickAccessProvider({
|
|
70
|
+
( (Registry.as(Extensions.Quickaccess))).registerQuickAccessProvider({
|
|
74
71
|
ctor: GotoLineQuickAccessProvider,
|
|
75
72
|
prefix: AbstractGotoLineQuickAccessProvider.PREFIX,
|
|
76
73
|
placeholder: ( localizeWithPath(
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
_moduleId,
|
|
75
|
+
1,
|
|
79
76
|
"Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."
|
|
80
77
|
)),
|
|
81
|
-
helpEntries: [{ description: ( localizeWithPath(
|
|
82
|
-
'vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess',
|
|
83
|
-
'gotoLineQuickAccess',
|
|
84
|
-
"Go to Line/Column"
|
|
85
|
-
)), commandId: GotoLineAction.ID }]
|
|
78
|
+
helpEntries: [{ description: ( localizeWithPath(_moduleId, 2, "Go to Line/Column")), commandId: GotoLineAction.ID }]
|
|
86
79
|
});
|
|
87
80
|
|
|
88
81
|
export { GotoLineQuickAccessProvider };
|
|
@@ -34,6 +34,7 @@ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extension
|
|
|
34
34
|
import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
35
35
|
|
|
36
36
|
var CommandsQuickAccessProvider_1;
|
|
37
|
+
const _moduleId = "vs/workbench/contrib/quickaccess/browser/commandsQuickAccess";
|
|
37
38
|
let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends AbstractEditorCommandsQuickAccessProvider {
|
|
38
39
|
static { CommandsQuickAccessProvider_1 = this; }
|
|
39
40
|
static { this.AI_RELATED_INFORMATION_MAX_PICKS = 5; }
|
|
@@ -50,11 +51,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
50
51
|
super({
|
|
51
52
|
showAlias: !Language.isDefaultVariant(),
|
|
52
53
|
noResultsPick: () => ({
|
|
53
|
-
label: ( localizeWithPath(
|
|
54
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
55
|
-
'noCommandResults',
|
|
56
|
-
"No matching commands"
|
|
57
|
-
)),
|
|
54
|
+
label: ( localizeWithPath(_moduleId, 0, "No matching commands")),
|
|
58
55
|
commandId: ''
|
|
59
56
|
}),
|
|
60
57
|
}, instantiationService, keybindingService, commandService, telemetryService, dialogService);
|
|
@@ -85,7 +82,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
85
82
|
}
|
|
86
83
|
const config = this.configuration;
|
|
87
84
|
const suggestedCommandIds = config.experimental.suggestCommands && this.productService.commandPaletteSuggestedCommandIds?.length
|
|
88
|
-
? ( new Set(this.productService.commandPaletteSuggestedCommandIds))
|
|
85
|
+
? ( (new Set(this.productService.commandPaletteSuggestedCommandIds)))
|
|
89
86
|
: undefined;
|
|
90
87
|
this.options.suggestedCommandIds = suggestedCommandIds;
|
|
91
88
|
this.useAiRelatedInfo = config.experimental.enableNaturalLanguageSearch;
|
|
@@ -95,24 +92,22 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
95
92
|
if (token.isCancellationRequested) {
|
|
96
93
|
return [];
|
|
97
94
|
}
|
|
98
|
-
return (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
})));
|
|
95
|
+
return (
|
|
96
|
+
([
|
|
97
|
+
...this.getCodeEditorCommandPicks(),
|
|
98
|
+
...this.getGlobalCommandPicks()
|
|
99
|
+
].map(picks => ({
|
|
100
|
+
...picks,
|
|
101
|
+
buttons: [{
|
|
102
|
+
iconClass: ThemeIcon.asClassName(Codicon.gear),
|
|
103
|
+
tooltip: ( localizeWithPath(_moduleId, 1, "Configure Keybinding")),
|
|
104
|
+
}],
|
|
105
|
+
trigger: () => {
|
|
106
|
+
this.preferencesService.openGlobalKeybindingSettings(false, { query: `@command:${picks.commandId}` });
|
|
107
|
+
return TriggerAction.CLOSE_PICKER;
|
|
108
|
+
},
|
|
109
|
+
})))
|
|
110
|
+
);
|
|
116
111
|
}
|
|
117
112
|
hasAdditionalCommandPicks(filter, token) {
|
|
118
113
|
if (!this.useAiRelatedInfo
|
|
@@ -143,13 +138,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
143
138
|
const defaultAgent = this.chatAgentService.getDefaultAgent(ChatAgentLocation.Panel);
|
|
144
139
|
if (defaultAgent) {
|
|
145
140
|
additionalPicks.push({
|
|
146
|
-
label: ( localizeWithPath(
|
|
147
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
148
|
-
'askXInChat',
|
|
149
|
-
"Ask {0}: {1}",
|
|
150
|
-
defaultAgent.metadata.fullName,
|
|
151
|
-
filter
|
|
152
|
-
)),
|
|
141
|
+
label: ( localizeWithPath(_moduleId, 2, "Ask {0}: {1}", defaultAgent.metadata.fullName, filter)),
|
|
153
142
|
commandId: this.configuration.experimental.askChatLocation === 'quickChat' ? ASK_QUICK_QUESTION_ACTION_ID : CHAT_OPEN_ACTION_ID,
|
|
154
143
|
args: [filter]
|
|
155
144
|
});
|
|
@@ -159,13 +148,13 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
159
148
|
async getRelatedInformationPicks(allPicks, picksSoFar, filter, token) {
|
|
160
149
|
const relatedInformation = await this.aiRelatedInformationService.getRelatedInformation(filter, [RelatedInformationType.CommandInformation], token);
|
|
161
150
|
relatedInformation.sort((a, b) => b.weight - a.weight);
|
|
162
|
-
const setOfPicksSoFar = ( new Set((
|
|
163
|
-
const additionalPicks = ( new Array());
|
|
151
|
+
const setOfPicksSoFar = ( (new Set( (picksSoFar.map(p => p.commandId)))));
|
|
152
|
+
const additionalPicks = ( (new Array()));
|
|
164
153
|
for (const info of relatedInformation) {
|
|
165
154
|
if (info.weight < CommandsQuickAccessProvider_1.AI_RELATED_INFORMATION_THRESHOLD || additionalPicks.length === CommandsQuickAccessProvider_1.AI_RELATED_INFORMATION_MAX_PICKS) {
|
|
166
155
|
break;
|
|
167
156
|
}
|
|
168
|
-
const pick = allPicks.find(p => p.commandId === info.command && !( setOfPicksSoFar.has(p.commandId)));
|
|
157
|
+
const pick = allPicks.find(p => p.commandId === info.command && !( (setOfPicksSoFar.has(p.commandId))));
|
|
169
158
|
if (pick) {
|
|
170
159
|
additionalPicks.push(pick);
|
|
171
160
|
}
|
|
@@ -183,13 +172,7 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
183
172
|
let label = (typeof action.item.title === 'string' ? action.item.title : action.item.title.value) || action.item.id;
|
|
184
173
|
const category = typeof action.item.category === 'string' ? action.item.category : action.item.category?.value;
|
|
185
174
|
if (category) {
|
|
186
|
-
label = ( localizeWithPath(
|
|
187
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
188
|
-
'commandWithCategory',
|
|
189
|
-
"{0}: {1}",
|
|
190
|
-
category,
|
|
191
|
-
label
|
|
192
|
-
));
|
|
175
|
+
label = ( localizeWithPath(_moduleId, 3, "{0}: {1}", category, label));
|
|
193
176
|
}
|
|
194
177
|
const aliasLabel = typeof action.item.title !== 'string' ? action.item.title.original : undefined;
|
|
195
178
|
const aliasCategory = (category && action.item.category && typeof action.item.category !== 'string') ? action.item.category.original : undefined;
|
|
@@ -211,32 +194,28 @@ let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends Abst
|
|
|
211
194
|
return globalCommandPicks;
|
|
212
195
|
}
|
|
213
196
|
};
|
|
214
|
-
CommandsQuickAccessProvider = CommandsQuickAccessProvider_1 = ( __decorate([
|
|
215
|
-
( __param(0, IEditorService)),
|
|
216
|
-
( __param(1, IMenuService)),
|
|
217
|
-
( __param(2, IExtensionService)),
|
|
218
|
-
( __param(3, IInstantiationService)),
|
|
219
|
-
( __param(4, IKeybindingService)),
|
|
220
|
-
( __param(5, ICommandService)),
|
|
221
|
-
( __param(6, ITelemetryService)),
|
|
222
|
-
( __param(7, IDialogService)),
|
|
223
|
-
( __param(8, IConfigurationService)),
|
|
224
|
-
( __param(9, IEditorGroupsService)),
|
|
225
|
-
( __param(10, IPreferencesService)),
|
|
226
|
-
( __param(11, IProductService)),
|
|
227
|
-
( __param(12, IAiRelatedInformationService)),
|
|
228
|
-
( __param(13, IChatAgentService))
|
|
229
|
-
], CommandsQuickAccessProvider));
|
|
197
|
+
CommandsQuickAccessProvider = CommandsQuickAccessProvider_1 = ( (__decorate([
|
|
198
|
+
( (__param(0, IEditorService))),
|
|
199
|
+
( (__param(1, IMenuService))),
|
|
200
|
+
( (__param(2, IExtensionService))),
|
|
201
|
+
( (__param(3, IInstantiationService))),
|
|
202
|
+
( (__param(4, IKeybindingService))),
|
|
203
|
+
( (__param(5, ICommandService))),
|
|
204
|
+
( (__param(6, ITelemetryService))),
|
|
205
|
+
( (__param(7, IDialogService))),
|
|
206
|
+
( (__param(8, IConfigurationService))),
|
|
207
|
+
( (__param(9, IEditorGroupsService))),
|
|
208
|
+
( (__param(10, IPreferencesService))),
|
|
209
|
+
( (__param(11, IProductService))),
|
|
210
|
+
( (__param(12, IAiRelatedInformationService))),
|
|
211
|
+
( (__param(13, IChatAgentService)))
|
|
212
|
+
], CommandsQuickAccessProvider)));
|
|
230
213
|
class ShowAllCommandsAction extends Action2 {
|
|
231
214
|
static { this.ID = 'workbench.action.showCommands'; }
|
|
232
215
|
constructor() {
|
|
233
216
|
super({
|
|
234
217
|
id: ShowAllCommandsAction.ID,
|
|
235
|
-
title: ( localize2WithPath(
|
|
236
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
237
|
-
'showTriggerActions',
|
|
238
|
-
'Show All Commands'
|
|
239
|
-
)),
|
|
218
|
+
title: ( localize2WithPath(_moduleId, 4, 'Show All Commands')),
|
|
240
219
|
keybinding: {
|
|
241
220
|
weight: 200 ,
|
|
242
221
|
when: undefined,
|
|
@@ -254,11 +233,7 @@ class ClearCommandHistoryAction extends Action2 {
|
|
|
254
233
|
constructor() {
|
|
255
234
|
super({
|
|
256
235
|
id: 'workbench.action.clearCommandHistory',
|
|
257
|
-
title: ( localize2WithPath(
|
|
258
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
259
|
-
'clearCommandHistory',
|
|
260
|
-
'Clear Command History'
|
|
261
|
-
)),
|
|
236
|
+
title: ( localize2WithPath(_moduleId, 5, 'Clear Command History')),
|
|
262
237
|
f1: true
|
|
263
238
|
});
|
|
264
239
|
}
|
|
@@ -271,20 +246,12 @@ class ClearCommandHistoryAction extends Action2 {
|
|
|
271
246
|
const { confirmed } = await dialogService.confirm({
|
|
272
247
|
type: 'warning',
|
|
273
248
|
message: ( localizeWithPath(
|
|
274
|
-
|
|
275
|
-
|
|
249
|
+
_moduleId,
|
|
250
|
+
6,
|
|
276
251
|
"Do you want to clear the history of recently used commands?"
|
|
277
252
|
)),
|
|
278
|
-
detail: ( localizeWithPath(
|
|
279
|
-
|
|
280
|
-
'confirmClearDetail',
|
|
281
|
-
"This action is irreversible!"
|
|
282
|
-
)),
|
|
283
|
-
primaryButton: ( localizeWithPath(
|
|
284
|
-
'vs/workbench/contrib/quickaccess/browser/commandsQuickAccess',
|
|
285
|
-
{ key: 'clearButtonLabel', comment: ['&& denotes a mnemonic'] },
|
|
286
|
-
"&&Clear"
|
|
287
|
-
))
|
|
253
|
+
detail: ( localizeWithPath(_moduleId, 7, "This action is irreversible!")),
|
|
254
|
+
primaryButton: ( localizeWithPath(_moduleId, 8, "&&Clear"))
|
|
288
255
|
});
|
|
289
256
|
if (!confirmed) {
|
|
290
257
|
return;
|
|
@@ -10,28 +10,21 @@ import { inQuickPickContext, getQuickNavigateHandler } from 'vscode/vscode/vs/wo
|
|
|
10
10
|
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
11
11
|
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const _moduleId = "vs/workbench/contrib/quickaccess/browser/quickAccess.contribution";
|
|
14
|
+
const quickAccessRegistry = ( (Registry.as(Extensions.Quickaccess)));
|
|
14
15
|
quickAccessRegistry.registerQuickAccessProvider({
|
|
15
16
|
ctor: HelpQuickAccessProvider,
|
|
16
17
|
prefix: HelpQuickAccessProvider.PREFIX,
|
|
17
18
|
placeholder: ( localizeWithPath(
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
_moduleId,
|
|
20
|
+
0,
|
|
20
21
|
"Type '{0}' to get help on the actions you can take from here.",
|
|
21
22
|
HelpQuickAccessProvider.PREFIX
|
|
22
23
|
)),
|
|
23
24
|
helpEntries: [{
|
|
24
|
-
description: ( localizeWithPath(
|
|
25
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
26
|
-
'helpQuickAccess',
|
|
27
|
-
"Show all Quick Access Providers"
|
|
28
|
-
)),
|
|
25
|
+
description: ( localizeWithPath(_moduleId, 1, "Show all Quick Access Providers")),
|
|
29
26
|
commandCenterOrder: 70,
|
|
30
|
-
commandCenterLabel: ( localizeWithPath(
|
|
31
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
32
|
-
'more',
|
|
33
|
-
'More'
|
|
34
|
-
))
|
|
27
|
+
commandCenterLabel: ( localizeWithPath(_moduleId, 2, 'More'))
|
|
35
28
|
}]
|
|
36
29
|
});
|
|
37
30
|
quickAccessRegistry.registerQuickAccessProvider({
|
|
@@ -39,40 +32,24 @@ quickAccessRegistry.registerQuickAccessProvider({
|
|
|
39
32
|
prefix: ViewQuickAccessProvider.PREFIX,
|
|
40
33
|
contextKey: 'inViewsPicker',
|
|
41
34
|
placeholder: ( localizeWithPath(
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
_moduleId,
|
|
36
|
+
3,
|
|
44
37
|
"Type the name of a view, output channel or terminal to open."
|
|
45
38
|
)),
|
|
46
|
-
helpEntries: [{ description: ( localizeWithPath(
|
|
47
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
48
|
-
'viewQuickAccess',
|
|
49
|
-
"Open View"
|
|
50
|
-
)), commandId: OpenViewPickerAction.ID }]
|
|
39
|
+
helpEntries: [{ description: ( localizeWithPath(_moduleId, 4, "Open View")), commandId: OpenViewPickerAction.ID }]
|
|
51
40
|
});
|
|
52
41
|
quickAccessRegistry.registerQuickAccessProvider({
|
|
53
42
|
ctor: CommandsQuickAccessProvider,
|
|
54
43
|
prefix: CommandsQuickAccessProvider.PREFIX,
|
|
55
44
|
contextKey: 'inCommandsPicker',
|
|
56
|
-
placeholder: ( localizeWithPath(
|
|
57
|
-
|
|
58
|
-
'commandsQuickAccessPlaceholder',
|
|
59
|
-
"Type the name of a command to run."
|
|
60
|
-
)),
|
|
61
|
-
helpEntries: [{ description: ( localizeWithPath(
|
|
62
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
63
|
-
'commandsQuickAccess',
|
|
64
|
-
"Show and Run Commands"
|
|
65
|
-
)), commandId: ShowAllCommandsAction.ID, commandCenterOrder: 20 }]
|
|
45
|
+
placeholder: ( localizeWithPath(_moduleId, 5, "Type the name of a command to run.")),
|
|
46
|
+
helpEntries: [{ description: ( localizeWithPath(_moduleId, 6, "Show and Run Commands")), commandId: ShowAllCommandsAction.ID, commandCenterOrder: 20 }]
|
|
66
47
|
});
|
|
67
48
|
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
68
49
|
group: '1_open',
|
|
69
50
|
command: {
|
|
70
51
|
id: ShowAllCommandsAction.ID,
|
|
71
|
-
title: ( localizeWithPath(
|
|
72
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
73
|
-
{ key: 'miCommandPalette', comment: ['&& denotes a mnemonic'] },
|
|
74
|
-
"&&Command Palette..."
|
|
75
|
-
))
|
|
52
|
+
title: ( localizeWithPath(_moduleId, 7, "&&Command Palette..."))
|
|
76
53
|
},
|
|
77
54
|
order: 1
|
|
78
55
|
});
|
|
@@ -80,11 +57,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
|
|
|
80
57
|
group: '1_welcome',
|
|
81
58
|
command: {
|
|
82
59
|
id: ShowAllCommandsAction.ID,
|
|
83
|
-
title: ( localizeWithPath(
|
|
84
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
85
|
-
{ key: 'miShowAllCommands', comment: ['&& denotes a mnemonic'] },
|
|
86
|
-
"Show All Commands"
|
|
87
|
-
))
|
|
60
|
+
title: ( localizeWithPath(_moduleId, 8, "Show All Commands"))
|
|
88
61
|
},
|
|
89
62
|
order: 2
|
|
90
63
|
});
|
|
@@ -92,11 +65,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
|
92
65
|
group: '1_open',
|
|
93
66
|
command: {
|
|
94
67
|
id: OpenViewPickerAction.ID,
|
|
95
|
-
title: ( localizeWithPath(
|
|
96
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
97
|
-
{ key: 'miOpenView', comment: ['&& denotes a mnemonic'] },
|
|
98
|
-
"&&Open View..."
|
|
99
|
-
))
|
|
68
|
+
title: ( localizeWithPath(_moduleId, 9, "&&Open View..."))
|
|
100
69
|
},
|
|
101
70
|
order: 2
|
|
102
71
|
});
|
|
@@ -104,11 +73,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
|
104
73
|
group: '5_infile_nav',
|
|
105
74
|
command: {
|
|
106
75
|
id: 'workbench.action.gotoLine',
|
|
107
|
-
title: ( localizeWithPath(
|
|
108
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
109
|
-
{ key: 'miGotoLine', comment: ['&& denotes a mnemonic'] },
|
|
110
|
-
"Go to &&Line/Column..."
|
|
111
|
-
))
|
|
76
|
+
title: ( localizeWithPath(_moduleId, 10, "Go to &&Line/Column..."))
|
|
112
77
|
},
|
|
113
78
|
order: 1
|
|
114
79
|
});
|
|
@@ -116,24 +81,16 @@ MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
|
116
81
|
group: '1_command',
|
|
117
82
|
command: {
|
|
118
83
|
id: ShowAllCommandsAction.ID,
|
|
119
|
-
title: ( localizeWithPath(
|
|
120
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
121
|
-
'commandPalette',
|
|
122
|
-
"Command Palette..."
|
|
123
|
-
))
|
|
84
|
+
title: ( localizeWithPath(_moduleId, 11, "Command Palette..."))
|
|
124
85
|
},
|
|
125
86
|
order: 1
|
|
126
87
|
});
|
|
127
88
|
MenuRegistry.appendMenuItem(MenuId.EditorContext, {
|
|
128
89
|
group: 'z_commands',
|
|
129
|
-
when: ( EditorContextKeys.editorSimpleInput.toNegated()),
|
|
90
|
+
when: ( (EditorContextKeys.editorSimpleInput.toNegated())),
|
|
130
91
|
command: {
|
|
131
92
|
id: ShowAllCommandsAction.ID,
|
|
132
|
-
title: ( localizeWithPath(
|
|
133
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
134
|
-
'commandPalette',
|
|
135
|
-
"Command Palette..."
|
|
136
|
-
)),
|
|
93
|
+
title: ( localizeWithPath(_moduleId, 11, "Command Palette...")),
|
|
137
94
|
},
|
|
138
95
|
order: 1
|
|
139
96
|
});
|
|
@@ -142,7 +99,10 @@ registerAction2(ShowAllCommandsAction);
|
|
|
142
99
|
registerAction2(OpenViewPickerAction);
|
|
143
100
|
registerAction2(QuickAccessViewPickerAction);
|
|
144
101
|
const inViewsPickerContextKey = 'inViewsPicker';
|
|
145
|
-
const inViewsPickerContext = ( ContextKeyExpr.and(
|
|
102
|
+
const inViewsPickerContext = ( (ContextKeyExpr.and(
|
|
103
|
+
inQuickPickContext,
|
|
104
|
+
(ContextKeyExpr.has(inViewsPickerContextKey))
|
|
105
|
+
)));
|
|
146
106
|
const viewPickerKeybinding = QuickAccessViewPickerAction.KEYBINDING;
|
|
147
107
|
const quickAccessNavigateNextInViewPickerId = 'workbench.action.quickOpenNavigateNextInViewPicker';
|
|
148
108
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
@@ -18,17 +18,14 @@ import { REPL_VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/debug/common/de
|
|
|
18
18
|
import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug.service';
|
|
19
19
|
|
|
20
20
|
var ViewQuickAccessProvider_1;
|
|
21
|
+
const _moduleId = "vs/workbench/contrib/quickaccess/browser/viewQuickAccess";
|
|
21
22
|
let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickAccessProvider {
|
|
22
23
|
static { ViewQuickAccessProvider_1 = this; }
|
|
23
24
|
static { this.PREFIX = 'view '; }
|
|
24
25
|
constructor(viewDescriptorService, viewsService, outputService, terminalService, terminalGroupService, debugService, paneCompositeService, contextKeyService) {
|
|
25
26
|
super(ViewQuickAccessProvider_1.PREFIX, {
|
|
26
27
|
noResultsPick: {
|
|
27
|
-
label: ( localizeWithPath(
|
|
28
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
29
|
-
'noViewResults',
|
|
30
|
-
"No matching views"
|
|
31
|
-
)),
|
|
28
|
+
label: ( localizeWithPath(_moduleId, 0, "No matching views")),
|
|
32
29
|
containerLabel: ''
|
|
33
30
|
}
|
|
34
31
|
});
|
|
@@ -49,9 +46,9 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
49
46
|
entry.highlights = { label: matchesFuzzy(filter, entry.label, true) ?? undefined };
|
|
50
47
|
return entry.highlights.label || fuzzyContains(entry.containerLabel, filter);
|
|
51
48
|
});
|
|
52
|
-
const mapEntryToContainer = ( new Map());
|
|
49
|
+
const mapEntryToContainer = ( (new Map()));
|
|
53
50
|
for (const entry of filteredViewEntries) {
|
|
54
|
-
if (!( mapEntryToContainer.has(entry.label))) {
|
|
51
|
+
if (!( (mapEntryToContainer.has(entry.label)))) {
|
|
55
52
|
mapEntryToContainer.set(entry.label, entry.containerLabel);
|
|
56
53
|
}
|
|
57
54
|
}
|
|
@@ -61,7 +58,7 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
61
58
|
if (lastContainer !== entry.containerLabel) {
|
|
62
59
|
lastContainer = entry.containerLabel;
|
|
63
60
|
let separatorLabel;
|
|
64
|
-
if (( mapEntryToContainer.has(lastContainer))) {
|
|
61
|
+
if (( (mapEntryToContainer.has(lastContainer)))) {
|
|
65
62
|
separatorLabel = `${mapEntryToContainer.get(lastContainer)} / ${lastContainer}`;
|
|
66
63
|
}
|
|
67
64
|
else {
|
|
@@ -116,21 +113,9 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
116
113
|
}
|
|
117
114
|
}
|
|
118
115
|
};
|
|
119
|
-
addPaneComposites(0 , ( localizeWithPath(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"Side Bar"
|
|
123
|
-
)));
|
|
124
|
-
addPaneComposites(1 , ( localizeWithPath(
|
|
125
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
126
|
-
'panels',
|
|
127
|
-
"Panel"
|
|
128
|
-
)));
|
|
129
|
-
addPaneComposites(2 , ( localizeWithPath(
|
|
130
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
131
|
-
'secondary side bar',
|
|
132
|
-
"Secondary Side Bar"
|
|
133
|
-
)));
|
|
116
|
+
addPaneComposites(0 , ( localizeWithPath(_moduleId, 1, "Side Bar")));
|
|
117
|
+
addPaneComposites(1 , ( localizeWithPath(_moduleId, 2, "Panel")));
|
|
118
|
+
addPaneComposites(2 , ( localizeWithPath(_moduleId, 3, "Secondary Side Bar")));
|
|
134
119
|
const addPaneCompositeViews = (location) => {
|
|
135
120
|
const paneComposites = this.paneCompositeService.getPaneComposites(location);
|
|
136
121
|
for (const paneComposite of paneComposites) {
|
|
@@ -146,19 +131,15 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
146
131
|
this.terminalGroupService.groups.forEach((group, groupIndex) => {
|
|
147
132
|
group.terminalInstances.forEach((terminal, terminalIndex) => {
|
|
148
133
|
const label = ( localizeWithPath(
|
|
149
|
-
|
|
150
|
-
|
|
134
|
+
_moduleId,
|
|
135
|
+
4,
|
|
151
136
|
"{0}: {1}",
|
|
152
137
|
`${groupIndex + 1}.${terminalIndex + 1}`,
|
|
153
138
|
terminal.title
|
|
154
139
|
));
|
|
155
140
|
viewEntries.push({
|
|
156
141
|
label,
|
|
157
|
-
containerLabel: ( localizeWithPath(
|
|
158
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
159
|
-
'terminals',
|
|
160
|
-
"Terminal"
|
|
161
|
-
)),
|
|
142
|
+
containerLabel: ( localizeWithPath(_moduleId, 5, "Terminal")),
|
|
162
143
|
accept: async () => {
|
|
163
144
|
await this.terminalGroupService.showPanel(true);
|
|
164
145
|
this.terminalService.setActiveInstance(terminal);
|
|
@@ -170,11 +151,7 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
170
151
|
const label = session.name;
|
|
171
152
|
viewEntries.push({
|
|
172
153
|
label,
|
|
173
|
-
containerLabel: ( localizeWithPath(
|
|
174
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
175
|
-
'debugConsoles',
|
|
176
|
-
"Debug Console"
|
|
177
|
-
)),
|
|
154
|
+
containerLabel: ( localizeWithPath(_moduleId, 6, "Debug Console")),
|
|
178
155
|
accept: async () => {
|
|
179
156
|
await this.debugService.focusStackFrame(undefined, undefined, session, { explicit: true });
|
|
180
157
|
if (!this.viewsService.isViewVisible(REPL_VIEW_ID)) {
|
|
@@ -187,11 +164,7 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
187
164
|
for (const channel of channels) {
|
|
188
165
|
viewEntries.push({
|
|
189
166
|
label: channel.label,
|
|
190
|
-
containerLabel: ( localizeWithPath(
|
|
191
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
192
|
-
'channels',
|
|
193
|
-
"Output"
|
|
194
|
-
)),
|
|
167
|
+
containerLabel: ( localizeWithPath(_moduleId, 7, "Output")),
|
|
195
168
|
accept: () => this.outputService.showChannel(channel.id)
|
|
196
169
|
});
|
|
197
170
|
}
|
|
@@ -205,26 +178,22 @@ let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickA
|
|
|
205
178
|
return true;
|
|
206
179
|
}
|
|
207
180
|
};
|
|
208
|
-
ViewQuickAccessProvider = ViewQuickAccessProvider_1 = ( __decorate([
|
|
209
|
-
( __param(0, IViewDescriptorService)),
|
|
210
|
-
( __param(1, IViewsService)),
|
|
211
|
-
( __param(2, IOutputService)),
|
|
212
|
-
( __param(3, ITerminalService)),
|
|
213
|
-
( __param(4, ITerminalGroupService)),
|
|
214
|
-
( __param(5, IDebugService)),
|
|
215
|
-
( __param(6, IPaneCompositePartService)),
|
|
216
|
-
( __param(7, IContextKeyService))
|
|
217
|
-
], ViewQuickAccessProvider));
|
|
181
|
+
ViewQuickAccessProvider = ViewQuickAccessProvider_1 = ( (__decorate([
|
|
182
|
+
( (__param(0, IViewDescriptorService))),
|
|
183
|
+
( (__param(1, IViewsService))),
|
|
184
|
+
( (__param(2, IOutputService))),
|
|
185
|
+
( (__param(3, ITerminalService))),
|
|
186
|
+
( (__param(4, ITerminalGroupService))),
|
|
187
|
+
( (__param(5, IDebugService))),
|
|
188
|
+
( (__param(6, IPaneCompositePartService))),
|
|
189
|
+
( (__param(7, IContextKeyService)))
|
|
190
|
+
], ViewQuickAccessProvider)));
|
|
218
191
|
class OpenViewPickerAction extends Action2 {
|
|
219
192
|
static { this.ID = 'workbench.action.openView'; }
|
|
220
193
|
constructor() {
|
|
221
194
|
super({
|
|
222
195
|
id: OpenViewPickerAction.ID,
|
|
223
|
-
title: ( localize2WithPath(
|
|
224
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
225
|
-
'openView',
|
|
226
|
-
'Open View'
|
|
227
|
-
)),
|
|
196
|
+
title: ( localize2WithPath(_moduleId, 8, 'Open View')),
|
|
228
197
|
category: Categories.View,
|
|
229
198
|
f1: true
|
|
230
199
|
});
|
|
@@ -243,11 +212,7 @@ class QuickAccessViewPickerAction extends Action2 {
|
|
|
243
212
|
constructor() {
|
|
244
213
|
super({
|
|
245
214
|
id: QuickAccessViewPickerAction.ID,
|
|
246
|
-
title: ( localize2WithPath(
|
|
247
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
248
|
-
'quickOpenView',
|
|
249
|
-
'Quick Open View'
|
|
250
|
-
)),
|
|
215
|
+
title: ( localize2WithPath(_moduleId, 9, 'Quick Open View')),
|
|
251
216
|
category: Categories.View,
|
|
252
217
|
f1: false,
|
|
253
218
|
keybinding: {
|
|
@@ -9,17 +9,14 @@ import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/c
|
|
|
9
9
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
10
10
|
import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const _moduleId = "vs/workbench/contrib/url/browser/trustedDomains";
|
|
13
|
+
const TRUSTED_DOMAINS_URI = ( (URI.parse('trustedDomains:/Trusted Domains')));
|
|
13
14
|
const TRUSTED_DOMAINS_STORAGE_KEY = 'http.linkProtectionTrustedDomains';
|
|
14
15
|
const TRUSTED_DOMAINS_CONTENT_STORAGE_KEY = 'http.linkProtectionTrustedDomainsContent';
|
|
15
16
|
const manageTrustedDomainSettingsCommand = {
|
|
16
17
|
id: 'workbench.action.manageTrustedDomain',
|
|
17
18
|
description: {
|
|
18
|
-
description: ( localize2WithPath(
|
|
19
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
20
|
-
'trustedDomain.manageTrustedDomain',
|
|
21
|
-
'Manage Trusted Domains'
|
|
22
|
-
)),
|
|
19
|
+
description: ( localize2WithPath(_moduleId, 0, 'Manage Trusted Domains')),
|
|
23
20
|
args: []
|
|
24
21
|
},
|
|
25
22
|
handler: async (accessor) => {
|
|
@@ -29,19 +26,14 @@ const manageTrustedDomainSettingsCommand = {
|
|
|
29
26
|
}
|
|
30
27
|
};
|
|
31
28
|
async function configureOpenerTrustedDomainsHandler(trustedDomains, domainToConfigure, resource, quickInputService, storageService, editorService, telemetryService) {
|
|
32
|
-
const parsedDomainToConfigure = ( URI.parse(domainToConfigure));
|
|
29
|
+
const parsedDomainToConfigure = ( (URI.parse(domainToConfigure)));
|
|
33
30
|
const toplevelDomainSegements = parsedDomainToConfigure.authority.split('.');
|
|
34
31
|
const domainEnd = toplevelDomainSegements.slice(toplevelDomainSegements.length - 2).join('.');
|
|
35
32
|
const topLevelDomain = '*.' + domainEnd;
|
|
36
33
|
const options = [];
|
|
37
34
|
options.push({
|
|
38
35
|
type: 'item',
|
|
39
|
-
label: ( localizeWithPath(
|
|
40
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
41
|
-
'trustedDomain.trustDomain',
|
|
42
|
-
'Trust {0}',
|
|
43
|
-
domainToConfigure
|
|
44
|
-
)),
|
|
36
|
+
label: ( localizeWithPath(_moduleId, 1, 'Trust {0}', domainToConfigure)),
|
|
45
37
|
id: 'trust',
|
|
46
38
|
toTrust: domainToConfigure,
|
|
47
39
|
picked: true
|
|
@@ -53,12 +45,7 @@ async function configureOpenerTrustedDomainsHandler(trustedDomains, domainToConf
|
|
|
53
45
|
const base = parsedDomainToConfigure.authority.split(':')[0];
|
|
54
46
|
options.push({
|
|
55
47
|
type: 'item',
|
|
56
|
-
label: ( localizeWithPath(
|
|
57
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
58
|
-
'trustedDomain.trustAllPorts',
|
|
59
|
-
'Trust {0} on all ports',
|
|
60
|
-
base
|
|
61
|
-
)),
|
|
48
|
+
label: ( localizeWithPath(_moduleId, 2, 'Trust {0} on all ports', base)),
|
|
62
49
|
toTrust: base + ':*',
|
|
63
50
|
id: 'trust'
|
|
64
51
|
});
|
|
@@ -67,33 +54,20 @@ async function configureOpenerTrustedDomainsHandler(trustedDomains, domainToConf
|
|
|
67
54
|
else {
|
|
68
55
|
options.push({
|
|
69
56
|
type: 'item',
|
|
70
|
-
label: ( localizeWithPath(
|
|
71
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
72
|
-
'trustedDomain.trustSubDomain',
|
|
73
|
-
'Trust {0} and all its subdomains',
|
|
74
|
-
domainEnd
|
|
75
|
-
)),
|
|
57
|
+
label: ( localizeWithPath(_moduleId, 3, 'Trust {0} and all its subdomains', domainEnd)),
|
|
76
58
|
toTrust: topLevelDomain,
|
|
77
59
|
id: 'trust'
|
|
78
60
|
});
|
|
79
61
|
}
|
|
80
62
|
options.push({
|
|
81
63
|
type: 'item',
|
|
82
|
-
label: ( localizeWithPath(
|
|
83
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
84
|
-
'trustedDomain.trustAllDomains',
|
|
85
|
-
'Trust all domains (disables link protection)'
|
|
86
|
-
)),
|
|
64
|
+
label: ( localizeWithPath(_moduleId, 4, 'Trust all domains (disables link protection)')),
|
|
87
65
|
toTrust: '*',
|
|
88
66
|
id: 'trust'
|
|
89
67
|
});
|
|
90
68
|
options.push({
|
|
91
69
|
type: 'item',
|
|
92
|
-
label: ( localizeWithPath(
|
|
93
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
94
|
-
'trustedDomain.manageTrustedDomains',
|
|
95
|
-
'Manage Trusted Domains'
|
|
96
|
-
)),
|
|
70
|
+
label: ( localizeWithPath(_moduleId, 5, 'Manage Trusted Domains')),
|
|
97
71
|
id: 'manage'
|
|
98
72
|
});
|
|
99
73
|
const pickedResult = await quickInputService.pick(options, { activeItem: options[0] });
|
|
@@ -101,7 +75,7 @@ async function configureOpenerTrustedDomainsHandler(trustedDomains, domainToConf
|
|
|
101
75
|
switch (pickedResult.id) {
|
|
102
76
|
case 'manage':
|
|
103
77
|
await editorService.openEditor({
|
|
104
|
-
resource: TRUSTED_DOMAINS_URI.with({ fragment: ( resource.toString()) }),
|
|
78
|
+
resource: TRUSTED_DOMAINS_URI.with({ fragment: ( (resource.toString())) }),
|
|
105
79
|
languageId: 'jsonc',
|
|
106
80
|
options: { pinned: true }
|
|
107
81
|
});
|
|
@@ -119,7 +93,7 @@ async function configureOpenerTrustedDomainsHandler(trustedDomains, domainToConf
|
|
|
119
93
|
return [];
|
|
120
94
|
}
|
|
121
95
|
function extractGitHubRemotesFromGitConfig(gitConfig) {
|
|
122
|
-
const domains = ( new Set());
|
|
96
|
+
const domains = ( (new Set()));
|
|
123
97
|
let match;
|
|
124
98
|
const RemoteMatcher = /^\s*url\s*=\s*(?:git@|https:\/\/)github\.com(?::|\/)(\S*)\s*$/mg;
|
|
125
99
|
while (match = RemoteMatcher.exec(gitConfig)) {
|
|
@@ -131,10 +105,10 @@ function extractGitHubRemotesFromGitConfig(gitConfig) {
|
|
|
131
105
|
return [...domains];
|
|
132
106
|
}
|
|
133
107
|
async function getRemotes(fileService, textFileService, contextService) {
|
|
134
|
-
const workspaceUris = ( contextService.getWorkspace().folders.map(folder => folder.uri));
|
|
108
|
+
const workspaceUris = ( (contextService.getWorkspace().folders.map(folder => folder.uri)));
|
|
135
109
|
const domains = await Promise.race([
|
|
136
|
-
( new Promise(resolve => setTimeout(() => resolve([]), 2000))),
|
|
137
|
-
Promise.all(( workspaceUris.map(async (workspaceUri) => {
|
|
110
|
+
( (new Promise(resolve => setTimeout(() => resolve([]), 2000)))),
|
|
111
|
+
Promise.all(( (workspaceUris.map(async (workspaceUri) => {
|
|
138
112
|
try {
|
|
139
113
|
const path = workspaceUri.path;
|
|
140
114
|
const uri = workspaceUri.with({ path: `${path !== '/' ? path : ''}/.git/config` });
|
|
@@ -148,9 +122,9 @@ async function getRemotes(fileService, textFileService, contextService) {
|
|
|
148
122
|
catch {
|
|
149
123
|
return [];
|
|
150
124
|
}
|
|
151
|
-
})))
|
|
125
|
+
}))))
|
|
152
126
|
]);
|
|
153
|
-
const set = domains.reduce((set, list) => list.reduce((set, item) => set.add(item), set), ( new Set()));
|
|
127
|
+
const set = domains.reduce((set, list) => list.reduce((set, item) => set.add(item), set), ( (new Set())));
|
|
154
128
|
return [...set];
|
|
155
129
|
}
|
|
156
130
|
async function readTrustedDomains(accessor) {
|
|
@@ -21,6 +21,7 @@ import { testUrlMatchesGlob } from 'vscode/vscode/vs/workbench/contrib/url/commo
|
|
|
21
21
|
import { IAuthenticationService } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
22
22
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
23
23
|
|
|
24
|
+
const _moduleId = "vs/workbench/contrib/url/browser/trustedDomainsValidator";
|
|
24
25
|
let OpenerValidatorContributions = class OpenerValidatorContributions {
|
|
25
26
|
constructor(_openerService, _storageService, _dialogService, _productService, _quickInputService, _editorService, _clipboardService, _telemetryService, _instantiationService, _authenticationService, _workspaceContextService, _configurationService, _workspaceTrustService) {
|
|
26
27
|
this._openerService = _openerService;
|
|
@@ -37,27 +38,27 @@ let OpenerValidatorContributions = class OpenerValidatorContributions {
|
|
|
37
38
|
this._configurationService = _configurationService;
|
|
38
39
|
this._workspaceTrustService = _workspaceTrustService;
|
|
39
40
|
this._openerService.registerValidator({ shouldOpen: (uri, options) => this.validateLink(uri, options) });
|
|
40
|
-
this._readAuthenticationTrustedDomainsResult = ( new WindowIdleValue(
|
|
41
|
+
this._readAuthenticationTrustedDomainsResult = ( (new WindowIdleValue(
|
|
41
42
|
mainWindow,
|
|
42
43
|
() => this._instantiationService.invokeFunction(readAuthenticationTrustedDomains)
|
|
43
|
-
));
|
|
44
|
+
)));
|
|
44
45
|
this._authenticationService.onDidRegisterAuthenticationProvider(() => {
|
|
45
46
|
this._readAuthenticationTrustedDomainsResult?.dispose();
|
|
46
|
-
this._readAuthenticationTrustedDomainsResult = ( new WindowIdleValue(
|
|
47
|
+
this._readAuthenticationTrustedDomainsResult = ( (new WindowIdleValue(
|
|
47
48
|
mainWindow,
|
|
48
49
|
() => this._instantiationService.invokeFunction(readAuthenticationTrustedDomains)
|
|
49
|
-
));
|
|
50
|
+
)));
|
|
50
51
|
});
|
|
51
|
-
this._readWorkspaceTrustedDomainsResult = ( new WindowIdleValue(
|
|
52
|
+
this._readWorkspaceTrustedDomainsResult = ( (new WindowIdleValue(
|
|
52
53
|
mainWindow,
|
|
53
54
|
() => this._instantiationService.invokeFunction(readWorkspaceTrustedDomains)
|
|
54
|
-
));
|
|
55
|
+
)));
|
|
55
56
|
this._workspaceContextService.onDidChangeWorkspaceFolders(() => {
|
|
56
57
|
this._readWorkspaceTrustedDomainsResult?.dispose();
|
|
57
|
-
this._readWorkspaceTrustedDomainsResult = ( new WindowIdleValue(
|
|
58
|
+
this._readWorkspaceTrustedDomainsResult = ( (new WindowIdleValue(
|
|
58
59
|
mainWindow,
|
|
59
60
|
() => this._instantiationService.invokeFunction(readWorkspaceTrustedDomains)
|
|
60
|
-
));
|
|
61
|
+
)));
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
async validateLink(resource, openOptions) {
|
|
@@ -70,7 +71,7 @@ let OpenerValidatorContributions = class OpenerValidatorContributions {
|
|
|
70
71
|
const originalResource = resource;
|
|
71
72
|
let resourceUri;
|
|
72
73
|
if (typeof resource === 'string') {
|
|
73
|
-
resourceUri = ( URI.parse(resource));
|
|
74
|
+
resourceUri = ( (URI.parse(resource)));
|
|
74
75
|
}
|
|
75
76
|
else {
|
|
76
77
|
resourceUri = resource;
|
|
@@ -97,38 +98,26 @@ let OpenerValidatorContributions = class OpenerValidatorContributions {
|
|
|
97
98
|
const { result } = await this._dialogService.prompt({
|
|
98
99
|
type: Severity$1.Info,
|
|
99
100
|
message: ( localizeWithPath(
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
_moduleId,
|
|
102
|
+
0,
|
|
102
103
|
'Do you want {0} to open the external website?',
|
|
103
104
|
this._productService.nameShort
|
|
104
105
|
)),
|
|
105
106
|
detail: typeof originalResource === 'string' ? originalResource : formattedLink,
|
|
106
107
|
buttons: [
|
|
107
108
|
{
|
|
108
|
-
label: ( localizeWithPath(
|
|
109
|
-
'vs/workbench/contrib/url/browser/trustedDomainsValidator',
|
|
110
|
-
{ key: 'open', comment: ['&& denotes a mnemonic'] },
|
|
111
|
-
'&&Open'
|
|
112
|
-
)),
|
|
109
|
+
label: ( localizeWithPath(_moduleId, 1, '&&Open')),
|
|
113
110
|
run: () => true
|
|
114
111
|
},
|
|
115
112
|
{
|
|
116
|
-
label: ( localizeWithPath(
|
|
117
|
-
'vs/workbench/contrib/url/browser/trustedDomainsValidator',
|
|
118
|
-
{ key: 'copy', comment: ['&& denotes a mnemonic'] },
|
|
119
|
-
'&&Copy'
|
|
120
|
-
)),
|
|
113
|
+
label: ( localizeWithPath(_moduleId, 2, '&&Copy')),
|
|
121
114
|
run: () => {
|
|
122
|
-
this._clipboardService.writeText(typeof originalResource === 'string' ? originalResource : ( resourceUri.toString(true)));
|
|
115
|
+
this._clipboardService.writeText(typeof originalResource === 'string' ? originalResource : ( (resourceUri.toString(true))));
|
|
123
116
|
return false;
|
|
124
117
|
}
|
|
125
118
|
},
|
|
126
119
|
{
|
|
127
|
-
label: ( localizeWithPath(
|
|
128
|
-
'vs/workbench/contrib/url/browser/trustedDomainsValidator',
|
|
129
|
-
{ key: 'configureTrustedDomains', comment: ['&& denotes a mnemonic'] },
|
|
130
|
-
'Configure &&Trusted Domains'
|
|
131
|
-
)),
|
|
120
|
+
label: ( localizeWithPath(_moduleId, 3, 'Configure &&Trusted Domains')),
|
|
132
121
|
run: async () => {
|
|
133
122
|
const pickedDomains = await configureOpenerTrustedDomainsHandler(trustedDomains, domainToOpen, resourceUri, this._quickInputService, this._storageService, this._editorService);
|
|
134
123
|
if (pickedDomains.indexOf('*') !== -1) {
|
|
@@ -149,21 +138,21 @@ let OpenerValidatorContributions = class OpenerValidatorContributions {
|
|
|
149
138
|
}
|
|
150
139
|
}
|
|
151
140
|
};
|
|
152
|
-
OpenerValidatorContributions = ( __decorate([
|
|
153
|
-
( __param(0, IOpenerService)),
|
|
154
|
-
( __param(1, IStorageService)),
|
|
155
|
-
( __param(2, IDialogService)),
|
|
156
|
-
( __param(3, IProductService)),
|
|
157
|
-
( __param(4, IQuickInputService)),
|
|
158
|
-
( __param(5, IEditorService)),
|
|
159
|
-
( __param(6, IClipboardService)),
|
|
160
|
-
( __param(7, ITelemetryService)),
|
|
161
|
-
( __param(8, IInstantiationService)),
|
|
162
|
-
( __param(9, IAuthenticationService)),
|
|
163
|
-
( __param(10, IWorkspaceContextService)),
|
|
164
|
-
( __param(11, IConfigurationService)),
|
|
165
|
-
( __param(12, IWorkspaceTrustManagementService))
|
|
166
|
-
], OpenerValidatorContributions));
|
|
141
|
+
OpenerValidatorContributions = ( (__decorate([
|
|
142
|
+
( (__param(0, IOpenerService))),
|
|
143
|
+
( (__param(1, IStorageService))),
|
|
144
|
+
( (__param(2, IDialogService))),
|
|
145
|
+
( (__param(3, IProductService))),
|
|
146
|
+
( (__param(4, IQuickInputService))),
|
|
147
|
+
( (__param(5, IEditorService))),
|
|
148
|
+
( (__param(6, IClipboardService))),
|
|
149
|
+
( (__param(7, ITelemetryService))),
|
|
150
|
+
( (__param(8, IInstantiationService))),
|
|
151
|
+
( (__param(9, IAuthenticationService))),
|
|
152
|
+
( (__param(10, IWorkspaceContextService))),
|
|
153
|
+
( (__param(11, IConfigurationService))),
|
|
154
|
+
( (__param(12, IWorkspaceTrustManagementService)))
|
|
155
|
+
], OpenerValidatorContributions)));
|
|
167
156
|
const rLocalhost = /^localhost(:\d+)?$/i;
|
|
168
157
|
const r127 = /^127.0.0.1(:\d+)?$/;
|
|
169
158
|
function isLocalhostAuthority(authority) {
|
|
@@ -172,21 +161,27 @@ function isLocalhostAuthority(authority) {
|
|
|
172
161
|
function normalizeURL(url) {
|
|
173
162
|
const caseInsensitiveAuthorities = ['github.com'];
|
|
174
163
|
try {
|
|
175
|
-
const parsed = typeof url === 'string' ? ( URI.parse(url, true)) : url;
|
|
164
|
+
const parsed = typeof url === 'string' ? ( (URI.parse(url, true))) : url;
|
|
176
165
|
if (caseInsensitiveAuthorities.includes(parsed.authority)) {
|
|
177
|
-
return (
|
|
166
|
+
return (
|
|
167
|
+
(parsed.with({ path: parsed.path.toLowerCase() }).toString(true))
|
|
168
|
+
);
|
|
178
169
|
}
|
|
179
170
|
else {
|
|
180
|
-
return (
|
|
171
|
+
return (
|
|
172
|
+
(parsed.toString(true))
|
|
173
|
+
);
|
|
181
174
|
}
|
|
182
175
|
}
|
|
183
176
|
catch {
|
|
184
|
-
return (
|
|
177
|
+
return (
|
|
178
|
+
(url.toString())
|
|
179
|
+
);
|
|
185
180
|
}
|
|
186
181
|
}
|
|
187
182
|
function isURLDomainTrusted(url, trustedDomains) {
|
|
188
|
-
url = ( URI.parse(normalizeURL(url)));
|
|
189
|
-
trustedDomains = ( trustedDomains.map(normalizeURL));
|
|
183
|
+
url = ( (URI.parse(normalizeURL(url))));
|
|
184
|
+
trustedDomains = ( (trustedDomains.map(normalizeURL)));
|
|
190
185
|
if (isLocalhostAuthority(url.authority)) {
|
|
191
186
|
return true;
|
|
192
187
|
}
|
|
@@ -14,11 +14,12 @@ import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommon
|
|
|
14
14
|
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
15
15
|
import { workbenchConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
|
|
16
16
|
|
|
17
|
+
const _moduleId = "vs/workbench/contrib/url/browser/url.contribution";
|
|
17
18
|
class OpenUrlAction extends Action2 {
|
|
18
19
|
constructor() {
|
|
19
20
|
super({
|
|
20
21
|
id: 'workbench.action.url.openUrl',
|
|
21
|
-
title: ( localize2WithPath(
|
|
22
|
+
title: ( localize2WithPath(_moduleId, 0, 'Open URL')),
|
|
22
23
|
category: Categories.Developer,
|
|
23
24
|
f1: true
|
|
24
25
|
});
|
|
@@ -26,13 +27,9 @@ class OpenUrlAction extends Action2 {
|
|
|
26
27
|
async run(accessor) {
|
|
27
28
|
const quickInputService = accessor.get(IQuickInputService);
|
|
28
29
|
const urlService = accessor.get(IURLService);
|
|
29
|
-
return quickInputService.input({ prompt: ( localizeWithPath(
|
|
30
|
-
'vs/workbench/contrib/url/browser/url.contribution',
|
|
31
|
-
'urlToOpen',
|
|
32
|
-
"URL to open"
|
|
33
|
-
)) }).then(input => {
|
|
30
|
+
return quickInputService.input({ prompt: ( localizeWithPath(_moduleId, 1, "URL to open")) }).then(input => {
|
|
34
31
|
if (input) {
|
|
35
|
-
const uri = ( URI.parse(input));
|
|
32
|
+
const uri = ( (URI.parse(input)));
|
|
36
33
|
urlService.open(uri, { originalUrl: input });
|
|
37
34
|
}
|
|
38
35
|
});
|
|
@@ -46,10 +43,10 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
|
46
43
|
title: manageTrustedDomainSettingsCommand.description.description
|
|
47
44
|
}
|
|
48
45
|
});
|
|
49
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(OpenerValidatorContributions, 3 );
|
|
46
|
+
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(OpenerValidatorContributions, 3 );
|
|
50
47
|
registerWorkbenchContribution2(TrustedDomainsFileSystemProvider.ID, TrustedDomainsFileSystemProvider, 2 );
|
|
51
48
|
registerWorkbenchContribution2(ExternalUriResolverContribution.ID, ExternalUriResolverContribution, 2 );
|
|
52
|
-
const configurationRegistry = ( Registry.as(Extensions$1.Configuration));
|
|
49
|
+
const configurationRegistry = ( (Registry.as(Extensions$1.Configuration)));
|
|
53
50
|
configurationRegistry.registerConfiguration({
|
|
54
51
|
...workbenchConfigurationNodeBase,
|
|
55
52
|
properties: {
|
|
@@ -58,8 +55,8 @@ configurationRegistry.registerConfiguration({
|
|
|
58
55
|
type: 'boolean',
|
|
59
56
|
default: false,
|
|
60
57
|
description: ( localizeWithPath(
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
_moduleId,
|
|
59
|
+
2,
|
|
63
60
|
"When enabled, trusted domain prompts will appear when opening links in trusted workspaces."
|
|
64
61
|
))
|
|
65
62
|
}
|