@codingame/monaco-vscode-quickaccess-service-override 4.0.0 → 4.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/package.json +2 -2
- package/quickaccess.js +6 -6
- package/override/vs/platform/dialogs/common/dialogs.js +0 -10
- package/vscode/src/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js +0 -25
- package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.js +0 -357
- package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.js +0 -67
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +0 -228
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +0 -88
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +0 -295
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +0 -168
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +0 -266
- package/vscode/src/vs/workbench/contrib/url/browser/externalUriResolver.js +0 -28
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +0 -200
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainsFileSystemProvider.js +0 -137
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainsValidator.js +0 -205
- package/vscode/src/vs/workbench/contrib/url/browser/url.contribution.js +0 -67
- package/vscode/src/vs/workbench/services/quickinput/browser/quickInputService.js +0 -39
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
|
-
import { Extensions } from 'vscode/vscode/vs/platform/quickinput/common/quickAccess';
|
|
3
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
|
-
import { HelpQuickAccessProvider } from '../../../../platform/quickinput/browser/helpQuickAccess.js';
|
|
5
|
-
import { ViewQuickAccessProvider, OpenViewPickerAction, QuickAccessViewPickerAction } from './viewQuickAccess.js';
|
|
6
|
-
import { CommandsQuickAccessProvider, ShowAllCommandsAction, ClearCommandHistoryAction } from './commandsQuickAccess.js';
|
|
7
|
-
import { MenuRegistry, MenuId, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
8
|
-
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
|
-
import { inQuickPickContext, getQuickNavigateHandler } from 'vscode/vscode/vs/workbench/browser/quickaccess';
|
|
10
|
-
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
11
|
-
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
12
|
-
|
|
13
|
-
const quickAccessRegistry = ( Registry.as(Extensions.Quickaccess));
|
|
14
|
-
quickAccessRegistry.registerQuickAccessProvider({
|
|
15
|
-
ctor: HelpQuickAccessProvider,
|
|
16
|
-
prefix: HelpQuickAccessProvider.PREFIX,
|
|
17
|
-
placeholder: ( localizeWithPath(
|
|
18
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
19
|
-
'helpQuickAccessPlaceholder',
|
|
20
|
-
"Type '{0}' to get help on the actions you can take from here.",
|
|
21
|
-
HelpQuickAccessProvider.PREFIX
|
|
22
|
-
)),
|
|
23
|
-
helpEntries: [{
|
|
24
|
-
description: ( localizeWithPath(
|
|
25
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
26
|
-
'helpQuickAccess',
|
|
27
|
-
"Show all Quick Access Providers"
|
|
28
|
-
)),
|
|
29
|
-
commandCenterOrder: 70,
|
|
30
|
-
commandCenterLabel: ( localizeWithPath(
|
|
31
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
32
|
-
'more',
|
|
33
|
-
'More'
|
|
34
|
-
))
|
|
35
|
-
}]
|
|
36
|
-
});
|
|
37
|
-
quickAccessRegistry.registerQuickAccessProvider({
|
|
38
|
-
ctor: ViewQuickAccessProvider,
|
|
39
|
-
prefix: ViewQuickAccessProvider.PREFIX,
|
|
40
|
-
contextKey: 'inViewsPicker',
|
|
41
|
-
placeholder: ( localizeWithPath(
|
|
42
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
43
|
-
'viewQuickAccessPlaceholder',
|
|
44
|
-
"Type the name of a view, output channel or terminal to open."
|
|
45
|
-
)),
|
|
46
|
-
helpEntries: [{ description: ( localizeWithPath(
|
|
47
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
48
|
-
'viewQuickAccess',
|
|
49
|
-
"Open View"
|
|
50
|
-
)), commandId: OpenViewPickerAction.ID }]
|
|
51
|
-
});
|
|
52
|
-
quickAccessRegistry.registerQuickAccessProvider({
|
|
53
|
-
ctor: CommandsQuickAccessProvider,
|
|
54
|
-
prefix: CommandsQuickAccessProvider.PREFIX,
|
|
55
|
-
contextKey: 'inCommandsPicker',
|
|
56
|
-
placeholder: ( localizeWithPath(
|
|
57
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
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 }]
|
|
66
|
-
});
|
|
67
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
68
|
-
group: '1_open',
|
|
69
|
-
command: {
|
|
70
|
-
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
|
-
))
|
|
76
|
-
},
|
|
77
|
-
order: 1
|
|
78
|
-
});
|
|
79
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
|
|
80
|
-
group: '1_welcome',
|
|
81
|
-
command: {
|
|
82
|
-
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
|
-
))
|
|
88
|
-
},
|
|
89
|
-
order: 2
|
|
90
|
-
});
|
|
91
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
92
|
-
group: '1_open',
|
|
93
|
-
command: {
|
|
94
|
-
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
|
-
))
|
|
100
|
-
},
|
|
101
|
-
order: 2
|
|
102
|
-
});
|
|
103
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
104
|
-
group: '5_infile_nav',
|
|
105
|
-
command: {
|
|
106
|
-
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
|
-
))
|
|
112
|
-
},
|
|
113
|
-
order: 1
|
|
114
|
-
});
|
|
115
|
-
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
116
|
-
group: '1_command',
|
|
117
|
-
command: {
|
|
118
|
-
id: ShowAllCommandsAction.ID,
|
|
119
|
-
title: ( localizeWithPath(
|
|
120
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
121
|
-
'commandPalette',
|
|
122
|
-
"Command Palette..."
|
|
123
|
-
))
|
|
124
|
-
},
|
|
125
|
-
order: 1
|
|
126
|
-
});
|
|
127
|
-
MenuRegistry.appendMenuItem(MenuId.EditorContext, {
|
|
128
|
-
group: 'z_commands',
|
|
129
|
-
when: ( EditorContextKeys.editorSimpleInput.toNegated()),
|
|
130
|
-
command: {
|
|
131
|
-
id: ShowAllCommandsAction.ID,
|
|
132
|
-
title: ( localizeWithPath(
|
|
133
|
-
'vs/workbench/contrib/quickaccess/browser/quickAccess.contribution',
|
|
134
|
-
'commandPalette',
|
|
135
|
-
"Command Palette..."
|
|
136
|
-
)),
|
|
137
|
-
},
|
|
138
|
-
order: 1
|
|
139
|
-
});
|
|
140
|
-
registerAction2(ClearCommandHistoryAction);
|
|
141
|
-
registerAction2(ShowAllCommandsAction);
|
|
142
|
-
registerAction2(OpenViewPickerAction);
|
|
143
|
-
registerAction2(QuickAccessViewPickerAction);
|
|
144
|
-
const inViewsPickerContextKey = 'inViewsPicker';
|
|
145
|
-
const inViewsPickerContext = ( ContextKeyExpr.and(inQuickPickContext, ( ContextKeyExpr.has(inViewsPickerContextKey))));
|
|
146
|
-
const viewPickerKeybinding = QuickAccessViewPickerAction.KEYBINDING;
|
|
147
|
-
const quickAccessNavigateNextInViewPickerId = 'workbench.action.quickOpenNavigateNextInViewPicker';
|
|
148
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
149
|
-
id: quickAccessNavigateNextInViewPickerId,
|
|
150
|
-
weight: 200 + 50,
|
|
151
|
-
handler: getQuickNavigateHandler(quickAccessNavigateNextInViewPickerId, true),
|
|
152
|
-
when: inViewsPickerContext,
|
|
153
|
-
primary: viewPickerKeybinding.primary,
|
|
154
|
-
linux: viewPickerKeybinding.linux,
|
|
155
|
-
mac: viewPickerKeybinding.mac
|
|
156
|
-
});
|
|
157
|
-
const quickAccessNavigatePreviousInViewPickerId = 'workbench.action.quickOpenNavigatePreviousInViewPicker';
|
|
158
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
159
|
-
id: quickAccessNavigatePreviousInViewPickerId,
|
|
160
|
-
weight: 200 + 50,
|
|
161
|
-
handler: getQuickNavigateHandler(quickAccessNavigatePreviousInViewPickerId, false),
|
|
162
|
-
when: inViewsPickerContext,
|
|
163
|
-
primary: viewPickerKeybinding.primary | 1024 ,
|
|
164
|
-
linux: viewPickerKeybinding.linux,
|
|
165
|
-
mac: {
|
|
166
|
-
primary: viewPickerKeybinding.mac.primary | 1024
|
|
167
|
-
}
|
|
168
|
-
});
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { IQuickInputService, ItemActivation } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
|
|
4
|
-
import { PickerQuickAccessProvider } from 'vscode/vscode/vs/platform/quickinput/browser/pickerQuickAccess';
|
|
5
|
-
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
6
|
-
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
7
|
-
import { IOutputService } from 'vscode/vscode/vs/workbench/services/output/common/output';
|
|
8
|
-
import { ITerminalService, ITerminalGroupService } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminal';
|
|
9
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
10
|
-
import { matchesFuzzy } from 'vscode/vscode/vs/base/common/filters';
|
|
11
|
-
import { fuzzyContains } from 'vscode/vscode/vs/base/common/strings';
|
|
12
|
-
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
13
|
-
import { Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
14
|
-
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
15
|
-
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite';
|
|
16
|
-
import { REPL_VIEW_ID, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
17
|
-
|
|
18
|
-
var ViewQuickAccessProvider_1;
|
|
19
|
-
let ViewQuickAccessProvider = class ViewQuickAccessProvider extends PickerQuickAccessProvider {
|
|
20
|
-
static { ViewQuickAccessProvider_1 = this; }
|
|
21
|
-
static { this.PREFIX = 'view '; }
|
|
22
|
-
constructor(viewDescriptorService, viewsService, outputService, terminalService, terminalGroupService, debugService, paneCompositeService, contextKeyService) {
|
|
23
|
-
super(ViewQuickAccessProvider_1.PREFIX, {
|
|
24
|
-
noResultsPick: {
|
|
25
|
-
label: ( localizeWithPath(
|
|
26
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
27
|
-
'noViewResults',
|
|
28
|
-
"No matching views"
|
|
29
|
-
)),
|
|
30
|
-
containerLabel: ''
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
this.viewDescriptorService = viewDescriptorService;
|
|
34
|
-
this.viewsService = viewsService;
|
|
35
|
-
this.outputService = outputService;
|
|
36
|
-
this.terminalService = terminalService;
|
|
37
|
-
this.terminalGroupService = terminalGroupService;
|
|
38
|
-
this.debugService = debugService;
|
|
39
|
-
this.paneCompositeService = paneCompositeService;
|
|
40
|
-
this.contextKeyService = contextKeyService;
|
|
41
|
-
}
|
|
42
|
-
_getPicks(filter) {
|
|
43
|
-
const filteredViewEntries = this.doGetViewPickItems().filter(entry => {
|
|
44
|
-
if (!filter) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
entry.highlights = { label: matchesFuzzy(filter, entry.label, true) ?? undefined };
|
|
48
|
-
return entry.highlights.label || fuzzyContains(entry.containerLabel, filter);
|
|
49
|
-
});
|
|
50
|
-
const mapEntryToContainer = ( new Map());
|
|
51
|
-
for (const entry of filteredViewEntries) {
|
|
52
|
-
if (!( mapEntryToContainer.has(entry.label))) {
|
|
53
|
-
mapEntryToContainer.set(entry.label, entry.containerLabel);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const filteredViewEntriesWithSeparators = [];
|
|
57
|
-
let lastContainer = undefined;
|
|
58
|
-
for (const entry of filteredViewEntries) {
|
|
59
|
-
if (lastContainer !== entry.containerLabel) {
|
|
60
|
-
lastContainer = entry.containerLabel;
|
|
61
|
-
let separatorLabel;
|
|
62
|
-
if (( mapEntryToContainer.has(lastContainer))) {
|
|
63
|
-
separatorLabel = `${mapEntryToContainer.get(lastContainer)} / ${lastContainer}`;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
separatorLabel = lastContainer;
|
|
67
|
-
}
|
|
68
|
-
filteredViewEntriesWithSeparators.push({ type: 'separator', label: separatorLabel });
|
|
69
|
-
}
|
|
70
|
-
filteredViewEntriesWithSeparators.push(entry);
|
|
71
|
-
}
|
|
72
|
-
return filteredViewEntriesWithSeparators;
|
|
73
|
-
}
|
|
74
|
-
doGetViewPickItems() {
|
|
75
|
-
const viewEntries = [];
|
|
76
|
-
const getViewEntriesForPaneComposite = (paneComposite, viewContainer) => {
|
|
77
|
-
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer);
|
|
78
|
-
const result = [];
|
|
79
|
-
for (const view of viewContainerModel.allViewDescriptors) {
|
|
80
|
-
if (this.contextKeyService.contextMatchesRules(view.when)) {
|
|
81
|
-
result.push({
|
|
82
|
-
label: view.name.value,
|
|
83
|
-
containerLabel: viewContainerModel.title,
|
|
84
|
-
accept: () => this.viewsService.openView(view.id, true)
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return result;
|
|
89
|
-
};
|
|
90
|
-
const addPaneComposites = (location, containerLabel) => {
|
|
91
|
-
const paneComposites = this.paneCompositeService.getPaneComposites(location);
|
|
92
|
-
const visiblePaneCompositeIds = this.paneCompositeService.getVisiblePaneCompositeIds(location);
|
|
93
|
-
paneComposites.sort((a, b) => {
|
|
94
|
-
let aIndex = visiblePaneCompositeIds.findIndex(id => a.id === id);
|
|
95
|
-
let bIndex = visiblePaneCompositeIds.findIndex(id => b.id === id);
|
|
96
|
-
if (aIndex < 0) {
|
|
97
|
-
aIndex = paneComposites.indexOf(a) + visiblePaneCompositeIds.length;
|
|
98
|
-
}
|
|
99
|
-
if (bIndex < 0) {
|
|
100
|
-
bIndex = paneComposites.indexOf(b) + visiblePaneCompositeIds.length;
|
|
101
|
-
}
|
|
102
|
-
return aIndex - bIndex;
|
|
103
|
-
});
|
|
104
|
-
for (const paneComposite of paneComposites) {
|
|
105
|
-
if (this.includeViewContainer(paneComposite)) {
|
|
106
|
-
const viewContainer = this.viewDescriptorService.getViewContainerById(paneComposite.id);
|
|
107
|
-
if (viewContainer) {
|
|
108
|
-
viewEntries.push({
|
|
109
|
-
label: this.viewDescriptorService.getViewContainerModel(viewContainer).title,
|
|
110
|
-
containerLabel,
|
|
111
|
-
accept: () => this.paneCompositeService.openPaneComposite(paneComposite.id, location, true)
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
addPaneComposites(0 , ( localizeWithPath(
|
|
118
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
119
|
-
'views',
|
|
120
|
-
"Side Bar"
|
|
121
|
-
)));
|
|
122
|
-
addPaneComposites(1 , ( localizeWithPath(
|
|
123
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
124
|
-
'panels',
|
|
125
|
-
"Panel"
|
|
126
|
-
)));
|
|
127
|
-
addPaneComposites(2 , ( localizeWithPath(
|
|
128
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
129
|
-
'secondary side bar',
|
|
130
|
-
"Secondary Side Bar"
|
|
131
|
-
)));
|
|
132
|
-
const addPaneCompositeViews = (location) => {
|
|
133
|
-
const paneComposites = this.paneCompositeService.getPaneComposites(location);
|
|
134
|
-
for (const paneComposite of paneComposites) {
|
|
135
|
-
const viewContainer = this.viewDescriptorService.getViewContainerById(paneComposite.id);
|
|
136
|
-
if (viewContainer) {
|
|
137
|
-
viewEntries.push(...getViewEntriesForPaneComposite(paneComposite, viewContainer));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
addPaneCompositeViews(0 );
|
|
142
|
-
addPaneCompositeViews(1 );
|
|
143
|
-
addPaneCompositeViews(2 );
|
|
144
|
-
this.terminalGroupService.groups.forEach((group, groupIndex) => {
|
|
145
|
-
group.terminalInstances.forEach((terminal, terminalIndex) => {
|
|
146
|
-
const label = ( localizeWithPath(
|
|
147
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
148
|
-
'terminalTitle',
|
|
149
|
-
"{0}: {1}",
|
|
150
|
-
`${groupIndex + 1}.${terminalIndex + 1}`,
|
|
151
|
-
terminal.title
|
|
152
|
-
));
|
|
153
|
-
viewEntries.push({
|
|
154
|
-
label,
|
|
155
|
-
containerLabel: ( localizeWithPath(
|
|
156
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
157
|
-
'terminals',
|
|
158
|
-
"Terminal"
|
|
159
|
-
)),
|
|
160
|
-
accept: async () => {
|
|
161
|
-
await this.terminalGroupService.showPanel(true);
|
|
162
|
-
this.terminalService.setActiveInstance(terminal);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
this.debugService.getModel().getSessions(true).filter(s => s.hasSeparateRepl()).forEach((session, _) => {
|
|
168
|
-
const label = session.name;
|
|
169
|
-
viewEntries.push({
|
|
170
|
-
label,
|
|
171
|
-
containerLabel: ( localizeWithPath(
|
|
172
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
173
|
-
'debugConsoles',
|
|
174
|
-
"Debug Console"
|
|
175
|
-
)),
|
|
176
|
-
accept: async () => {
|
|
177
|
-
await this.debugService.focusStackFrame(undefined, undefined, session, { explicit: true });
|
|
178
|
-
if (!this.viewsService.isViewVisible(REPL_VIEW_ID)) {
|
|
179
|
-
await this.viewsService.openView(REPL_VIEW_ID, true);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
const channels = this.outputService.getChannelDescriptors();
|
|
185
|
-
for (const channel of channels) {
|
|
186
|
-
viewEntries.push({
|
|
187
|
-
label: channel.label,
|
|
188
|
-
containerLabel: ( localizeWithPath(
|
|
189
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
190
|
-
'channels',
|
|
191
|
-
"Output"
|
|
192
|
-
)),
|
|
193
|
-
accept: () => this.outputService.showChannel(channel.id)
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
return viewEntries;
|
|
197
|
-
}
|
|
198
|
-
includeViewContainer(container) {
|
|
199
|
-
const viewContainer = this.viewDescriptorService.getViewContainerById(container.id);
|
|
200
|
-
if (viewContainer?.hideIfEmpty) {
|
|
201
|
-
return this.viewDescriptorService.getViewContainerModel(viewContainer).activeViewDescriptors.length > 0;
|
|
202
|
-
}
|
|
203
|
-
return true;
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
ViewQuickAccessProvider = ViewQuickAccessProvider_1 = ( __decorate([
|
|
207
|
-
( __param(0, IViewDescriptorService)),
|
|
208
|
-
( __param(1, IViewsService)),
|
|
209
|
-
( __param(2, IOutputService)),
|
|
210
|
-
( __param(3, ITerminalService)),
|
|
211
|
-
( __param(4, ITerminalGroupService)),
|
|
212
|
-
( __param(5, IDebugService)),
|
|
213
|
-
( __param(6, IPaneCompositePartService)),
|
|
214
|
-
( __param(7, IContextKeyService))
|
|
215
|
-
], ViewQuickAccessProvider));
|
|
216
|
-
class OpenViewPickerAction extends Action2 {
|
|
217
|
-
static { this.ID = 'workbench.action.openView'; }
|
|
218
|
-
constructor() {
|
|
219
|
-
super({
|
|
220
|
-
id: OpenViewPickerAction.ID,
|
|
221
|
-
title: ( localize2WithPath(
|
|
222
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
223
|
-
'openView',
|
|
224
|
-
'Open View'
|
|
225
|
-
)),
|
|
226
|
-
category: Categories.View,
|
|
227
|
-
f1: true
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
async run(accessor) {
|
|
231
|
-
accessor.get(IQuickInputService).quickAccess.show(ViewQuickAccessProvider.PREFIX);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
class QuickAccessViewPickerAction extends Action2 {
|
|
235
|
-
static { this.ID = 'workbench.action.quickOpenView'; }
|
|
236
|
-
static { this.KEYBINDING = {
|
|
237
|
-
primary: 2048 | 47 ,
|
|
238
|
-
mac: { primary: 256 | 47 },
|
|
239
|
-
linux: { primary: 0 }
|
|
240
|
-
}; }
|
|
241
|
-
constructor() {
|
|
242
|
-
super({
|
|
243
|
-
id: QuickAccessViewPickerAction.ID,
|
|
244
|
-
title: ( localize2WithPath(
|
|
245
|
-
'vs/workbench/contrib/quickaccess/browser/viewQuickAccess',
|
|
246
|
-
'quickOpenView',
|
|
247
|
-
'Quick Open View'
|
|
248
|
-
)),
|
|
249
|
-
category: Categories.View,
|
|
250
|
-
f1: false,
|
|
251
|
-
keybinding: {
|
|
252
|
-
weight: 200 ,
|
|
253
|
-
when: undefined,
|
|
254
|
-
...QuickAccessViewPickerAction.KEYBINDING
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
async run(accessor) {
|
|
259
|
-
const keybindingService = accessor.get(IKeybindingService);
|
|
260
|
-
const quickInputService = accessor.get(IQuickInputService);
|
|
261
|
-
const keys = keybindingService.lookupKeybindings(QuickAccessViewPickerAction.ID);
|
|
262
|
-
quickInputService.quickAccess.show(ViewQuickAccessProvider.PREFIX, { quickNavigateConfiguration: { keybindings: keys }, itemActivation: ItemActivation.FIRST });
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export { OpenViewPickerAction, QuickAccessViewPickerAction, ViewQuickAccessProvider };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
4
|
-
import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService';
|
|
5
|
-
|
|
6
|
-
let ExternalUriResolverContribution = class ExternalUriResolverContribution extends Disposable {
|
|
7
|
-
static { this.ID = 'workbench.contrib.externalUriResolver'; }
|
|
8
|
-
constructor(_openerService, _workbenchEnvironmentService) {
|
|
9
|
-
super();
|
|
10
|
-
if (_workbenchEnvironmentService.options?.resolveExternalUri) {
|
|
11
|
-
this._register(_openerService.registerExternalUriResolver({
|
|
12
|
-
resolveExternalUri: async (resource) => {
|
|
13
|
-
return {
|
|
14
|
-
resolved: await _workbenchEnvironmentService.options.resolveExternalUri(resource),
|
|
15
|
-
dispose: () => {
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
ExternalUriResolverContribution = ( __decorate([
|
|
24
|
-
( __param(0, IOpenerService)),
|
|
25
|
-
( __param(1, IBrowserWorkbenchEnvironmentService))
|
|
26
|
-
], ExternalUriResolverContribution));
|
|
27
|
-
|
|
28
|
-
export { ExternalUriResolverContribution };
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
2
|
-
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
|
|
4
|
-
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
5
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
6
|
-
import { IAuthenticationService } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication';
|
|
7
|
-
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
8
|
-
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles';
|
|
9
|
-
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
10
|
-
import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService';
|
|
11
|
-
|
|
12
|
-
const TRUSTED_DOMAINS_URI = ( URI.parse('trustedDomains:/Trusted Domains'));
|
|
13
|
-
const TRUSTED_DOMAINS_STORAGE_KEY = 'http.linkProtectionTrustedDomains';
|
|
14
|
-
const TRUSTED_DOMAINS_CONTENT_STORAGE_KEY = 'http.linkProtectionTrustedDomainsContent';
|
|
15
|
-
const manageTrustedDomainSettingsCommand = {
|
|
16
|
-
id: 'workbench.action.manageTrustedDomain',
|
|
17
|
-
description: {
|
|
18
|
-
description: ( localize2WithPath(
|
|
19
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
20
|
-
'trustedDomain.manageTrustedDomain',
|
|
21
|
-
'Manage Trusted Domains'
|
|
22
|
-
)),
|
|
23
|
-
args: []
|
|
24
|
-
},
|
|
25
|
-
handler: async (accessor) => {
|
|
26
|
-
const editorService = accessor.get(IEditorService);
|
|
27
|
-
editorService.openEditor({ resource: TRUSTED_DOMAINS_URI, languageId: 'jsonc', options: { pinned: true } });
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
async function configureOpenerTrustedDomainsHandler(trustedDomains, domainToConfigure, resource, quickInputService, storageService, editorService, telemetryService) {
|
|
32
|
-
const parsedDomainToConfigure = ( URI.parse(domainToConfigure));
|
|
33
|
-
const toplevelDomainSegements = parsedDomainToConfigure.authority.split('.');
|
|
34
|
-
const domainEnd = toplevelDomainSegements.slice(toplevelDomainSegements.length - 2).join('.');
|
|
35
|
-
const topLevelDomain = '*.' + domainEnd;
|
|
36
|
-
const options = [];
|
|
37
|
-
options.push({
|
|
38
|
-
type: 'item',
|
|
39
|
-
label: ( localizeWithPath(
|
|
40
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
41
|
-
'trustedDomain.trustDomain',
|
|
42
|
-
'Trust {0}',
|
|
43
|
-
domainToConfigure
|
|
44
|
-
)),
|
|
45
|
-
id: 'trust',
|
|
46
|
-
toTrust: domainToConfigure,
|
|
47
|
-
picked: true
|
|
48
|
-
});
|
|
49
|
-
const isIP = toplevelDomainSegements.length === 4 &&
|
|
50
|
-
toplevelDomainSegements.every(segment => Number.isInteger(+segment) || Number.isInteger(+segment.split(':')[0]));
|
|
51
|
-
if (isIP) {
|
|
52
|
-
if (parsedDomainToConfigure.authority.includes(':')) {
|
|
53
|
-
const base = parsedDomainToConfigure.authority.split(':')[0];
|
|
54
|
-
options.push({
|
|
55
|
-
type: 'item',
|
|
56
|
-
label: ( localizeWithPath(
|
|
57
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
58
|
-
'trustedDomain.trustAllPorts',
|
|
59
|
-
'Trust {0} on all ports',
|
|
60
|
-
base
|
|
61
|
-
)),
|
|
62
|
-
toTrust: base + ':*',
|
|
63
|
-
id: 'trust'
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
options.push({
|
|
69
|
-
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
|
-
)),
|
|
76
|
-
toTrust: topLevelDomain,
|
|
77
|
-
id: 'trust'
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
options.push({
|
|
81
|
-
type: 'item',
|
|
82
|
-
label: ( localizeWithPath(
|
|
83
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
84
|
-
'trustedDomain.trustAllDomains',
|
|
85
|
-
'Trust all domains (disables link protection)'
|
|
86
|
-
)),
|
|
87
|
-
toTrust: '*',
|
|
88
|
-
id: 'trust'
|
|
89
|
-
});
|
|
90
|
-
options.push({
|
|
91
|
-
type: 'item',
|
|
92
|
-
label: ( localizeWithPath(
|
|
93
|
-
'vs/workbench/contrib/url/browser/trustedDomains',
|
|
94
|
-
'trustedDomain.manageTrustedDomains',
|
|
95
|
-
'Manage Trusted Domains'
|
|
96
|
-
)),
|
|
97
|
-
id: 'manage'
|
|
98
|
-
});
|
|
99
|
-
const pickedResult = await quickInputService.pick(options, { activeItem: options[0] });
|
|
100
|
-
if (pickedResult && pickedResult.id) {
|
|
101
|
-
switch (pickedResult.id) {
|
|
102
|
-
case 'manage':
|
|
103
|
-
await editorService.openEditor({
|
|
104
|
-
resource: TRUSTED_DOMAINS_URI.with({ fragment: ( resource.toString()) }),
|
|
105
|
-
languageId: 'jsonc',
|
|
106
|
-
options: { pinned: true }
|
|
107
|
-
});
|
|
108
|
-
return trustedDomains;
|
|
109
|
-
case 'trust': {
|
|
110
|
-
const itemToTrust = pickedResult.toTrust;
|
|
111
|
-
if (trustedDomains.indexOf(itemToTrust) === -1) {
|
|
112
|
-
storageService.remove(TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, -1 );
|
|
113
|
-
storageService.store(TRUSTED_DOMAINS_STORAGE_KEY, JSON.stringify([...trustedDomains, itemToTrust]), -1 , 0 );
|
|
114
|
-
return [...trustedDomains, itemToTrust];
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return [];
|
|
120
|
-
}
|
|
121
|
-
function extractGitHubRemotesFromGitConfig(gitConfig) {
|
|
122
|
-
const domains = ( new Set());
|
|
123
|
-
let match;
|
|
124
|
-
const RemoteMatcher = /^\s*url\s*=\s*(?:git@|https:\/\/)github\.com(?::|\/)(\S*)\s*$/mg;
|
|
125
|
-
while (match = RemoteMatcher.exec(gitConfig)) {
|
|
126
|
-
const repo = match[1].replace(/\.git$/, '');
|
|
127
|
-
if (repo) {
|
|
128
|
-
domains.add(`https://github.com/${repo}/`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return [...domains];
|
|
132
|
-
}
|
|
133
|
-
async function getRemotes(fileService, textFileService, contextService) {
|
|
134
|
-
const workspaceUris = ( contextService.getWorkspace().folders.map(folder => folder.uri));
|
|
135
|
-
const domains = await Promise.race([
|
|
136
|
-
( new Promise(resolve => setTimeout(() => resolve([]), 2000))),
|
|
137
|
-
Promise.all(( workspaceUris.map(async (workspaceUri) => {
|
|
138
|
-
try {
|
|
139
|
-
const path = workspaceUri.path;
|
|
140
|
-
const uri = workspaceUri.with({ path: `${path !== '/' ? path : ''}/.git/config` });
|
|
141
|
-
const exists = await fileService.exists(uri);
|
|
142
|
-
if (!exists) {
|
|
143
|
-
return [];
|
|
144
|
-
}
|
|
145
|
-
const gitConfig = (await (textFileService.read(uri, { acceptTextOnly: true }).catch(() => ({ value: '' })))).value;
|
|
146
|
-
return extractGitHubRemotesFromGitConfig(gitConfig);
|
|
147
|
-
}
|
|
148
|
-
catch {
|
|
149
|
-
return [];
|
|
150
|
-
}
|
|
151
|
-
})))
|
|
152
|
-
]);
|
|
153
|
-
const set = domains.reduce((set, list) => list.reduce((set, item) => set.add(item), set), ( new Set()));
|
|
154
|
-
return [...set];
|
|
155
|
-
}
|
|
156
|
-
async function readTrustedDomains(accessor) {
|
|
157
|
-
const { defaultTrustedDomains, trustedDomains } = readStaticTrustedDomains(accessor);
|
|
158
|
-
const [workspaceDomains, userDomains] = await Promise.all([readWorkspaceTrustedDomains(accessor), readAuthenticationTrustedDomains(accessor)]);
|
|
159
|
-
return {
|
|
160
|
-
workspaceDomains,
|
|
161
|
-
userDomains,
|
|
162
|
-
defaultTrustedDomains,
|
|
163
|
-
trustedDomains,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
async function readWorkspaceTrustedDomains(accessor) {
|
|
167
|
-
const fileService = accessor.get(IFileService);
|
|
168
|
-
const textFileService = accessor.get(ITextFileService);
|
|
169
|
-
const workspaceContextService = accessor.get(IWorkspaceContextService);
|
|
170
|
-
return getRemotes(fileService, textFileService, workspaceContextService);
|
|
171
|
-
}
|
|
172
|
-
async function readAuthenticationTrustedDomains(accessor) {
|
|
173
|
-
const authenticationService = accessor.get(IAuthenticationService);
|
|
174
|
-
return authenticationService.isAuthenticationProviderRegistered('github') && ((await authenticationService.getSessions('github')) ?? []).length > 0
|
|
175
|
-
? [`https://github.com`]
|
|
176
|
-
: [];
|
|
177
|
-
}
|
|
178
|
-
function readStaticTrustedDomains(accessor) {
|
|
179
|
-
const storageService = accessor.get(IStorageService);
|
|
180
|
-
const productService = accessor.get(IProductService);
|
|
181
|
-
const environmentService = accessor.get(IBrowserWorkbenchEnvironmentService);
|
|
182
|
-
const defaultTrustedDomains = [
|
|
183
|
-
...(productService.linkProtectionTrustedDomains ?? []),
|
|
184
|
-
...(environmentService.options?.additionalTrustedDomains ?? [])
|
|
185
|
-
];
|
|
186
|
-
let trustedDomains = [];
|
|
187
|
-
try {
|
|
188
|
-
const trustedDomainsSrc = storageService.get(TRUSTED_DOMAINS_STORAGE_KEY, -1 );
|
|
189
|
-
if (trustedDomainsSrc) {
|
|
190
|
-
trustedDomains = JSON.parse(trustedDomainsSrc);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
catch (err) { }
|
|
194
|
-
return {
|
|
195
|
-
defaultTrustedDomains,
|
|
196
|
-
trustedDomains,
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export { TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, TRUSTED_DOMAINS_STORAGE_KEY, configureOpenerTrustedDomainsHandler, extractGitHubRemotesFromGitConfig, manageTrustedDomainSettingsCommand, readAuthenticationTrustedDomains, readStaticTrustedDomains, readTrustedDomains, readWorkspaceTrustedDomains };
|