@codingame/monaco-vscode-view-common-service-override 31.0.0 → 32.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -0
- package/package.json +3 -3
- package/service-override/vs/workbench/contrib/webview/browser/pre/service-worker.js +107 -88
- package/vscode/src/vs/sessions/common/theme.d.ts +21 -0
- package/vscode/src/vs/sessions/common/theme.js +126 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +56 -56
- package/vscode/src/vs/workbench/browser/actions/helpActions.js +20 -20
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +3 -3
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +173 -168
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +31 -10
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubar.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubar.contribution.js +78 -0
- package/vscode/src/vs/workbench/browser/workbench.zenMode.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/workbench.zenMode.contribution.js +140 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +12 -12
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +3 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +3 -3
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +8 -2
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +84 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +184 -19
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +9 -5
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +9 -2
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.d.ts +27 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +44 -12
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.js +7 -7
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +29 -29
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +14 -14
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +13 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +10 -10
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +12 -12
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/scrollLocking/browser/scrollLocking.js +7 -7
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +3 -3
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +3 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +16 -8
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.d.ts +9 -5
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +22 -5
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.d.ts +4 -7
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +133 -32
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +5 -5
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +5 -27
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.d.ts +15 -7
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +129 -55
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +9 -9
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +7 -7
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +1 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.d.ts +3 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +31 -33
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { VIEWS_LOG_ID, VIEWS_LOG_NAME, Extensions, ViewContainerLocation,
|
|
3
|
+
import { VIEWS_LOG_ID, VIEWS_LOG_NAME, Extensions, ViewContainerLocation, WindowEnablement, ViewVisibilityState, defaultViewIcon, ViewContainerLocationToString } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
4
4
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
5
|
import { ContextKeyExpr, RawContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
6
6
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
@@ -39,7 +39,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
39
39
|
this.COMMON_CONTAINER_ID_PREFIX = "workbench.views.service";
|
|
40
40
|
}
|
|
41
41
|
get viewContainers() {
|
|
42
|
-
return this.viewContainersRegistry.all;
|
|
42
|
+
return this.viewContainersRegistry.all.filter(vc => this.isViewContainerEnabled(vc));
|
|
43
43
|
}
|
|
44
44
|
constructor(
|
|
45
45
|
instantiationService,
|
|
@@ -104,6 +104,9 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
104
104
|
viewContainer
|
|
105
105
|
}
|
|
106
106
|
) => {
|
|
107
|
+
if (!this.isViewContainerEnabled(viewContainer)) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
107
110
|
this.onDidRegisterViewContainer(viewContainer);
|
|
108
111
|
this._onDidChangeViewContainers.fire({
|
|
109
112
|
added: [{
|
|
@@ -119,6 +122,9 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
119
122
|
viewContainerLocation
|
|
120
123
|
}
|
|
121
124
|
) => {
|
|
125
|
+
if (!this.isViewContainerEnabled(viewContainer)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
122
128
|
this.onDidDeregisterViewContainer(viewContainer);
|
|
123
129
|
this._onDidChangeViewContainers.fire({
|
|
124
130
|
removed: [{
|
|
@@ -173,7 +179,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
173
179
|
}
|
|
174
180
|
registerGroupedViews(groupedViews) {
|
|
175
181
|
for (const [containerId, views] of groupedViews.entries()) {
|
|
176
|
-
const viewContainer = this.
|
|
182
|
+
const viewContainer = this.getViewContainerById(containerId);
|
|
177
183
|
if (!viewContainer || !( this.viewContainerModels.has(viewContainer))) {
|
|
178
184
|
if (this.isGeneratedContainerId(containerId)) {
|
|
179
185
|
const viewContainerLocation = this.viewContainersCustomLocations.get(containerId);
|
|
@@ -191,7 +197,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
191
197
|
}
|
|
192
198
|
deregisterGroupedViews(groupedViews) {
|
|
193
199
|
for (const [viewContainerId, views] of groupedViews.entries()) {
|
|
194
|
-
const viewContainer = this.
|
|
200
|
+
const viewContainer = this.getViewContainerById(viewContainerId);
|
|
195
201
|
if (!viewContainer || !( this.viewContainerModels.has(viewContainer))) {
|
|
196
202
|
continue;
|
|
197
203
|
}
|
|
@@ -200,7 +206,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
200
206
|
}
|
|
201
207
|
moveOrphanViewsToDefaultLocation() {
|
|
202
208
|
for (const [viewId, containerId] of this.viewDescriptorsCustomLocations.entries()) {
|
|
203
|
-
if (this.
|
|
209
|
+
if (this.getViewContainerById(containerId)) {
|
|
204
210
|
continue;
|
|
205
211
|
}
|
|
206
212
|
const viewContainer = this.viewsRegistry.getViewContainer(viewId);
|
|
@@ -263,7 +269,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
263
269
|
}
|
|
264
270
|
getViewDescriptorById(viewId) {
|
|
265
271
|
const view = this.viewsRegistry.getView(viewId);
|
|
266
|
-
if (view && !this.
|
|
272
|
+
if (view && !this.isViewEnabled(view)) {
|
|
267
273
|
return null;
|
|
268
274
|
}
|
|
269
275
|
return view;
|
|
@@ -277,11 +283,11 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
277
283
|
}
|
|
278
284
|
getViewContainerByViewId(viewId) {
|
|
279
285
|
const view = this.viewsRegistry.getView(viewId);
|
|
280
|
-
if (view && !this.
|
|
286
|
+
if (view && !this.isViewEnabled(view)) {
|
|
281
287
|
return null;
|
|
282
288
|
}
|
|
283
289
|
const containerId = this.viewDescriptorsCustomLocations.get(viewId);
|
|
284
|
-
return containerId ? this.
|
|
290
|
+
return containerId ? this.getViewContainerById(containerId) : this.getDefaultContainerById(viewId);
|
|
285
291
|
}
|
|
286
292
|
getViewContainerLocation(viewContainer) {
|
|
287
293
|
const location = this.viewContainersCustomLocations.get(viewContainer.id) ?? this.getDefaultViewContainerLocation(viewContainer);
|
|
@@ -303,34 +309,26 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
303
309
|
return this.getOrRegisterViewContainerModel(container);
|
|
304
310
|
}
|
|
305
311
|
getViewContainerById(id) {
|
|
306
|
-
|
|
307
|
-
if (viewContainer && !this.isViewContainerVisible(viewContainer)) {
|
|
308
|
-
return null;
|
|
309
|
-
}
|
|
310
|
-
return viewContainer;
|
|
312
|
+
return this.viewContainers.find(vc => vc.id === id) ?? null;
|
|
311
313
|
}
|
|
312
314
|
getViewContainersByLocation(location) {
|
|
313
|
-
return this.viewContainers.filter(
|
|
314
|
-
v => this.getViewContainerLocation(v) === location && this.isViewContainerVisible(v)
|
|
315
|
-
);
|
|
315
|
+
return this.viewContainers.filter(v => this.getViewContainerLocation(v) === location);
|
|
316
316
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
return !layoutVisibility || layoutVisibility === WindowVisibility.Editor || layoutVisibility === WindowVisibility.Both;
|
|
317
|
+
isViewContainerEnabled(viewContainer) {
|
|
318
|
+
return this.isEnabled(viewContainer.windowEnablement);
|
|
319
|
+
}
|
|
320
|
+
isViewEnabled(view) {
|
|
321
|
+
return this.isEnabled(view.windowEnablement);
|
|
323
322
|
}
|
|
324
|
-
|
|
325
|
-
const layoutVisibility = view.windowVisibility;
|
|
323
|
+
isEnabled(enablement) {
|
|
326
324
|
if (this.isSessionsWindow) {
|
|
327
|
-
return
|
|
325
|
+
return enablement === WindowEnablement.Sessions || enablement === WindowEnablement.Both;
|
|
328
326
|
}
|
|
329
|
-
return !
|
|
327
|
+
return !enablement || enablement === WindowEnablement.Editor || enablement === WindowEnablement.Both;
|
|
330
328
|
}
|
|
331
329
|
getDefaultViewContainer(location) {
|
|
332
330
|
const viewContainers = this.viewContainersRegistry.getDefaultViewContainers(location);
|
|
333
|
-
return viewContainers.find(viewContainer => this.
|
|
331
|
+
return viewContainers.find(viewContainer => this.isViewContainerEnabled(viewContainer));
|
|
334
332
|
}
|
|
335
333
|
canMoveViews() {
|
|
336
334
|
return !this.isSessionsWindow;
|
|
@@ -509,7 +507,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
509
507
|
mergeViewWithContainerWhenSingleView: true
|
|
510
508
|
}])),
|
|
511
509
|
title: {
|
|
512
|
-
value: ( localize(
|
|
510
|
+
value: ( localize(17235, "User View Container")),
|
|
513
511
|
original: "User View Container"
|
|
514
512
|
},
|
|
515
513
|
icon: location === ViewContainerLocation.Sidebar ? defaultViewIcon : undefined,
|
|
@@ -559,7 +557,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
559
557
|
const viewDescriptor = this.getViewDescriptorById(viewId);
|
|
560
558
|
if (viewDescriptor) {
|
|
561
559
|
const prevViewContainer = this.getViewContainerByViewId(viewId);
|
|
562
|
-
const newViewContainer = this.
|
|
560
|
+
const newViewContainer = this.getViewContainerById(viewContainerId);
|
|
563
561
|
if (prevViewContainer && newViewContainer && newViewContainer !== prevViewContainer) {
|
|
564
562
|
viewsToMove.push({
|
|
565
563
|
views: [viewDescriptor],
|
|
@@ -822,7 +820,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
822
820
|
title: viewDescriptor.name,
|
|
823
821
|
metadata: {
|
|
824
822
|
description: ( localize2(
|
|
825
|
-
|
|
823
|
+
17236,
|
|
826
824
|
"Toggles the visibility of the {0} view if the view container it is located in is visible",
|
|
827
825
|
viewDescriptor.name.value
|
|
828
826
|
))
|
|
@@ -853,10 +851,10 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
853
851
|
super({
|
|
854
852
|
id: `${viewDescriptor.id}.removeView`,
|
|
855
853
|
viewPaneContainerId: viewContainerModel.viewContainer.id,
|
|
856
|
-
title: ( localize(
|
|
854
|
+
title: ( localize(17237, "Hide '{0}'", viewDescriptor.name.value)),
|
|
857
855
|
metadata: {
|
|
858
856
|
description: ( localize2(
|
|
859
|
-
|
|
857
|
+
17238,
|
|
860
858
|
"Hides the {0} view if it is visible and the view container it is located in is visible",
|
|
861
859
|
viewDescriptor.name.value
|
|
862
860
|
))
|
|
@@ -886,7 +884,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
886
884
|
constructor() {
|
|
887
885
|
super({
|
|
888
886
|
id: `${viewContainer.id}.resetViewContainerLocation`,
|
|
889
|
-
title: ( localize2(
|
|
887
|
+
title: ( localize2(17239, "Reset Location")),
|
|
890
888
|
menu: [{
|
|
891
889
|
id: MenuId.ViewContainerTitleContext,
|
|
892
890
|
group: "1_viewActions",
|
|
@@ -285,7 +285,7 @@ let ViewsService = class ViewsService extends Disposable {
|
|
|
285
285
|
return this.viewDescriptorService.getViewDescriptorById(( viewId.toString()));
|
|
286
286
|
}
|
|
287
287
|
getFocusedViewName() {
|
|
288
|
-
const textEditorFocused = this.editorService.activeTextEditorControl?.hasTextFocus() ? ( localize(
|
|
288
|
+
const textEditorFocused = this.editorService.activeTextEditorControl?.hasTextFocus() ? ( localize(17240, "Text Editor")) : undefined;
|
|
289
289
|
return this.getFocusedView()?.name?.value ?? textEditorFocused ?? "";
|
|
290
290
|
}
|
|
291
291
|
async openView(id, focus) {
|
|
@@ -391,12 +391,12 @@ let ViewsService = class ViewsService extends Disposable {
|
|
|
391
391
|
const originalTitle = typeof title === "string" ? title : title.original;
|
|
392
392
|
if (viewContainerLocation === ViewContainerLocation.Sidebar) {
|
|
393
393
|
return {
|
|
394
|
-
value: ( localize(
|
|
394
|
+
value: ( localize(17241, "Show {0}", localizedTitle)),
|
|
395
395
|
original: `Show ${originalTitle}`
|
|
396
396
|
};
|
|
397
397
|
} else {
|
|
398
398
|
return {
|
|
399
|
-
value: ( localize(
|
|
399
|
+
value: ( localize(17242, "Toggle {0}", localizedTitle)),
|
|
400
400
|
original: `Toggle ${originalTitle}`
|
|
401
401
|
};
|
|
402
402
|
}
|
|
@@ -468,12 +468,12 @@ let ViewsService = class ViewsService extends Disposable {
|
|
|
468
468
|
const originalTitle = typeof title === "string" ? title : title.original;
|
|
469
469
|
if (viewContainerLocation === ViewContainerLocation.Sidebar) {
|
|
470
470
|
return {
|
|
471
|
-
value: ( localize(
|
|
471
|
+
value: ( localize(17241, "Show {0}", localizedTitle)),
|
|
472
472
|
original: `Show ${originalTitle}`
|
|
473
473
|
};
|
|
474
474
|
} else {
|
|
475
475
|
return {
|
|
476
|
-
value: ( localize(
|
|
476
|
+
value: ( localize(17242, "Toggle {0}", localizedTitle)),
|
|
477
477
|
original: `Toggle ${originalTitle}`
|
|
478
478
|
};
|
|
479
479
|
}
|
|
@@ -486,7 +486,7 @@ let ViewsService = class ViewsService extends Disposable {
|
|
|
486
486
|
} : undefined,
|
|
487
487
|
f1: viewDescriptor.openCommandActionDescriptor ? true : undefined,
|
|
488
488
|
metadata: {
|
|
489
|
-
description: ( localize(
|
|
489
|
+
description: ( localize(17243, "Opens view {0}", viewDescriptor.name.value)),
|
|
490
490
|
args: [{
|
|
491
491
|
name: "options",
|
|
492
492
|
schema: {
|
|
@@ -495,7 +495,7 @@ let ViewsService = class ViewsService extends Disposable {
|
|
|
495
495
|
"preserveFocus": {
|
|
496
496
|
type: "boolean",
|
|
497
497
|
default: false,
|
|
498
|
-
description: ( localize(
|
|
498
|
+
description: ( localize(17244, "Whether to preserve the existing focus when opening the view."))
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
}
|
|
@@ -542,7 +542,7 @@ let ViewsService = class ViewsService extends Disposable {
|
|
|
542
542
|
registerFocusViewAction(viewDescriptor, category) {
|
|
543
543
|
return registerAction2(class FocusViewAction extends Action2 {
|
|
544
544
|
constructor() {
|
|
545
|
-
const title = ( localize2(
|
|
545
|
+
const title = ( localize2(17245, "Focus on {0} View", viewDescriptor.name.value));
|
|
546
546
|
super({
|
|
547
547
|
id: viewDescriptor.focusCommand ? viewDescriptor.focusCommand.id : `${viewDescriptor.id}.focus`,
|
|
548
548
|
title,
|
|
@@ -588,7 +588,7 @@ let ViewsService = class ViewsService extends Disposable {
|
|
|
588
588
|
constructor() {
|
|
589
589
|
super({
|
|
590
590
|
id: `${viewDescriptor.id}.resetViewLocation`,
|
|
591
|
-
title: ( localize2(
|
|
591
|
+
title: ( localize2(17246, "Reset Location")),
|
|
592
592
|
menu: [{
|
|
593
593
|
id: MenuId.ViewTitleContext,
|
|
594
594
|
when: ( ContextKeyExpr.or(( ContextKeyExpr.and(( ContextKeyExpr.equals("view", viewDescriptor.id)), ( ContextKeyExpr.equals(`${viewDescriptor.id}.defaultViewLocation`, false)))))),
|