@codingame/monaco-vscode-view-common-service-override 32.0.2 → 34.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 +4 -4
- package/service-override/vs/workbench/contrib/webview/browser/pre/index.html +14 -8
- package/vscode/src/vs/sessions/common/theme.d.ts +4 -0
- package/vscode/src/vs/sessions/common/theme.js +48 -30
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +65 -57
- 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 +180 -175
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +18 -15
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubar.contribution.js +8 -8
- package/vscode/src/vs/workbench/browser/workbench.zenMode.contribution.js +15 -15
- 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/customEditors.js +2 -4
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +37 -7
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.d.ts +4 -7
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +4 -6
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.d.ts +62 -35
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +68 -52
- 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 +9 -3
- 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/webviewElement.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +13 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +5 -5
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +1 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +1 -1
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.d.ts +2 -2
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +31 -22
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +9 -9
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +10 -8
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.d.ts +0 -1
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +8 -15
- 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(15612, "Whether a type hierarchy provider is available"))));
|
|
26
|
+
const _ctxTypeHierarchyVisible = ( new RawContextKey("typeHierarchyVisible", false, ( localize(15613, "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(15614, "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(15615, "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(15616, "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(15617, "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(15618, "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(15619, "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(15620, "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(15621, "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(15622, "Supertypes of '{0}'", element.model.root.name)) : ( localize(15623, "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(15624, "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(15625, "No supertypes of '{0}'", model.root.name)) : ( localize(15626, "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(15627, "Type Hierarchy");
|
|
127
127
|
}
|
|
128
128
|
getAriaLabel(element) {
|
|
129
129
|
if (this.getDirection() === TypeHierarchyDirection.Supertypes) {
|
|
130
|
-
return localize(
|
|
130
|
+
return localize(15628, "supertypes of {0}", element.item.name);
|
|
131
131
|
} else {
|
|
132
|
-
return localize(
|
|
132
|
+
return localize(15629, "subtypes of {0}", element.item.name);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -118,6 +118,8 @@ export declare class WebviewElement extends Disposable implements IWebviewElemen
|
|
|
118
118
|
private doUpdateContent;
|
|
119
119
|
protected style(): void;
|
|
120
120
|
protected handleFocusChange(isFocused: boolean): void;
|
|
121
|
+
private shouldForwardKeyEvent;
|
|
122
|
+
private isActiveElement;
|
|
121
123
|
private handleKeyEvent;
|
|
122
124
|
private handleDragEvent;
|
|
123
125
|
windowDidDragStart(): void;
|
|
@@ -174,6 +174,9 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
174
174
|
uri
|
|
175
175
|
}
|
|
176
176
|
) => {
|
|
177
|
+
if (!this.isActiveElement()) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
177
180
|
this._onDidClickLink.fire(uri);
|
|
178
181
|
}));
|
|
179
182
|
this._register(this.on("onmessage", (
|
|
@@ -220,7 +223,7 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
220
223
|
this._hasFindResult.fire(didFind);
|
|
221
224
|
}));
|
|
222
225
|
this._register(this.on("fatal-error", e => {
|
|
223
|
-
notificationService.error(( localize(
|
|
226
|
+
notificationService.error(( localize(15986, "Error loading webview: {0}", e.message)));
|
|
224
227
|
this._onFatalError.fire({
|
|
225
228
|
message: e.message
|
|
226
229
|
});
|
|
@@ -643,7 +646,16 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
643
646
|
this._onDidBlur.fire();
|
|
644
647
|
}
|
|
645
648
|
}
|
|
649
|
+
shouldForwardKeyEvent(event) {
|
|
650
|
+
return event.isTrusted || !!this._content.options.forwardUntrustedKeypressEvents;
|
|
651
|
+
}
|
|
652
|
+
isActiveElement() {
|
|
653
|
+
return !!this.element && this.window?.document.activeElement === this.element;
|
|
654
|
+
}
|
|
646
655
|
handleKeyEvent(type, event) {
|
|
656
|
+
if (!this.shouldForwardKeyEvent(event) || !this.isActiveElement()) {
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
647
659
|
const emulatedKeyboardEvent = ( new KeyboardEvent(type, event));
|
|
648
660
|
Object.defineProperty(emulatedKeyboardEvent, "target", {
|
|
649
661
|
get: () => this.element
|
|
@@ -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(16017, "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(16018, "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(16019, "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(16020, "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(16021, "Reload Webviews"));
|
|
122
122
|
}
|
|
123
123
|
constructor() {
|
|
124
124
|
super({
|
package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js
CHANGED
|
@@ -126,6 +126,7 @@ function restoreWebviewOptions(options) {
|
|
|
126
126
|
function restoreWebviewContentOptions(options) {
|
|
127
127
|
return {
|
|
128
128
|
...options,
|
|
129
|
+
forwardUntrustedKeypressEvents: options.forwardUntrustedKeypressEvents ?? true,
|
|
129
130
|
localResourceRoots: options.localResourceRoots?.map(uri => reviveUri(uri))
|
|
130
131
|
};
|
|
131
132
|
}
|
|
@@ -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(16023, "webview editor"))),
|
|
23
23
|
[( new SyncDescriptor(WebviewInput))]
|
|
24
24
|
);
|
|
25
25
|
let WebviewPanelContribution = class WebviewPanelContribution extends Disposable {
|
|
@@ -10,7 +10,7 @@ import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
10
10
|
import { IUntypedEditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
11
11
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
12
12
|
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
13
|
-
import { EditorAssociations, EditorInputFactoryObject, RegisteredEditorInfo, RegisteredEditorOptions, ResolvedEditor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorResolverService";
|
|
13
|
+
import { EditorAssociations, EditorInputFactoryObject, RegisteredEditorInfo, RegisteredEditorOptions, RegisteredEditorRegistrationInfo, ResolvedEditor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorResolverService";
|
|
14
14
|
import { IEditorResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorResolverService.service";
|
|
15
15
|
import { PreferredGroup } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService";
|
|
16
16
|
export declare class EditorResolverService extends Disposable implements IEditorResolverService {
|
|
@@ -37,7 +37,7 @@ export declare class EditorResolverService extends Disposable implements IEditor
|
|
|
37
37
|
resolveEditor(editor: IUntypedEditorInput, preferredGroup: PreferredGroup | undefined): Promise<ResolvedEditor>;
|
|
38
38
|
private doResolveSideBySideEditor;
|
|
39
39
|
bufferChangeEvents(callback: Function): void;
|
|
40
|
-
registerEditor(globPattern: string | glob.IRelativePattern, editorInfo:
|
|
40
|
+
registerEditor(globPattern: string | glob.IRelativePattern, editorInfo: RegisteredEditorRegistrationInfo, options: RegisteredEditorOptions, editorFactoryObject: EditorInputFactoryObject): IDisposable;
|
|
41
41
|
getAssociationsForResource(resource: URI): EditorAssociations;
|
|
42
42
|
private getAssociationsForResourceByType;
|
|
43
43
|
private getAssociationsForResourceFromSetting;
|
|
@@ -23,10 +23,18 @@ import { SideBySideEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/wo
|
|
|
23
23
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
24
24
|
import { findGroup } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupFinder';
|
|
25
25
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
26
|
-
import { ResolvedStatus, editorsAssociationsSettingId, diffEditorsAssociationsSettingId, globMatchesResource, RegisteredEditorPriority, priorityToRank } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
26
|
+
import { toRegisteredEditorPriorityInfo, ResolvedStatus, editorsAssociationsSettingId, diffEditorsAssociationsSettingId, globMatchesResource, RegisteredEditorPriority, priorityToRank } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
27
27
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
28
28
|
|
|
29
29
|
var EditorResolverService_1;
|
|
30
|
+
function normalizeRegisteredEditorInfo(editorInfo) {
|
|
31
|
+
return {
|
|
32
|
+
id: editorInfo.id,
|
|
33
|
+
label: editorInfo.label,
|
|
34
|
+
detail: editorInfo.detail,
|
|
35
|
+
priority: toRegisteredEditorPriorityInfo(editorInfo.priority)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
30
38
|
var EditorAssociationType;
|
|
31
39
|
(function(EditorAssociationType) {
|
|
32
40
|
EditorAssociationType[EditorAssociationType["Editor"] = 0] = "Editor";
|
|
@@ -234,22 +242,23 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
234
242
|
}
|
|
235
243
|
}
|
|
236
244
|
registerEditor(globPattern, editorInfo, options, editorFactoryObject) {
|
|
245
|
+
const registeredEditorInfo = normalizeRegisteredEditorInfo(editorInfo);
|
|
237
246
|
let registeredEditor = this._editors.get(globPattern);
|
|
238
247
|
if (registeredEditor === undefined) {
|
|
239
248
|
registeredEditor = ( new Map());
|
|
240
249
|
this._editors.set(globPattern, registeredEditor);
|
|
241
250
|
}
|
|
242
|
-
let editorsWithId = registeredEditor.get(
|
|
251
|
+
let editorsWithId = registeredEditor.get(registeredEditorInfo.id);
|
|
243
252
|
if (editorsWithId === undefined) {
|
|
244
253
|
editorsWithId = [];
|
|
245
254
|
}
|
|
246
255
|
const remove = insert(editorsWithId, {
|
|
247
256
|
globPattern,
|
|
248
|
-
editorInfo,
|
|
257
|
+
editorInfo: registeredEditorInfo,
|
|
249
258
|
options,
|
|
250
259
|
editorFactoryObject
|
|
251
260
|
});
|
|
252
|
-
registeredEditor.set(
|
|
261
|
+
registeredEditor.set(registeredEditorInfo.id, editorsWithId);
|
|
253
262
|
this._shouldReFlattenEditors = true;
|
|
254
263
|
this._onDidChangeEditorRegistrations.fire();
|
|
255
264
|
return toDisposable(() => {
|
|
@@ -400,7 +409,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
400
409
|
continue;
|
|
401
410
|
}
|
|
402
411
|
const foundInSettings = userSettings.find(setting => setting.viewType === editor.editorInfo.id);
|
|
403
|
-
if ((foundInSettings && editor.editorInfo
|
|
412
|
+
if ((foundInSettings && this.getEffectivePriority(editor.editorInfo, associationType) !== RegisteredEditorPriority.exclusive) || globMatchesResource(key, resource)) {
|
|
404
413
|
matchingEditors.push(editor);
|
|
405
414
|
}
|
|
406
415
|
}
|
|
@@ -418,7 +427,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
418
427
|
this._flattenedEditors = this._flattenEditorsMap();
|
|
419
428
|
if (URI.isUri(resource)) {
|
|
420
429
|
const editors = this.findMatchingEditors(resource);
|
|
421
|
-
if (editors.find(e => e.editorInfo.priority === RegisteredEditorPriority.exclusive)) {
|
|
430
|
+
if (editors.find(e => e.editorInfo.priority.editor === RegisteredEditorPriority.exclusive)) {
|
|
422
431
|
return [];
|
|
423
432
|
}
|
|
424
433
|
return ( editors.map(editor => editor.editorInfo));
|
|
@@ -479,11 +488,11 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
479
488
|
getEffectivePriority(editorInfo, associationType) {
|
|
480
489
|
switch (associationType) {
|
|
481
490
|
case EditorAssociationType.DiffEditor:
|
|
482
|
-
return editorInfo.
|
|
491
|
+
return editorInfo.priority.diff;
|
|
483
492
|
case EditorAssociationType.MergeEditor:
|
|
484
|
-
return editorInfo.
|
|
493
|
+
return editorInfo.priority.merge;
|
|
485
494
|
default:
|
|
486
|
-
return editorInfo.priority;
|
|
495
|
+
return editorInfo.priority.editor;
|
|
487
496
|
}
|
|
488
497
|
}
|
|
489
498
|
async doResolveEditor(editor, group, selectedEditor) {
|
|
@@ -627,8 +636,8 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
627
636
|
if (storedChoices[globForResource]?.find(editorID => editorID === currentEditor.editorId)) {
|
|
628
637
|
return;
|
|
629
638
|
}
|
|
630
|
-
const handle = this.notificationService.prompt(Severity.Warning, ( localize(
|
|
631
|
-
label: ( localize(
|
|
639
|
+
const handle = this.notificationService.prompt(Severity.Warning, ( localize(16865, "There are multiple default editors available for the resource.")), [{
|
|
640
|
+
label: ( localize(16866, "Configure Default")),
|
|
632
641
|
run: async () => {
|
|
633
642
|
const picked = await this.doPickEditor(untypedInput, true);
|
|
634
643
|
if (!picked) {
|
|
@@ -646,7 +655,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
646
655
|
}]);
|
|
647
656
|
}
|
|
648
657
|
}, {
|
|
649
|
-
label: ( localize(
|
|
658
|
+
label: ( localize(16867, "Keep {0}", editorName)),
|
|
650
659
|
run: writeCurrentEditorsToStorage
|
|
651
660
|
}]);
|
|
652
661
|
const onCloseListener = handle.onDidClose(() => {
|
|
@@ -656,7 +665,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
656
665
|
}
|
|
657
666
|
mapEditorsToQuickPickEntry(resource, showDefaultPicker, associationType) {
|
|
658
667
|
const currentEditor = this.editorGroupService.activeGroup.findEditors(resource).at(0);
|
|
659
|
-
let registeredEditors = resource.scheme === Schemas.untitled ? this._registeredEditors.filter(e => e.editorInfo.priority !== RegisteredEditorPriority.exclusive) : this.findMatchingEditors(resource, associationType);
|
|
668
|
+
let registeredEditors = resource.scheme === Schemas.untitled ? this._registeredEditors.filter(e => e.editorInfo.priority.editor !== RegisteredEditorPriority.exclusive) : this.findMatchingEditors(resource, associationType);
|
|
660
669
|
if (associationType === EditorAssociationType.DiffEditor) {
|
|
661
670
|
registeredEditors = registeredEditors.filter(editor => !!editor.editorFactoryObject.createDiffEditorInput);
|
|
662
671
|
}
|
|
@@ -668,15 +677,15 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
668
677
|
} else if (b.editorInfo.id === DEFAULT_EDITOR_ASSOCIATION.id) {
|
|
669
678
|
return 1;
|
|
670
679
|
} else {
|
|
671
|
-
return priorityToRank(b.editorInfo
|
|
680
|
+
return priorityToRank(this.getEffectivePriority(b.editorInfo, associationType)) - priorityToRank(this.getEffectivePriority(a.editorInfo, associationType));
|
|
672
681
|
}
|
|
673
682
|
});
|
|
674
683
|
const quickPickEntries = [];
|
|
675
|
-
const currentlyActiveLabel = ( localize(
|
|
676
|
-
const currentDefaultLabel = ( localize(
|
|
677
|
-
const currentDefaultAndActiveLabel = ( localize(
|
|
684
|
+
const currentlyActiveLabel = ( localize(16868, "Active"));
|
|
685
|
+
const currentDefaultLabel = ( localize(16869, "Default"));
|
|
686
|
+
const currentDefaultAndActiveLabel = ( localize(16870, "Active and Default"));
|
|
678
687
|
let defaultViewType = defaultSetting;
|
|
679
|
-
if (!defaultViewType && registeredEditors.length > 2 && registeredEditors[1]
|
|
688
|
+
if (!defaultViewType && registeredEditors.length > 2 && this.getEffectivePriority(registeredEditors[1].editorInfo, associationType) !== RegisteredEditorPriority.option) {
|
|
680
689
|
defaultViewType = registeredEditors[1]?.editorInfo.id;
|
|
681
690
|
}
|
|
682
691
|
if (!defaultViewType) {
|
|
@@ -690,7 +699,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
690
699
|
id: editor.editorInfo.id,
|
|
691
700
|
label: editor.editorInfo.label,
|
|
692
701
|
description: isActive && isDefault ? currentDefaultAndActiveLabel : isActive ? currentlyActiveLabel : isDefault ? currentDefaultLabel : undefined,
|
|
693
|
-
detail: editor.editorInfo.detail ?? editor.editorInfo.priority
|
|
702
|
+
detail: editor.editorInfo.detail ?? editor.editorInfo.priority.editor
|
|
694
703
|
};
|
|
695
704
|
quickPickEntries.push(quickPickEntry);
|
|
696
705
|
});
|
|
@@ -701,7 +710,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
701
710
|
quickPickEntries.push(separator);
|
|
702
711
|
const configureDefaultEntry = {
|
|
703
712
|
id: EditorResolverService_1.configureDefaultID,
|
|
704
|
-
label: ( localize(
|
|
713
|
+
label: ( localize(16871, "Configure default editor for '{0}'...", `*${extname(resource)}`))
|
|
705
714
|
};
|
|
706
715
|
quickPickEntries.push(configureDefaultEntry);
|
|
707
716
|
}
|
|
@@ -722,7 +731,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
722
731
|
const editorPicker = disposables.add(this.quickInputService.createQuickPick({
|
|
723
732
|
useSeparators: true
|
|
724
733
|
}));
|
|
725
|
-
const placeHolderMessage = showDefaultPicker ? ( localize(
|
|
734
|
+
const placeHolderMessage = showDefaultPicker ? ( localize(16872, "Select new default editor for '{0}'", `*${extname(resource)}`)) : ( localize(16873, "Select editor for '{0}'", basename(resource)));
|
|
726
735
|
editorPicker.placeholder = placeHolderMessage;
|
|
727
736
|
editorPicker.canAcceptInBackground = true;
|
|
728
737
|
editorPicker.items = editorPicks;
|
|
@@ -778,7 +787,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
778
787
|
const cacheStorage = ( new Set());
|
|
779
788
|
for (const [globPattern, contribPoint] of this._flattenedEditors) {
|
|
780
789
|
const nonOptional = !!contribPoint.find(
|
|
781
|
-
c => c.editorInfo.priority !== RegisteredEditorPriority.option && c.editorInfo.id !== DEFAULT_EDITOR_ASSOCIATION.id
|
|
790
|
+
c => c.editorInfo.priority.editor !== RegisteredEditorPriority.option && c.editorInfo.id !== DEFAULT_EDITOR_ASSOCIATION.id
|
|
782
791
|
);
|
|
783
792
|
if (!nonOptional) {
|
|
784
793
|
continue;
|
|
@@ -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(17088, "Whether it is possible to navigate back in editor history")))).bindTo(this.contextKeyService);
|
|
105
|
+
this.canNavigateForwardContextKey = ( new RawContextKey("canNavigateForward", false, ( localize(17089, "Whether it is possible to navigate forward in editor history")))).bindTo(this.contextKeyService);
|
|
106
106
|
this.canNavigateBackInNavigationsContextKey = ( new RawContextKey("canNavigateBackInNavigationLocations", false, ( localize(
|
|
107
|
-
|
|
107
|
+
17090,
|
|
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
|
+
17091,
|
|
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
|
+
17092,
|
|
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
|
+
17093,
|
|
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
|
+
17094,
|
|
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
|
+
17095,
|
|
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(17096, "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();
|
|
@@ -157,7 +157,9 @@ let ProgressService = class ProgressService extends Disposable {
|
|
|
157
157
|
this.updateWindowProgress();
|
|
158
158
|
Promise.all([timeout(150), promise]).finally(() => {
|
|
159
159
|
const idx = this.windowProgressStack.indexOf(task);
|
|
160
|
-
|
|
160
|
+
if (idx !== -1) {
|
|
161
|
+
this.windowProgressStack.splice(idx, 1);
|
|
162
|
+
}
|
|
161
163
|
this.updateWindowProgress();
|
|
162
164
|
});
|
|
163
165
|
}, 150);
|
|
@@ -173,20 +175,20 @@ let ProgressService = class ProgressService extends Disposable {
|
|
|
173
175
|
let title;
|
|
174
176
|
const source = options.source && typeof options.source !== "string" ? options.source.label : options.source;
|
|
175
177
|
if (progressTitle && progressMessage) {
|
|
176
|
-
text = ( localize(
|
|
177
|
-
title = source ? ( localize(
|
|
178
|
+
text = ( localize(17225, "{0}: {1}", progressTitle, progressMessage));
|
|
179
|
+
title = source ? ( localize(17226, "[{0}] {1}: {2}", source, progressTitle, progressMessage)) : text;
|
|
178
180
|
} else if (progressTitle) {
|
|
179
181
|
text = progressTitle;
|
|
180
|
-
title = source ? ( localize(
|
|
182
|
+
title = source ? ( localize(17227, "[{0}]: {1}", source, progressTitle)) : text;
|
|
181
183
|
} else if (progressMessage) {
|
|
182
184
|
text = progressMessage;
|
|
183
|
-
title = source ? ( localize(
|
|
185
|
+
title = source ? ( localize(17227, "[{0}]: {1}", source, progressMessage)) : text;
|
|
184
186
|
} else {
|
|
185
187
|
this.updateWindowProgress(idx + 1);
|
|
186
188
|
return;
|
|
187
189
|
}
|
|
188
190
|
const statusEntryProperties = {
|
|
189
|
-
name: ( localize(
|
|
191
|
+
name: ( localize(17228, "Progress Message")),
|
|
190
192
|
text,
|
|
191
193
|
showProgress: options.type || true,
|
|
192
194
|
ariaLabel: text,
|
|
@@ -292,7 +294,7 @@ let ProgressService = class ProgressService extends Disposable {
|
|
|
292
294
|
constructor() {
|
|
293
295
|
super(
|
|
294
296
|
"progress.cancel",
|
|
295
|
-
typeof options.cancellable === "string" ? options.cancellable : ( localize(
|
|
297
|
+
typeof options.cancellable === "string" ? options.cancellable : ( localize(17229, "Cancel")),
|
|
296
298
|
undefined,
|
|
297
299
|
true
|
|
298
300
|
);
|
|
@@ -484,7 +486,7 @@ let ProgressService = class ProgressService extends Disposable {
|
|
|
484
486
|
const buttons = options.buttons || [];
|
|
485
487
|
if (!options.sticky) {
|
|
486
488
|
buttons.push(
|
|
487
|
-
options.cancellable ? (typeof options.cancellable === "boolean" ? ( localize(
|
|
489
|
+
options.cancellable ? (typeof options.cancellable === "boolean" ? ( localize(17229, "Cancel")) : options.cancellable) : ( localize(17230, "Dismiss"))
|
|
488
490
|
);
|
|
489
491
|
}
|
|
490
492
|
dialog = ( new Dialog(
|
|
@@ -78,7 +78,6 @@ export declare class ViewDescriptorService extends Disposable implements IViewDe
|
|
|
78
78
|
getViewContainerByViewId(viewId: string): ViewContainer | null;
|
|
79
79
|
getViewContainerLocation(viewContainer: ViewContainer): ViewContainerLocation;
|
|
80
80
|
getDefaultViewContainerLocation(viewContainer: ViewContainer): ViewContainerLocation;
|
|
81
|
-
private getEffectiveViewContainerLocation;
|
|
82
81
|
getDefaultContainerById(viewId: string): ViewContainer | null;
|
|
83
82
|
getViewContainerModel(container: ViewContainer): ViewContainerModel;
|
|
84
83
|
getViewContainerById(id: string): ViewContainer | null;
|
|
@@ -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,
|
|
3
|
+
import { VIEWS_LOG_ID, VIEWS_LOG_NAME, Extensions, WindowEnablement, ViewContainerLocation, 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';
|
|
@@ -290,17 +290,10 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
290
290
|
return containerId ? this.getViewContainerById(containerId) : this.getDefaultContainerById(viewId);
|
|
291
291
|
}
|
|
292
292
|
getViewContainerLocation(viewContainer) {
|
|
293
|
-
|
|
294
|
-
return this.getEffectiveViewContainerLocation(location);
|
|
293
|
+
return this.viewContainersCustomLocations.get(viewContainer.id) ?? this.getDefaultViewContainerLocation(viewContainer);
|
|
295
294
|
}
|
|
296
295
|
getDefaultViewContainerLocation(viewContainer) {
|
|
297
|
-
return this.
|
|
298
|
-
}
|
|
299
|
-
getEffectiveViewContainerLocation(location) {
|
|
300
|
-
if (!this.isSessionsWindow && location === ViewContainerLocation.ChatBar) {
|
|
301
|
-
return ViewContainerLocation.AuxiliaryBar;
|
|
302
|
-
}
|
|
303
|
-
return location;
|
|
296
|
+
return this.viewContainersRegistry.getViewContainerLocation(viewContainer);
|
|
304
297
|
}
|
|
305
298
|
getDefaultContainerById(viewId) {
|
|
306
299
|
return this.viewsRegistry.getViewContainer(viewId) ?? null;
|
|
@@ -507,7 +500,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
507
500
|
mergeViewWithContainerWhenSingleView: true
|
|
508
501
|
}])),
|
|
509
502
|
title: {
|
|
510
|
-
value: ( localize(
|
|
503
|
+
value: ( localize(17607, "User View Container")),
|
|
511
504
|
original: "User View Container"
|
|
512
505
|
},
|
|
513
506
|
icon: location === ViewContainerLocation.Sidebar ? defaultViewIcon : undefined,
|
|
@@ -820,7 +813,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
820
813
|
title: viewDescriptor.name,
|
|
821
814
|
metadata: {
|
|
822
815
|
description: ( localize2(
|
|
823
|
-
|
|
816
|
+
17608,
|
|
824
817
|
"Toggles the visibility of the {0} view if the view container it is located in is visible",
|
|
825
818
|
viewDescriptor.name.value
|
|
826
819
|
))
|
|
@@ -851,10 +844,10 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
851
844
|
super({
|
|
852
845
|
id: `${viewDescriptor.id}.removeView`,
|
|
853
846
|
viewPaneContainerId: viewContainerModel.viewContainer.id,
|
|
854
|
-
title: ( localize(
|
|
847
|
+
title: ( localize(17609, "Hide '{0}'", viewDescriptor.name.value)),
|
|
855
848
|
metadata: {
|
|
856
849
|
description: ( localize2(
|
|
857
|
-
|
|
850
|
+
17610,
|
|
858
851
|
"Hides the {0} view if it is visible and the view container it is located in is visible",
|
|
859
852
|
viewDescriptor.name.value
|
|
860
853
|
))
|
|
@@ -884,7 +877,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
884
877
|
constructor() {
|
|
885
878
|
super({
|
|
886
879
|
id: `${viewContainer.id}.resetViewContainerLocation`,
|
|
887
|
-
title: ( localize2(
|
|
880
|
+
title: ( localize2(17611, "Reset Location")),
|
|
888
881
|
menu: [{
|
|
889
882
|
id: MenuId.ViewContainerTitleContext,
|
|
890
883
|
group: "1_viewActions",
|