@codingame/monaco-vscode-view-common-service-override 30.0.0 → 31.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/package.json +3 -3
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +56 -56
- package/vscode/src/vs/workbench/browser/actions/helpActions.js +26 -23
- 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 +171 -169
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +8 -8
- 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/common/contributedCustomEditors.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +10 -10
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.js +8 -8
- 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/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 +9 -7
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +25 -79
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +1 -1
- 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/services/editor/browser/editorResolverService.d.ts +7 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +18 -9
- 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/views/browser/viewDescriptorService.js +5 -5
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +9 -9
|
@@ -22,11 +22,11 @@ import { TypeHierarchyTreePeekWidget } from './typeHierarchyPeek.js';
|
|
|
22
22
|
import { TypeHierarchyDirection, TypeHierarchyProviderRegistry, TypeHierarchyModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
|
|
23
23
|
|
|
24
24
|
var TypeHierarchyController_1;
|
|
25
|
-
const _ctxHasTypeHierarchyProvider = ( new RawContextKey("editorHasTypeHierarchyProvider", false, ( localize(
|
|
26
|
-
const _ctxTypeHierarchyVisible = ( new RawContextKey("typeHierarchyVisible", false, ( localize(
|
|
25
|
+
const _ctxHasTypeHierarchyProvider = ( new RawContextKey("editorHasTypeHierarchyProvider", false, ( localize(14943, "Whether a type hierarchy provider is available"))));
|
|
26
|
+
const _ctxTypeHierarchyVisible = ( new RawContextKey("typeHierarchyVisible", false, ( localize(14944, "Whether type hierarchy peek is currently showing"))));
|
|
27
27
|
const _ctxTypeHierarchyDirection = ( new RawContextKey("typeHierarchyDirection", undefined, {
|
|
28
28
|
type: "string",
|
|
29
|
-
description: ( localize(
|
|
29
|
+
description: ( localize(14945, "whether type hierarchy shows super types or subtypes"))
|
|
30
30
|
}));
|
|
31
31
|
function sanitizedDirection(candidate) {
|
|
32
32
|
return candidate === TypeHierarchyDirection.Subtypes || candidate === TypeHierarchyDirection.Supertypes ? candidate : TypeHierarchyDirection.Subtypes;
|
|
@@ -121,14 +121,14 @@ let TypeHierarchyController = class TypeHierarchyController {
|
|
|
121
121
|
this._sessionDisposables.add(model);
|
|
122
122
|
this._widget.showModel(model);
|
|
123
123
|
} else {
|
|
124
|
-
this._widget.showMessage(( localize(
|
|
124
|
+
this._widget.showMessage(( localize(14946, "No results")));
|
|
125
125
|
}
|
|
126
126
|
}).catch(err => {
|
|
127
127
|
if (isCancellationError(err)) {
|
|
128
128
|
this.endTypeHierarchy();
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
this._widget.showMessage(( localize(
|
|
131
|
+
this._widget.showMessage(( localize(14947, "Failed to show type hierarchy")));
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
async startTypeHierarchyFromTypeHierarchy() {
|
|
@@ -179,7 +179,7 @@ registerAction2(class PeekTypeHierarchyAction extends EditorAction2 {
|
|
|
179
179
|
constructor() {
|
|
180
180
|
super({
|
|
181
181
|
id: "editor.showTypeHierarchy",
|
|
182
|
-
title: ( localize2(
|
|
182
|
+
title: ( localize2(14948, "Peek Type Hierarchy")),
|
|
183
183
|
menu: {
|
|
184
184
|
id: MenuId.EditorContextPeek,
|
|
185
185
|
group: "navigation",
|
|
@@ -198,7 +198,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
198
198
|
constructor() {
|
|
199
199
|
super({
|
|
200
200
|
id: "editor.showSupertypes",
|
|
201
|
-
title: ( localize2(
|
|
201
|
+
title: ( localize2(14949, "Show Supertypes")),
|
|
202
202
|
icon: Codicon.typeHierarchySuper,
|
|
203
203
|
precondition: ( ContextKeyExpr.and(_ctxTypeHierarchyVisible, ( _ctxTypeHierarchyDirection.isEqualTo(TypeHierarchyDirection.Subtypes)))),
|
|
204
204
|
keybinding: {
|
|
@@ -220,7 +220,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
220
220
|
constructor() {
|
|
221
221
|
super({
|
|
222
222
|
id: "editor.showSubtypes",
|
|
223
|
-
title: ( localize2(
|
|
223
|
+
title: ( localize2(14950, "Show Subtypes")),
|
|
224
224
|
icon: Codicon.typeHierarchySub,
|
|
225
225
|
precondition: ( ContextKeyExpr.and(_ctxTypeHierarchyVisible, ( _ctxTypeHierarchyDirection.isEqualTo(TypeHierarchyDirection.Supertypes)))),
|
|
226
226
|
keybinding: {
|
|
@@ -242,7 +242,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
242
242
|
constructor() {
|
|
243
243
|
super({
|
|
244
244
|
id: "editor.refocusTypeHierarchy",
|
|
245
|
-
title: ( localize2(
|
|
245
|
+
title: ( localize2(14951, "Refocus Type Hierarchy")),
|
|
246
246
|
precondition: _ctxTypeHierarchyVisible,
|
|
247
247
|
keybinding: {
|
|
248
248
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
@@ -258,7 +258,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
258
258
|
constructor() {
|
|
259
259
|
super({
|
|
260
260
|
id: "editor.closeTypeHierarchy",
|
|
261
|
-
title: ( localize(
|
|
261
|
+
title: ( localize(14952, "Close")),
|
|
262
262
|
icon: Codicon.close,
|
|
263
263
|
precondition: _ctxTypeHierarchyVisible,
|
|
264
264
|
keybinding: {
|
|
@@ -326,12 +326,12 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
|
|
|
326
326
|
this._previewDisposable.add(toDisposable(() => decorationsCollection.clear()));
|
|
327
327
|
}
|
|
328
328
|
this._previewDisposable.add(value);
|
|
329
|
-
const title = this._direction === TypeHierarchyDirection.Supertypes ? ( localize(
|
|
329
|
+
const title = this._direction === TypeHierarchyDirection.Supertypes ? ( localize(14953, "Supertypes of '{0}'", element.model.root.name)) : ( localize(14954, "Subtypes of '{0}'", element.model.root.name));
|
|
330
330
|
this.setTitle(title);
|
|
331
331
|
}
|
|
332
332
|
showLoading() {
|
|
333
333
|
this._parent.dataset["state"] = State.Loading;
|
|
334
|
-
this.setTitle(( localize(
|
|
334
|
+
this.setTitle(( localize(14955, "Loading...")));
|
|
335
335
|
this._show();
|
|
336
336
|
}
|
|
337
337
|
showMessage(message) {
|
|
@@ -349,7 +349,7 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
|
|
|
349
349
|
const root = this._tree.getNode(model).children[0];
|
|
350
350
|
await this._tree.expand(root.element);
|
|
351
351
|
if (root.children.length === 0) {
|
|
352
|
-
this.showMessage(this._direction === TypeHierarchyDirection.Supertypes ? ( localize(
|
|
352
|
+
this.showMessage(this._direction === TypeHierarchyDirection.Supertypes ? ( localize(14956, "No supertypes of '{0}'", model.root.name)) : ( localize(14957, "No subtypes of '{0}'", model.root.name)));
|
|
353
353
|
} else {
|
|
354
354
|
this._parent.dataset["state"] = State.Data;
|
|
355
355
|
if (!viewState || this._tree.getFocus().length === 0) {
|
|
@@ -123,13 +123,13 @@ class AccessibilityProvider {
|
|
|
123
123
|
this.getDirection = getDirection;
|
|
124
124
|
}
|
|
125
125
|
getWidgetAriaLabel() {
|
|
126
|
-
return localize(
|
|
126
|
+
return localize(14958, "Type Hierarchy");
|
|
127
127
|
}
|
|
128
128
|
getAriaLabel(element) {
|
|
129
129
|
if (this.getDirection() === TypeHierarchyDirection.Supertypes) {
|
|
130
|
-
return localize(
|
|
130
|
+
return localize(14959, "supertypes of {0}", element.item.name);
|
|
131
131
|
} else {
|
|
132
|
-
return localize(
|
|
132
|
+
return localize(14960, "subtypes of {0}", element.item.name);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -6,17 +6,20 @@ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
|
6
6
|
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
7
7
|
import { ExtensionIdentifier } from "@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions";
|
|
8
8
|
import { IWorkbenchLayoutService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service";
|
|
9
|
-
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
10
9
|
import { IOverlayWebview, WebviewContentOptions, WebviewExtensionDescription, WebviewInitInfo, WebviewMessageReceivedEvent, WebviewOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview";
|
|
11
10
|
import { IWebviewService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview.service";
|
|
12
11
|
/**
|
|
13
|
-
* Webview that is absolutely positioned over another element and that can
|
|
12
|
+
* Webview that is absolutely positioned over another element and that can
|
|
13
|
+
* creates and destroys an underlying webview as needed.
|
|
14
|
+
*
|
|
15
|
+
* Absolutely positioning is needed because webviews (iframes) cannot be re-parented without losing their state.
|
|
16
|
+
* This means that webviews are always placed on a top level and then moved over
|
|
17
|
+
* the element they are anchored to so they visually look like they are part of the original layout.
|
|
14
18
|
*/
|
|
15
19
|
export declare class OverlayWebview extends Disposable implements IOverlayWebview {
|
|
16
20
|
private readonly _layoutService;
|
|
17
21
|
private readonly _webviewService;
|
|
18
22
|
private readonly _baseContextKeyService;
|
|
19
|
-
private readonly _editorGroupsService;
|
|
20
23
|
private _isFirstLoad;
|
|
21
24
|
private readonly _firstLoadPendingMessages;
|
|
22
25
|
private readonly _webview;
|
|
@@ -37,8 +40,8 @@ export declare class OverlayWebview extends Disposable implements IOverlayWebvie
|
|
|
37
40
|
private _shouldShowFindWidgetOnRestore;
|
|
38
41
|
readonly providedViewType?: string;
|
|
39
42
|
origin: string;
|
|
40
|
-
private
|
|
41
|
-
constructor(initInfo: WebviewInitInfo, _layoutService: IWorkbenchLayoutService, _webviewService: IWebviewService, _baseContextKeyService: IContextKeyService
|
|
43
|
+
private _overlayLayout;
|
|
44
|
+
constructor(initInfo: WebviewInitInfo, _layoutService: IWorkbenchLayoutService, _webviewService: IWebviewService, _baseContextKeyService: IContextKeyService);
|
|
42
45
|
get isFocused(): boolean;
|
|
43
46
|
private _isDisposed;
|
|
44
47
|
private readonly _onDidDispose;
|
|
@@ -47,8 +50,7 @@ export declare class OverlayWebview extends Disposable implements IOverlayWebvie
|
|
|
47
50
|
get container(): HTMLElement;
|
|
48
51
|
claim(owner: unknown, targetWindow: CodeWindow, scopedContextKeyService: IContextKeyService | undefined): void;
|
|
49
52
|
release(owner: unknown): void;
|
|
50
|
-
layoutWebviewOverElement(
|
|
51
|
-
private doLayoutWebviewOverElement;
|
|
53
|
+
layoutWebviewOverElement(anchorElement: HTMLElement, dimension?: Dimension, clippingContainer?: HTMLElement): void;
|
|
52
54
|
private _show;
|
|
53
55
|
setHtml(html: string): void;
|
|
54
56
|
setTitle(title: string): void;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { getWindowById
|
|
4
|
-
import {
|
|
3
|
+
import { getWindowById } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
|
+
import { OverlayLayoutElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/overlayLayoutElement';
|
|
5
5
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
6
|
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
7
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
8
8
|
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
9
9
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
10
10
|
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
11
|
-
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
12
11
|
import { KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_ENABLED } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview';
|
|
13
12
|
import { IWebviewService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview.service';
|
|
14
13
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
@@ -18,18 +17,11 @@ let OverlayWebview = class OverlayWebview extends Disposable {
|
|
|
18
17
|
get window() {
|
|
19
18
|
return getWindowById(this._windowId, true).window;
|
|
20
19
|
}
|
|
21
|
-
constructor(
|
|
22
|
-
initInfo,
|
|
23
|
-
_layoutService,
|
|
24
|
-
_webviewService,
|
|
25
|
-
_baseContextKeyService,
|
|
26
|
-
_editorGroupsService
|
|
27
|
-
) {
|
|
20
|
+
constructor(initInfo, _layoutService, _webviewService, _baseContextKeyService) {
|
|
28
21
|
super();
|
|
29
22
|
this._layoutService = _layoutService;
|
|
30
23
|
this._webviewService = _webviewService;
|
|
31
24
|
this._baseContextKeyService = _baseContextKeyService;
|
|
32
|
-
this._editorGroupsService = _editorGroupsService;
|
|
33
25
|
this._isFirstLoad = true;
|
|
34
26
|
this._firstLoadPendingMessages = ( new Set());
|
|
35
27
|
this._webview = this._register(( new MutableDisposable()));
|
|
@@ -75,8 +67,8 @@ let OverlayWebview = class OverlayWebview extends Disposable {
|
|
|
75
67
|
}
|
|
76
68
|
dispose() {
|
|
77
69
|
this._isDisposed = true;
|
|
78
|
-
this.
|
|
79
|
-
this.
|
|
70
|
+
this._overlayLayout?.dispose();
|
|
71
|
+
this._overlayLayout = undefined;
|
|
80
72
|
for (const msg of this._firstLoadPendingMessages) {
|
|
81
73
|
msg.resolve(false);
|
|
82
74
|
}
|
|
@@ -88,22 +80,13 @@ let OverlayWebview = class OverlayWebview extends Disposable {
|
|
|
88
80
|
if (this._isDisposed) {
|
|
89
81
|
throw ( new Error(`OverlayWebview has been disposed`));
|
|
90
82
|
}
|
|
91
|
-
if (!this.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.
|
|
96
|
-
this._container.setVisibility("hidden");
|
|
97
|
-
const modalEditorContainer = this._editorGroupsService.activeModalEditorPart?.modalElement;
|
|
98
|
-
let root;
|
|
99
|
-
if (isHTMLElement(modalEditorContainer)) {
|
|
100
|
-
root = modalEditorContainer;
|
|
101
|
-
} else {
|
|
102
|
-
root = this._layoutService.getContainer(this.window);
|
|
103
|
-
}
|
|
104
|
-
root.appendChild(node);
|
|
83
|
+
if (!this._overlayLayout) {
|
|
84
|
+
this._overlayLayout = ( new OverlayLayoutElement());
|
|
85
|
+
this._overlayLayout.content.style.visibility = "hidden";
|
|
86
|
+
const root = this._layoutService.getContainer(this.window);
|
|
87
|
+
root.appendChild(this._overlayLayout.root);
|
|
105
88
|
}
|
|
106
|
-
return this.
|
|
89
|
+
return this._overlayLayout.content;
|
|
107
90
|
}
|
|
108
91
|
claim(owner, targetWindow, scopedContextKeyService) {
|
|
109
92
|
if (this._isDisposed) {
|
|
@@ -114,8 +97,8 @@ let OverlayWebview = class OverlayWebview extends Disposable {
|
|
|
114
97
|
this.release(oldOwner);
|
|
115
98
|
this._webview.clear();
|
|
116
99
|
this._webviewEvents.clear();
|
|
117
|
-
this.
|
|
118
|
-
this.
|
|
100
|
+
this._overlayLayout?.dispose();
|
|
101
|
+
this._overlayLayout = undefined;
|
|
119
102
|
}
|
|
120
103
|
this._owner = owner;
|
|
121
104
|
this._windowId = targetWindow.vscodeWindowId;
|
|
@@ -140,8 +123,8 @@ let OverlayWebview = class OverlayWebview extends Disposable {
|
|
|
140
123
|
}
|
|
141
124
|
this._scopedContextKeyService.clear();
|
|
142
125
|
this._owner = undefined;
|
|
143
|
-
if (this.
|
|
144
|
-
this.
|
|
126
|
+
if (this._overlayLayout) {
|
|
127
|
+
this._overlayLayout.content.style.visibility = "hidden";
|
|
145
128
|
}
|
|
146
129
|
if (this._options.retainContextWhenHidden) {
|
|
147
130
|
this._shouldShowFindWidgetOnRestore = !!this._findWidgetVisible?.get();
|
|
@@ -151,40 +134,14 @@ let OverlayWebview = class OverlayWebview extends Disposable {
|
|
|
151
134
|
this._webviewEvents.clear();
|
|
152
135
|
}
|
|
153
136
|
}
|
|
154
|
-
layoutWebviewOverElement(
|
|
155
|
-
if (!this.
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
const whenContainerStylesLoaded = this._layoutService.whenContainerStylesLoaded(this.window);
|
|
159
|
-
if (whenContainerStylesLoaded) {
|
|
160
|
-
whenContainerStylesLoaded.then(
|
|
161
|
-
() => this.doLayoutWebviewOverElement(element, dimension, clippingContainer)
|
|
162
|
-
);
|
|
163
|
-
} else {
|
|
164
|
-
this.doLayoutWebviewOverElement(element, dimension, clippingContainer);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
doLayoutWebviewOverElement(element, dimension, clippingContainer) {
|
|
168
|
-
if (!this._container || !this._container.domNode.parentElement) {
|
|
137
|
+
layoutWebviewOverElement(anchorElement, dimension, clippingContainer) {
|
|
138
|
+
if (!this._overlayLayout || !this._overlayLayout.content.parentElement) {
|
|
169
139
|
return;
|
|
170
140
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
this._container.setTop(frameRect.top - containerRect.top - parentBorderTop);
|
|
176
|
-
this._container.setLeft(frameRect.left - containerRect.left - parentBorderLeft);
|
|
177
|
-
this._container.setWidth(dimension ? dimension.width : frameRect.width);
|
|
178
|
-
this._container.setHeight(dimension ? dimension.height : frameRect.height);
|
|
179
|
-
if (clippingContainer) {
|
|
180
|
-
const {
|
|
181
|
-
top,
|
|
182
|
-
left,
|
|
183
|
-
right,
|
|
184
|
-
bottom
|
|
185
|
-
} = computeClippingRect(frameRect, clippingContainer);
|
|
186
|
-
this._container.domNode.style.clipPath = `polygon(${left}px ${top}px, ${right}px ${top}px, ${right}px ${bottom}px, ${left}px ${bottom}px)`;
|
|
187
|
-
}
|
|
141
|
+
this._overlayLayout?.layoutOverAnchorElement(anchorElement, {
|
|
142
|
+
clippingContainer,
|
|
143
|
+
fallbackDimension: dimension
|
|
144
|
+
});
|
|
188
145
|
}
|
|
189
146
|
_show(targetWindow) {
|
|
190
147
|
if (this._isDisposed) {
|
|
@@ -257,7 +214,9 @@ let OverlayWebview = class OverlayWebview extends Disposable {
|
|
|
257
214
|
this.showFind(false);
|
|
258
215
|
this._shouldShowFindWidgetOnRestore = false;
|
|
259
216
|
}
|
|
260
|
-
this.
|
|
217
|
+
if (this._overlayLayout) {
|
|
218
|
+
this._overlayLayout.content.style.visibility = "visible";
|
|
219
|
+
}
|
|
261
220
|
}
|
|
262
221
|
setHtml(html) {
|
|
263
222
|
this._html = html;
|
|
@@ -375,19 +334,6 @@ let OverlayWebview = class OverlayWebview extends Disposable {
|
|
|
375
334
|
this._webview.value?.setContextKeyService(contextKeyService);
|
|
376
335
|
}
|
|
377
336
|
};
|
|
378
|
-
OverlayWebview = ( __decorate([( __param(1, IWorkbenchLayoutService)), ( __param(2, IWebviewService)), ( __param(3, IContextKeyService))
|
|
379
|
-
function computeClippingRect(frameRect, clipper) {
|
|
380
|
-
const rootRect = clipper.getBoundingClientRect();
|
|
381
|
-
const top = Math.max(rootRect.top - frameRect.top, 0);
|
|
382
|
-
const right = Math.max(frameRect.width - (frameRect.right - rootRect.right), 0);
|
|
383
|
-
const bottom = Math.max(frameRect.height - (frameRect.bottom - rootRect.bottom), 0);
|
|
384
|
-
const left = Math.max(rootRect.left - frameRect.left, 0);
|
|
385
|
-
return {
|
|
386
|
-
top,
|
|
387
|
-
right,
|
|
388
|
-
bottom,
|
|
389
|
-
left
|
|
390
|
-
};
|
|
391
|
-
}
|
|
337
|
+
OverlayWebview = ( __decorate([( __param(1, IWorkbenchLayoutService)), ( __param(2, IWebviewService)), ( __param(3, IContextKeyService))], OverlayWebview));
|
|
392
338
|
|
|
393
339
|
export { OverlayWebview };
|
|
@@ -205,7 +205,7 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
205
205
|
this._hasFindResult.fire(didFind);
|
|
206
206
|
}));
|
|
207
207
|
this._register(this.on("fatal-error", e => {
|
|
208
|
-
notificationService.error(( localize(
|
|
208
|
+
notificationService.error(( localize(15317, "Error loading webview: {0}", e.message)));
|
|
209
209
|
this._onFatalError.fire({
|
|
210
210
|
message: e.message
|
|
211
211
|
});
|
|
@@ -18,7 +18,7 @@ class ShowWebViewEditorFindWidgetAction extends Action2 {
|
|
|
18
18
|
this.ID = "editor.action.webvieweditor.showFind";
|
|
19
19
|
}
|
|
20
20
|
static {
|
|
21
|
-
this.LABEL = ( localize(
|
|
21
|
+
this.LABEL = ( localize(15348, "Show find"));
|
|
22
22
|
}
|
|
23
23
|
constructor() {
|
|
24
24
|
super({
|
|
@@ -43,7 +43,7 @@ class HideWebViewEditorFindCommand extends Action2 {
|
|
|
43
43
|
this.ID = "editor.action.webvieweditor.hideFind";
|
|
44
44
|
}
|
|
45
45
|
static {
|
|
46
|
-
this.LABEL = ( localize(
|
|
46
|
+
this.LABEL = ( localize(15349, "Stop find"));
|
|
47
47
|
}
|
|
48
48
|
constructor() {
|
|
49
49
|
super({
|
|
@@ -68,7 +68,7 @@ class WebViewEditorFindNextCommand extends Action2 {
|
|
|
68
68
|
this.ID = "editor.action.webvieweditor.findNext";
|
|
69
69
|
}
|
|
70
70
|
static {
|
|
71
|
-
this.LABEL = ( localize(
|
|
71
|
+
this.LABEL = ( localize(15350, "Find next"));
|
|
72
72
|
}
|
|
73
73
|
constructor() {
|
|
74
74
|
super({
|
|
@@ -93,7 +93,7 @@ class WebViewEditorFindPreviousCommand extends Action2 {
|
|
|
93
93
|
this.ID = "editor.action.webvieweditor.findPrevious";
|
|
94
94
|
}
|
|
95
95
|
static {
|
|
96
|
-
this.LABEL = ( localize(
|
|
96
|
+
this.LABEL = ( localize(15351, "Find previous"));
|
|
97
97
|
}
|
|
98
98
|
constructor() {
|
|
99
99
|
super({
|
|
@@ -118,7 +118,7 @@ class ReloadWebviewAction extends Action2 {
|
|
|
118
118
|
this.ID = "workbench.action.webview.reloadWebviewAction";
|
|
119
119
|
}
|
|
120
120
|
static {
|
|
121
|
-
this.LABEL = ( localize2(
|
|
121
|
+
this.LABEL = ( localize2(15352, "Reload Webviews"));
|
|
122
122
|
}
|
|
123
123
|
constructor() {
|
|
124
124
|
super({
|
|
@@ -19,7 +19,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/ins
|
|
|
19
19
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
20
20
|
|
|
21
21
|
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
22
|
-
EditorPaneDescriptor.create(WebviewEditor, WebviewEditor.ID, ( localize(
|
|
22
|
+
EditorPaneDescriptor.create(WebviewEditor, WebviewEditor.ID, ( localize(15354, "webview editor"))),
|
|
23
23
|
[( new SyncDescriptor(WebviewInput))]
|
|
24
24
|
);
|
|
25
25
|
let WebviewPanelContribution = class WebviewPanelContribution extends Disposable {
|
|
@@ -78,5 +78,12 @@ export declare class EditorResolverService extends Disposable implements IEditor
|
|
|
78
78
|
private mapEditorsToQuickPickEntry;
|
|
79
79
|
private doPickEditor;
|
|
80
80
|
private cacheEditors;
|
|
81
|
+
/**
|
|
82
|
+
* Checks if a resource matches any user-configured editor association that
|
|
83
|
+
* points to a non-default editor. This ensures that on first startup (when
|
|
84
|
+
* the cache is empty), we still wait for extensions to register before
|
|
85
|
+
* resolving the editor, so that user-configured custom editors are available.
|
|
86
|
+
*/
|
|
87
|
+
private resourceMatchesUserAssociation;
|
|
81
88
|
private resourceMatchesCache;
|
|
82
89
|
}
|
|
@@ -112,7 +112,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
112
112
|
let resource = EditorResourceAccessor.getCanonicalUri(untypedEditor, {
|
|
113
113
|
supportSideBySide: SideBySideEditor.PRIMARY
|
|
114
114
|
});
|
|
115
|
-
if (this.cache && resource && this.resourceMatchesCache(resource)) {
|
|
115
|
+
if (this.cache && resource && (this.resourceMatchesCache(resource) || this.resourceMatchesUserAssociation(resource))) {
|
|
116
116
|
await this.extensionService.whenInstalledExtensionsRegistered();
|
|
117
117
|
}
|
|
118
118
|
if (resource === undefined) {
|
|
@@ -560,8 +560,8 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
560
560
|
if (storedChoices[globForResource]?.find(editorID => editorID === currentEditor.editorId)) {
|
|
561
561
|
return;
|
|
562
562
|
}
|
|
563
|
-
const handle = this.notificationService.prompt(Severity.Warning, ( localize(
|
|
564
|
-
label: ( localize(
|
|
563
|
+
const handle = this.notificationService.prompt(Severity.Warning, ( localize(16186, "There are multiple default editors available for the resource.")), [{
|
|
564
|
+
label: ( localize(16187, "Configure Default")),
|
|
565
565
|
run: async () => {
|
|
566
566
|
const picked = await this.doPickEditor(untypedInput, true);
|
|
567
567
|
if (!picked) {
|
|
@@ -579,7 +579,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
579
579
|
}]);
|
|
580
580
|
}
|
|
581
581
|
}, {
|
|
582
|
-
label: ( localize(
|
|
582
|
+
label: ( localize(16188, "Keep {0}", editorName)),
|
|
583
583
|
run: writeCurrentEditorsToStorage
|
|
584
584
|
}]);
|
|
585
585
|
const onCloseListener = handle.onDidClose(() => {
|
|
@@ -602,9 +602,9 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
602
602
|
}
|
|
603
603
|
});
|
|
604
604
|
const quickPickEntries = [];
|
|
605
|
-
const currentlyActiveLabel = ( localize(
|
|
606
|
-
const currentDefaultLabel = ( localize(
|
|
607
|
-
const currentDefaultAndActiveLabel = ( localize(
|
|
605
|
+
const currentlyActiveLabel = ( localize(16189, "Active"));
|
|
606
|
+
const currentDefaultLabel = ( localize(16190, "Default"));
|
|
607
|
+
const currentDefaultAndActiveLabel = ( localize(16191, "Active and Default"));
|
|
608
608
|
let defaultViewType = defaultSetting;
|
|
609
609
|
if (!defaultViewType && registeredEditors.length > 2 && registeredEditors[1]?.editorInfo.priority !== RegisteredEditorPriority.option) {
|
|
610
610
|
defaultViewType = registeredEditors[1]?.editorInfo.id;
|
|
@@ -631,7 +631,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
631
631
|
quickPickEntries.push(separator);
|
|
632
632
|
const configureDefaultEntry = {
|
|
633
633
|
id: EditorResolverService_1.configureDefaultID,
|
|
634
|
-
label: ( localize(
|
|
634
|
+
label: ( localize(16192, "Configure default editor for '{0}'...", `*${extname(resource)}`))
|
|
635
635
|
};
|
|
636
636
|
quickPickEntries.push(configureDefaultEntry);
|
|
637
637
|
}
|
|
@@ -651,7 +651,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
651
651
|
const editorPicker = disposables.add(this.quickInputService.createQuickPick({
|
|
652
652
|
useSeparators: true
|
|
653
653
|
}));
|
|
654
|
-
const placeHolderMessage = showDefaultPicker ? ( localize(
|
|
654
|
+
const placeHolderMessage = showDefaultPicker ? ( localize(16193, "Select new default editor for '{0}'", `*${extname(resource)}`)) : ( localize(16194, "Select editor for '{0}'", basename(resource)));
|
|
655
655
|
editorPicker.placeholder = placeHolderMessage;
|
|
656
656
|
editorPicker.canAcceptInBackground = true;
|
|
657
657
|
editorPicker.items = editorPicks;
|
|
@@ -731,6 +731,15 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
731
731
|
StorageTarget.MACHINE
|
|
732
732
|
);
|
|
733
733
|
}
|
|
734
|
+
resourceMatchesUserAssociation(resource) {
|
|
735
|
+
const userAssociations = this.getAllUserAssociations();
|
|
736
|
+
for (const association of userAssociations) {
|
|
737
|
+
if (association.filenamePattern && association.viewType !== DEFAULT_EDITOR_ASSOCIATION.id && globMatchesResource(association.filenamePattern, resource)) {
|
|
738
|
+
return true;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return false;
|
|
742
|
+
}
|
|
734
743
|
resourceMatchesCache(resource) {
|
|
735
744
|
if (!this.cache) {
|
|
736
745
|
return false;
|
|
@@ -101,33 +101,33 @@ let HistoryService = class HistoryService extends Disposable {
|
|
|
101
101
|
return matcher;
|
|
102
102
|
}));
|
|
103
103
|
this.editorHelper = this.instantiationService.createInstance(EditorHelper);
|
|
104
|
-
this.canNavigateBackContextKey = ( new RawContextKey("canNavigateBack", false, ( localize(
|
|
105
|
-
this.canNavigateForwardContextKey = ( new RawContextKey("canNavigateForward", false, ( localize(
|
|
104
|
+
this.canNavigateBackContextKey = ( new RawContextKey("canNavigateBack", false, ( localize(16408, "Whether it is possible to navigate back in editor history")))).bindTo(this.contextKeyService);
|
|
105
|
+
this.canNavigateForwardContextKey = ( new RawContextKey("canNavigateForward", false, ( localize(16409, "Whether it is possible to navigate forward in editor history")))).bindTo(this.contextKeyService);
|
|
106
106
|
this.canNavigateBackInNavigationsContextKey = ( new RawContextKey("canNavigateBackInNavigationLocations", false, ( localize(
|
|
107
|
-
|
|
107
|
+
16410,
|
|
108
108
|
"Whether it is possible to navigate back in editor navigation locations history"
|
|
109
109
|
)))).bindTo(this.contextKeyService);
|
|
110
110
|
this.canNavigateForwardInNavigationsContextKey = ( new RawContextKey("canNavigateForwardInNavigationLocations", false, ( localize(
|
|
111
|
-
|
|
111
|
+
16411,
|
|
112
112
|
"Whether it is possible to navigate forward in editor navigation locations history"
|
|
113
113
|
)))).bindTo(this.contextKeyService);
|
|
114
114
|
this.canNavigateToLastNavigationLocationContextKey = ( new RawContextKey("canNavigateToLastNavigationLocation", false, ( localize(
|
|
115
|
-
|
|
115
|
+
16412,
|
|
116
116
|
"Whether it is possible to navigate to the last editor navigation location"
|
|
117
117
|
)))).bindTo(this.contextKeyService);
|
|
118
118
|
this.canNavigateBackInEditsContextKey = ( new RawContextKey("canNavigateBackInEditLocations", false, ( localize(
|
|
119
|
-
|
|
119
|
+
16413,
|
|
120
120
|
"Whether it is possible to navigate back in editor edit locations history"
|
|
121
121
|
)))).bindTo(this.contextKeyService);
|
|
122
122
|
this.canNavigateForwardInEditsContextKey = ( new RawContextKey("canNavigateForwardInEditLocations", false, ( localize(
|
|
123
|
-
|
|
123
|
+
16414,
|
|
124
124
|
"Whether it is possible to navigate forward in editor edit locations history"
|
|
125
125
|
)))).bindTo(this.contextKeyService);
|
|
126
126
|
this.canNavigateToLastEditLocationContextKey = ( new RawContextKey("canNavigateToLastEditLocation", false, ( localize(
|
|
127
|
-
|
|
127
|
+
16415,
|
|
128
128
|
"Whether it is possible to navigate to the last editor edit location"
|
|
129
129
|
)))).bindTo(this.contextKeyService);
|
|
130
|
-
this.canReopenClosedEditorContextKey = ( new RawContextKey("canReopenClosedEditor", false, ( localize(
|
|
130
|
+
this.canReopenClosedEditorContextKey = ( new RawContextKey("canReopenClosedEditor", false, ( localize(16416, "Whether it is possible to reopen the last closed editor")))).bindTo(this.contextKeyService);
|
|
131
131
|
this.registerListeners();
|
|
132
132
|
if (this.editorService.activeEditorPane) {
|
|
133
133
|
this.onDidActiveEditorChange();
|
|
@@ -173,20 +173,20 @@ let ProgressService = class ProgressService extends Disposable {
|
|
|
173
173
|
let title;
|
|
174
174
|
const source = options.source && typeof options.source !== "string" ? options.source.label : options.source;
|
|
175
175
|
if (progressTitle && progressMessage) {
|
|
176
|
-
text = ( localize(
|
|
177
|
-
title = source ? ( localize(
|
|
176
|
+
text = ( localize(16544, "{0}: {1}", progressTitle, progressMessage));
|
|
177
|
+
title = source ? ( localize(16545, "[{0}] {1}: {2}", source, progressTitle, progressMessage)) : text;
|
|
178
178
|
} else if (progressTitle) {
|
|
179
179
|
text = progressTitle;
|
|
180
|
-
title = source ? ( localize(
|
|
180
|
+
title = source ? ( localize(16546, "[{0}]: {1}", source, progressTitle)) : text;
|
|
181
181
|
} else if (progressMessage) {
|
|
182
182
|
text = progressMessage;
|
|
183
|
-
title = source ? ( localize(
|
|
183
|
+
title = source ? ( localize(16546, "[{0}]: {1}", source, progressMessage)) : text;
|
|
184
184
|
} else {
|
|
185
185
|
this.updateWindowProgress(idx + 1);
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
188
|
const statusEntryProperties = {
|
|
189
|
-
name: ( localize(
|
|
189
|
+
name: ( localize(16547, "Progress Message")),
|
|
190
190
|
text,
|
|
191
191
|
showProgress: options.type || true,
|
|
192
192
|
ariaLabel: text,
|
|
@@ -292,7 +292,7 @@ let ProgressService = class ProgressService extends Disposable {
|
|
|
292
292
|
constructor() {
|
|
293
293
|
super(
|
|
294
294
|
"progress.cancel",
|
|
295
|
-
typeof options.cancellable === "string" ? options.cancellable : ( localize(
|
|
295
|
+
typeof options.cancellable === "string" ? options.cancellable : ( localize(16548, "Cancel")),
|
|
296
296
|
undefined,
|
|
297
297
|
true
|
|
298
298
|
);
|
|
@@ -484,7 +484,7 @@ let ProgressService = class ProgressService extends Disposable {
|
|
|
484
484
|
const buttons = options.buttons || [];
|
|
485
485
|
if (!options.sticky) {
|
|
486
486
|
buttons.push(
|
|
487
|
-
options.cancellable ? (typeof options.cancellable === "boolean" ? ( localize(
|
|
487
|
+
options.cancellable ? (typeof options.cancellable === "boolean" ? ( localize(16548, "Cancel")) : options.cancellable) : ( localize(16549, "Dismiss"))
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
490
|
dialog = ( new Dialog(
|
|
@@ -509,7 +509,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
509
509
|
mergeViewWithContainerWhenSingleView: true
|
|
510
510
|
}])),
|
|
511
511
|
title: {
|
|
512
|
-
value: ( localize(
|
|
512
|
+
value: ( localize(16926, "User View Container")),
|
|
513
513
|
original: "User View Container"
|
|
514
514
|
},
|
|
515
515
|
icon: location === ViewContainerLocation.Sidebar ? defaultViewIcon : undefined,
|
|
@@ -822,7 +822,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
822
822
|
title: viewDescriptor.name,
|
|
823
823
|
metadata: {
|
|
824
824
|
description: ( localize2(
|
|
825
|
-
|
|
825
|
+
16927,
|
|
826
826
|
"Toggles the visibility of the {0} view if the view container it is located in is visible",
|
|
827
827
|
viewDescriptor.name.value
|
|
828
828
|
))
|
|
@@ -853,10 +853,10 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
853
853
|
super({
|
|
854
854
|
id: `${viewDescriptor.id}.removeView`,
|
|
855
855
|
viewPaneContainerId: viewContainerModel.viewContainer.id,
|
|
856
|
-
title: ( localize(
|
|
856
|
+
title: ( localize(16928, "Hide '{0}'", viewDescriptor.name.value)),
|
|
857
857
|
metadata: {
|
|
858
858
|
description: ( localize2(
|
|
859
|
-
|
|
859
|
+
16929,
|
|
860
860
|
"Hides the {0} view if it is visible and the view container it is located in is visible",
|
|
861
861
|
viewDescriptor.name.value
|
|
862
862
|
))
|
|
@@ -886,7 +886,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
886
886
|
constructor() {
|
|
887
887
|
super({
|
|
888
888
|
id: `${viewContainer.id}.resetViewContainerLocation`,
|
|
889
|
-
title: ( localize2(
|
|
889
|
+
title: ( localize2(16930, "Reset Location")),
|
|
890
890
|
menu: [{
|
|
891
891
|
id: MenuId.ViewContainerTitleContext,
|
|
892
892
|
group: "1_viewActions",
|