@codingame/monaco-vscode-workbench-service-override 2.2.1 → 3.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.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  export { default } from './workbench.js';
2
2
  export { IView, SplitView } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
3
3
  export { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
4
- export { CustomViewOption, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
4
+ export { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
5
+ export { CustomViewOption, EditorPane, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
5
6
  export { IViewContainerDescriptor, IViewDescriptor, ViewContainer, ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
6
7
  export { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
7
8
  export { EditorInput, IEditorCloseHandler } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
8
9
  export { ConfirmResult } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
9
10
  export { EditorInputFactoryObject, RegisteredEditorInfo, RegisteredEditorOptions, RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
10
- export { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
11
11
  export { AbstractResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/resourceEditorInput';
12
12
  export { AbstractTextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
13
13
  export { EditorInputCapabilities, IEditorSerializer } from 'vscode/vscode/vs/workbench/common/editor';
package/index.js CHANGED
@@ -2,12 +2,12 @@ export { default } from './workbench.js';
2
2
  export { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
3
3
  export { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
4
4
  export { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
5
- export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
5
+ export { EditorPane, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
6
6
  export { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
7
7
  export { ConfirmResult } from './override/vs/platform/dialogs/common/dialogs.js';
8
- export { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
9
8
  export { AbstractResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/resourceEditorInput';
10
9
  export { AbstractTextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
11
10
  export { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
12
11
  export { EditorInputCapabilities } from 'vscode/vscode/vs/workbench/common/editor';
13
12
  export { SplitView } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
13
+ export { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-workbench-service-override",
3
- "version": "2.2.1",
3
+ "version": "3.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,19 +18,19 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@2.2.1",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@3.0.0",
22
22
  "vscode-marked": "npm:marked@=3.0.2",
23
- "@codingame/monaco-vscode-keybindings-service-override": "2.2.1",
24
- "@codingame/monaco-vscode-quickaccess-service-override": "2.2.1",
25
- "@codingame/monaco-vscode-bulk-edit-service-override": "2.2.1",
26
- "@codingame/monaco-vscode-view-title-bar-service-override": "2.2.1",
27
- "@codingame/monaco-vscode-view-status-bar-service-override": "2.2.1",
28
- "@codingame/monaco-vscode-view-banner-service-override": "2.2.1",
29
- "@codingame/monaco-vscode-files-service-override": "2.2.1",
30
- "@codingame/monaco-vscode-extensions-service-override": "2.2.1",
31
- "@codingame/monaco-vscode-environment-service-override": "2.2.1",
32
- "@codingame/monaco-vscode-layout-service-override": "2.2.1",
33
- "@codingame/monaco-vscode-host-service-override": "2.2.1",
34
- "@codingame/monaco-vscode-base-service-override": "2.2.1"
23
+ "@codingame/monaco-vscode-keybindings-service-override": "3.0.0",
24
+ "@codingame/monaco-vscode-quickaccess-service-override": "3.0.0",
25
+ "@codingame/monaco-vscode-bulk-edit-service-override": "3.0.0",
26
+ "@codingame/monaco-vscode-view-title-bar-service-override": "3.0.0",
27
+ "@codingame/monaco-vscode-view-status-bar-service-override": "3.0.0",
28
+ "@codingame/monaco-vscode-view-banner-service-override": "3.0.0",
29
+ "@codingame/monaco-vscode-files-service-override": "3.0.0",
30
+ "@codingame/monaco-vscode-extensions-service-override": "3.0.0",
31
+ "@codingame/monaco-vscode-environment-service-override": "3.0.0",
32
+ "@codingame/monaco-vscode-layout-service-override": "3.0.0",
33
+ "@codingame/monaco-vscode-host-service-override": "3.0.0",
34
+ "@codingame/monaco-vscode-base-service-override": "3.0.0"
35
35
  }
36
36
  }
package/tools/views.d.ts CHANGED
@@ -4,11 +4,10 @@ import { BrandedService, ServicesAccessor } from 'vscode/vscode/vs/platform/inst
4
4
  import { IDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
5
  import { Dimension } from 'vscode/vscode/vs/base/browser/dom';
6
6
  import { Event } from 'vscode/vscode/vs/base/common/event';
7
+ import { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
8
+ export { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
7
9
  import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
8
10
  import { URI } from 'vscode/vscode/vs/base/common/uri';
9
- import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
10
- import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
11
- import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
12
11
  import { IEditorOptions } from 'vscode/vscode/vs/platform/editor/common/editor';
13
12
  import { Parts, Position } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
14
13
  export { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
@@ -20,19 +19,20 @@ export { EditorInput, IEditorCloseHandler } from 'vscode/vscode/vs/workbench/com
20
19
  import { IEditorOpenContext, EditorInputCapabilities, Verbosity, IEditorSerializer } from 'vscode/vscode/vs/workbench/common/editor';
21
20
  export { EditorInputCapabilities, IEditorSerializer } from 'vscode/vscode/vs/workbench/common/editor';
22
21
  import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
23
- export { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
24
22
 
25
23
  type Label = string | {
26
24
  short: string;
27
25
  medium: string;
28
26
  long: string;
29
27
  };
30
- declare abstract class SimpleEditorPane extends EditorPane {
28
+ declare abstract class InjectedEditorPane extends EditorPane {
29
+ constructor(id: string);
30
+ }
31
+ declare abstract class SimpleEditorPane extends InjectedEditorPane {
31
32
  protected container: HTMLElement;
32
33
  protected wrapper: HTMLElement;
33
- private scrollbar;
34
+ protected scrollbar: DomScrollableElement | undefined;
34
35
  private inputDisposable;
35
- constructor(id: string, telemetryService: ITelemetryService, themeService: IThemeService, storageService: IStorageService);
36
36
  protected createEditor(parent: HTMLElement): void;
37
37
  setInput(input: EditorInput, editorOptions: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void>;
38
38
  layout(dimension: Dimension): void;
@@ -73,7 +73,7 @@ interface CustomViewOption {
73
73
  readonly id: string;
74
74
  name: string;
75
75
  order?: number;
76
- renderBody(container: HTMLElement): IDisposable;
76
+ renderBody(container: HTMLElement, scrollbar: DomScrollableElement): IDisposable;
77
77
  location: ViewContainerLocation;
78
78
  icon?: string;
79
79
  canMoveView?: boolean;
@@ -102,4 +102,4 @@ declare function getPanelPosition(): Position;
102
102
  declare const onDidChangeSideBarPosition: Event<string>;
103
103
  declare function getSideBarPosition(): Position;
104
104
 
105
- export { type CustomViewOption, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry };
105
+ export { type CustomViewOption, InjectedEditorPane as EditorPane, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry };
package/tools/views.js CHANGED
@@ -1,4 +1,3 @@
1
- import { __decorate, __param } from '../external/tslib/tslib.es6.js';
2
1
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
3
2
  import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
4
3
  export { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
@@ -22,11 +21,11 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
22
21
  import { BaseActionViewItem } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionViewItems';
23
22
  import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
24
23
  import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
25
- export { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
26
24
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
27
25
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
28
26
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
29
27
  import { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
28
+ export { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
30
29
  import { assertIsDefined, assertAllDefined } from 'vscode/vscode/vs/base/common/types';
31
30
  export { ConfirmResult } from '../override/vs/platform/dialogs/common/dialogs.js';
32
31
  import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
@@ -34,9 +33,14 @@ export { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layout
34
33
  import { StandaloneServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
35
34
  import { withReadyServices } from 'vscode/services';
36
35
 
37
- let SimpleEditorPane = class SimpleEditorPane extends EditorPane {
38
- constructor(id, telemetryService, themeService, storageService) {
39
- super(id, telemetryService, themeService, storageService);
36
+ class InjectedEditorPane extends EditorPane {
37
+ constructor(id) {
38
+ super(id, StandaloneServices.get(ITelemetryService), StandaloneServices.get(IThemeService), StandaloneServices.get(IStorageService));
39
+ }
40
+ }
41
+ class SimpleEditorPane extends InjectedEditorPane {
42
+ constructor() {
43
+ super(...arguments);
40
44
  this.inputDisposable = this._register(new MutableDisposable());
41
45
  }
42
46
  createEditor(parent) {
@@ -76,12 +80,7 @@ let SimpleEditorPane = class SimpleEditorPane extends EditorPane {
76
80
  this.inputDisposable.clear();
77
81
  super.clearInput();
78
82
  }
79
- };
80
- SimpleEditorPane = __decorate([
81
- ( __param(1, ITelemetryService)),
82
- ( __param(2, IThemeService)),
83
- ( __param(3, IStorageService))
84
- ], SimpleEditorPane);
83
+ }
85
84
  class SimpleEditorInput extends EditorInput {
86
85
  constructor(resource, closeHandler) {
87
86
  super();
@@ -182,13 +181,13 @@ function registerCustomView(options) {
182
181
  ctorDescriptor: new SyncDescriptor(class extends ViewPane {
183
182
  renderBody(container) {
184
183
  super.renderBody(container);
184
+ this.wrapper = document.createElement('div');
185
+ this.scrollbar = this._register(new DomScrollableElement(this.wrapper, { horizontal: 1 , vertical: 1 }));
185
186
  this.container = $('.view-pane-content');
186
187
  this.container.style.display = 'flex';
187
188
  this.container.style.alignItems = 'stretch';
188
- this._register(options.renderBody(this.container));
189
- this.wrapper = document.createElement('div');
189
+ this._register(options.renderBody(this.container, this.scrollbar));
190
190
  this.wrapper.append(this.container);
191
- this.scrollbar = this._register(new DomScrollableElement(this.wrapper, { horizontal: 1 , vertical: 1 }));
192
191
  container.appendChild(this.scrollbar.getDomNode());
193
192
  const observer = new ResizeObserver(() => {
194
193
  assertIsDefined(this.scrollbar).scanDomNode();
@@ -278,4 +277,4 @@ function getSideBarPosition() {
278
277
  return StandaloneServices.get(IWorkbenchLayoutService).getSideBarPosition();
279
278
  }
280
279
 
281
- export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry };
280
+ export { InjectedEditorPane as EditorPane, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry };
@@ -3,11 +3,11 @@ import { Emitter } from 'vscode/vscode/vs/base/common/event';
3
3
  import { getClientArea, getActiveDocument, getWindows, getWindow, addDisposableListener, EventType, isActiveDocument, getWindowId, getActiveWindow, getActiveElement, isAncestorUsingFlowTo, focusWindow, position, size, computeScreenAwareSize } from 'vscode/vscode/vs/base/browser/dom';
4
4
  import { onDidChangeFullscreen, isFullscreen, isWCOEnabled } from 'vscode/vscode/vs/base/browser/browser';
5
5
  import { IWorkingCopyBackupService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup';
6
- import { isWindows, isLinux, isWeb, isMacintosh, isNative, isIOS } from 'vscode/vscode/vs/base/common/platform';
6
+ import { isWindows, isLinux, isWeb, isIOS, isMacintosh } from 'vscode/vscode/vs/base/common/platform';
7
7
  import { pathsToEditors, isResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor';
8
8
  import { SidebarPart } from 'vscode/vscode/vs/workbench/browser/parts/sidebar/sidebarPart';
9
9
  import { PanelPart } from 'vscode/vscode/vs/workbench/browser/parts/panel/panelPart';
10
- import { positionFromString, positionToString, panelOpensMaximizedFromString } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
10
+ import { positionFromString, positionToString, shouldShowCustomTitleBar, panelOpensMaximizedFromString } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
11
11
  import { IWorkspaceContextService, isTemporaryWorkspace } from 'vscode/vscode/vs/platform/workspace/common/workspace';
12
12
  import { IStorageService, WillSaveStateReason } from 'vscode/vscode/vs/platform/storage/common/storage';
13
13
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
@@ -53,6 +53,15 @@ var LayoutClasses;
53
53
  LayoutClasses["MAXIMIZED"] = "maximized";
54
54
  LayoutClasses["WINDOW_BORDER"] = "border";
55
55
  })(LayoutClasses || (LayoutClasses = {})));
56
+ const TITLE_BAR_SETTINGS = [
57
+ "workbench.activityBar.location" ,
58
+ "window.commandCenter" ,
59
+ "workbench.editor.editorActionsLocation" ,
60
+ "workbench.layoutControl.enabled" ,
61
+ 'window.menuBarVisibility',
62
+ "window.titleBarStyle" ,
63
+ "window.customTitleBarVisibility" ,
64
+ ];
56
65
  class Layout extends Disposable {
57
66
  get activeContainer() { return this.getContainerFromDocument(getActiveDocument()); }
58
67
  get containers() {
@@ -115,8 +124,8 @@ class Layout extends Disposable {
115
124
  this.parent = parent;
116
125
  this._onDidChangeZenMode = this._register(( new Emitter()));
117
126
  this.onDidChangeZenMode = this._onDidChangeZenMode.event;
118
- this._onDidChangeCenteredLayout = this._register(( new Emitter()));
119
- this.onDidChangeCenteredLayout = this._onDidChangeCenteredLayout.event;
127
+ this._onDidChangeMainEditorCenteredLayout = this._register(( new Emitter()));
128
+ this.onDidChangeMainEditorCenteredLayout = this._onDidChangeMainEditorCenteredLayout.event;
120
129
  this._onDidChangePanelAlignment = this._register(( new Emitter()));
121
130
  this.onDidChangePanelAlignment = this._onDidChangePanelAlignment.event;
122
131
  this._onDidChangeWindowMaximized = this._register(( new Emitter()));
@@ -182,19 +191,13 @@ class Layout extends Disposable {
182
191
  this.editorGroupService.whenRestored.then(() => {
183
192
  this._register(this.mainPartEditorService.onDidVisibleEditorsChange(showEditorIfHidden));
184
193
  this._register(this.editorGroupService.mainPart.onDidActivateGroup(showEditorIfHidden));
185
- this._register(this.mainPartEditorService.onDidActiveEditorChange(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
194
+ this._register(this.mainPartEditorService.onDidActiveEditorChange(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
186
195
  });
187
196
  this._register(this.configurationService.onDidChangeConfiguration((e) => {
188
197
  if (( [
189
- "workbench.activityBar.location" ,
190
- "window.commandCenter" ,
191
- "workbench.editor.editorActionsLocation" ,
192
- "workbench.layoutControl.enabled" ,
198
+ ...TITLE_BAR_SETTINGS,
193
199
  LegacyWorkbenchLayoutSettings.SIDEBAR_POSITION,
194
200
  LegacyWorkbenchLayoutSettings.STATUSBAR_VISIBLE,
195
- 'window.menuBarVisibility',
196
- "window.titleBarStyle" ,
197
- "window.customTitleBarVisibility" ,
198
201
  ].some(setting => e.affectsConfiguration(setting)))) {
199
202
  const activityBarMovedToTop = e.affectsConfiguration("workbench.activityBar.location" ) && this.configurationService.getValue("workbench.activityBar.location" ) === "top" ;
200
203
  const editorActionsMovedToTitlebar = e.affectsConfiguration("workbench.editor.editorActionsLocation" ) && this.configurationService.getValue("workbench.editor.editorActionsLocation" ) === "titleBar" ;
@@ -207,9 +210,9 @@ class Layout extends Disposable {
207
210
  }
208
211
  }));
209
212
  this._register(onDidChangeFullscreen(windowId => this.onFullscreenChanged(windowId)));
210
- this._register(this.editorGroupService.mainPart.onDidAddGroup(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
211
- this._register(this.editorGroupService.mainPart.onDidRemoveGroup(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
212
- this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
213
+ this._register(this.editorGroupService.mainPart.onDidAddGroup(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
214
+ this._register(this.editorGroupService.mainPart.onDidRemoveGroup(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
215
+ this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
213
216
  this._register(addDisposableListener(this.mainContainer, EventType.SCROLL, () => this.mainContainer.scrollTop = 0));
214
217
  const showingCustomMenu = (isWindows || isLinux || isWeb) && !hasNativeTitlebar(this.configurationService);
215
218
  if (showingCustomMenu) {
@@ -234,10 +237,10 @@ class Layout extends Disposable {
234
237
  this.state.runtime.menuBar.toggled = visible;
235
238
  const menuBarVisibility = getMenuBarVisibility(this.configurationService);
236
239
  if (isWeb && menuBarVisibility === 'toggle') {
237
- this.workbenchGrid.setViewVisible(this.titleBarPartView, this.shouldShowTitleBar());
240
+ this.workbenchGrid.setViewVisible(this.titleBarPartView, shouldShowCustomTitleBar(this.configurationService, mainWindow, this.state.runtime.menuBar.toggled));
238
241
  }
239
242
  else if (this.state.runtime.mainWindowFullscreen && (menuBarVisibility === 'toggle' || menuBarVisibility === 'classic')) {
240
- this.workbenchGrid.setViewVisible(this.titleBarPartView, this.shouldShowTitleBar());
243
+ this.workbenchGrid.setViewVisible(this.titleBarPartView, shouldShowCustomTitleBar(this.configurationService, mainWindow, this.state.runtime.menuBar.toggled));
241
244
  }
242
245
  this.handleContainerDidLayout(this.mainContainer, this._mainContainerDimension);
243
246
  }
@@ -269,7 +272,7 @@ class Layout extends Disposable {
269
272
  }
270
273
  this.workbenchGrid.edgeSnapping = this.state.runtime.mainWindowFullscreen;
271
274
  {
272
- this.workbenchGrid.setViewVisible(this.titleBarPartView, this.shouldShowTitleBar());
275
+ this.workbenchGrid.setViewVisible(this.titleBarPartView, shouldShowCustomTitleBar(this.configurationService, mainWindow, this.state.runtime.menuBar.toggled));
273
276
  this.updateWindowsBorder(true);
274
277
  }
275
278
  }
@@ -295,7 +298,7 @@ class Layout extends Disposable {
295
298
  this.updateCustomTitleBarVisibility();
296
299
  this.updateMenubarVisibility(!!skipLayout);
297
300
  this.editorGroupService.whenRestored.then(() => {
298
- this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED), skipLayout);
301
+ this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED), skipLayout);
299
302
  });
300
303
  }
301
304
  setSideBarPosition(position) {
@@ -683,7 +686,7 @@ class Layout extends Disposable {
683
686
  this.stateModel.setRuntimeValue(LayoutStateKeys.ZEN_MODE_ACTIVE, !restoreZenMode);
684
687
  this.toggleZenMode(false, true);
685
688
  }
686
- if (this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED)) {
689
+ if (this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED)) {
687
690
  this.centerMainEditorLayout(true, true);
688
691
  }
689
692
  Promises.settled(layoutReadyPromises).finally(() => {
@@ -796,7 +799,7 @@ class Layout extends Disposable {
796
799
  }
797
800
  switch (part) {
798
801
  case "workbench.parts.titlebar" :
799
- return this.shouldShowTitleBar();
802
+ return shouldShowCustomTitleBar(this.configurationService, mainWindow, this.state.runtime.menuBar.toggled);
800
803
  case "workbench.parts.sidebar" :
801
804
  return !this.stateModel.getRuntimeValue(LayoutStateKeys.SIDEBAR_HIDDEN);
802
805
  case "workbench.parts.panel" :
@@ -813,58 +816,6 @@ class Layout extends Disposable {
813
816
  return false;
814
817
  }
815
818
  }
816
- shouldShowTitleBar() {
817
- const nativeTitleBarEnabled = hasNativeTitlebar(this.configurationService);
818
- const showCustomTitleBar = this.configurationService.getValue("window.customTitleBarVisibility" );
819
- if (showCustomTitleBar === "never" && nativeTitleBarEnabled || showCustomTitleBar === "windowed" && this.state.runtime.mainWindowFullscreen) {
820
- return false;
821
- }
822
- if (!this.isTitleBarEmpty()) {
823
- return true;
824
- }
825
- if (nativeTitleBarEnabled) {
826
- return false;
827
- }
828
- if (isMacintosh && isNative) {
829
- return !this.state.runtime.mainWindowFullscreen;
830
- }
831
- if (isNative && !this.state.runtime.mainWindowFullscreen) {
832
- return true;
833
- }
834
- if (isWCOEnabled() && !this.state.runtime.mainWindowFullscreen) {
835
- return true;
836
- }
837
- switch (getMenuBarVisibility(this.configurationService)) {
838
- case 'classic':
839
- return !this.state.runtime.mainWindowFullscreen || this.state.runtime.menuBar.toggled;
840
- case 'compact':
841
- case 'hidden':
842
- return false;
843
- case 'toggle':
844
- return this.state.runtime.menuBar.toggled;
845
- case 'visible':
846
- return true;
847
- default:
848
- return isWeb ? false : !this.state.runtime.mainWindowFullscreen || this.state.runtime.menuBar.toggled;
849
- }
850
- }
851
- isTitleBarEmpty() {
852
- if (this.configurationService.getValue("window.commandCenter" )) {
853
- return false;
854
- }
855
- if (this.configurationService.getValue("workbench.activityBar.location" ) === "top" ) {
856
- return false;
857
- }
858
- const editorActionsLocation = this.configurationService.getValue("workbench.editor.editorActionsLocation" );
859
- const editorTabsMode = this.configurationService.getValue("workbench.editor.showTabs" );
860
- if (editorActionsLocation === "titleBar" || editorActionsLocation === "default" && editorTabsMode === "none" ) {
861
- return false;
862
- }
863
- if (this.configurationService.getValue("workbench.layoutControl.enabled" )) {
864
- return false;
865
- }
866
- return true;
867
- }
868
819
  shouldShowBannerFirst() {
869
820
  return isWeb && !isWCOEnabled();
870
821
  }
@@ -1109,10 +1060,10 @@ class Layout extends Disposable {
1109
1060
  }
1110
1061
  }
1111
1062
  isMainEditorLayoutCentered() {
1112
- return this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED);
1063
+ return this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED);
1113
1064
  }
1114
1065
  centerMainEditorLayout(active, skipLayout) {
1115
- this.stateModel.setRuntimeValue(LayoutStateKeys.EDITOR_CENTERED, active);
1066
+ this.stateModel.setRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED, active);
1116
1067
  const activeMainEditor = this.mainPartEditorService.activeEditor;
1117
1068
  let isEditorComplex = false;
1118
1069
  if (activeMainEditor instanceof DiffEditorInput) {
@@ -1132,7 +1083,7 @@ class Layout extends Disposable {
1132
1083
  this.layout();
1133
1084
  }
1134
1085
  }
1135
- this._onDidChangeCenteredLayout.fire(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED));
1086
+ this._onDidChangeMainEditorCenteredLayout.fire(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED));
1136
1087
  }
1137
1088
  resizePart(part, sizeChangeWidth, sizeChangeHeight) {
1138
1089
  const sizeChangePxWidth = Math.sign(sizeChangeWidth) * computeScreenAwareSize(getActiveWindow(), Math.abs(sizeChangeWidth));
@@ -1447,13 +1398,13 @@ class Layout extends Disposable {
1447
1398
  return this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_ALIGNMENT);
1448
1399
  }
1449
1400
  updateMenubarVisibility(skipLayout) {
1450
- const shouldShowTitleBar = this.shouldShowTitleBar();
1401
+ const shouldShowTitleBar = shouldShowCustomTitleBar(this.configurationService, mainWindow, this.state.runtime.menuBar.toggled);
1451
1402
  if (!skipLayout && this.workbenchGrid && shouldShowTitleBar !== this.isVisible("workbench.parts.titlebar" , mainWindow)) {
1452
1403
  this.workbenchGrid.setViewVisible(this.titleBarPartView, shouldShowTitleBar);
1453
1404
  }
1454
1405
  }
1455
1406
  updateCustomTitleBarVisibility() {
1456
- const shouldShowTitleBar = this.shouldShowTitleBar();
1407
+ const shouldShowTitleBar = shouldShowCustomTitleBar(this.configurationService, mainWindow, this.state.runtime.menuBar.toggled);
1457
1408
  const titlebarVisible = this.isVisible("workbench.parts.titlebar" );
1458
1409
  if (shouldShowTitleBar !== titlebarVisible) {
1459
1410
  this.workbenchGrid.setViewVisible(this.titleBarPartView, shouldShowTitleBar);
@@ -1572,7 +1523,7 @@ class Layout extends Disposable {
1572
1523
  if (bannerFirst !== shouldBannerBeFirst) {
1573
1524
  this.workbenchGrid.moveView(this.bannerPartView, Sizing.Distribute, this.titleBarPartView, shouldBannerBeFirst ? 0 : 1 );
1574
1525
  }
1575
- this.workbenchGrid.setViewVisible(this.titleBarPartView, this.shouldShowTitleBar());
1526
+ this.workbenchGrid.setViewVisible(this.titleBarPartView, shouldShowCustomTitleBar(this.configurationService, mainWindow, this.state.runtime.menuBar.toggled));
1576
1527
  }
1577
1528
  arrangeEditorNodes(nodes, availableHeight, availableWidth) {
1578
1529
  if (!nodes.sideBar && !nodes.auxiliaryBar) {
@@ -1797,7 +1748,7 @@ class InitializationStateKey extends WorkbenchLayoutStateKey {
1797
1748
  }
1798
1749
  }
1799
1750
  const LayoutStateKeys = {
1800
- EDITOR_CENTERED: ( new RuntimeStateKey(
1751
+ MAIN_EDITOR_CENTERED: ( new RuntimeStateKey(
1801
1752
  'editor.centered',
1802
1753
  1 ,
1803
1754
  1 ,
@@ -2100,4 +2051,4 @@ class LayoutStateModel extends Disposable {
2100
2051
  }
2101
2052
  }
2102
2053
 
2103
- export { Layout };
2054
+ export { Layout, TITLE_BAR_SETTINGS };
@@ -2,7 +2,7 @@ import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
2
  import { addDisposableListener, runWhenWindowIdle } from 'vscode/vscode/vs/base/browser/dom';
3
3
  import { Emitter, setGlobalLeakWarningThreshold, Event } from 'vscode/vscode/vs/base/common/event';
4
4
  import { timeout, RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
5
- import { PixelRatio, isChrome, isFirefox, isSafari } from 'vscode/vscode/vs/base/browser/browser';
5
+ import { isChrome, isFirefox, isSafari } from 'vscode/vscode/vs/base/browser/browser';
6
6
  import { mark } from 'vscode/vscode/vs/base/common/performance';
7
7
  import { onUnexpectedError, setUnexpectedErrorHandler } from 'vscode/vscode/vs/base/common/errors';
8
8
  import { isNative, isMacintosh, isWeb, isWindows, isLinux } from 'vscode/vscode/vs/base/common/platform';
@@ -28,6 +28,9 @@ import { Layout } from './layout.js';
28
28
  import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
29
29
  import '../../../../../override/vs/platform/dialogs/common/dialogs.js';
30
30
  import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
31
+ import { PixelRatio } from 'vscode/vscode/vs/base/browser/pixelRatio';
32
+ import { WorkbenchHoverDelegate } from 'vscode/vscode/vs/platform/hover/browser/hover';
33
+ import { setHoverDelegateFactory } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegate';
31
34
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
32
35
 
33
36
  class Workbench extends Layout {
@@ -89,6 +92,7 @@ class Workbench extends Layout {
89
92
  const hostService = accessor.get(IHostService);
90
93
  const dialogService = accessor.get(IDialogService);
91
94
  const notificationService = accessor.get(INotificationService);
95
+ setHoverDelegateFactory((placement, enableInstantHover) => instantiationService.createInstance(WorkbenchHoverDelegate, placement, enableInstantHover, {}));
92
96
  this.initLayout(accessor);
93
97
  this.registerListeners(lifecycleService, storageService, configurationService, hostService, dialogService);
94
98
  this.renderWorkbench(instantiationService, notificationService, storageService, configurationService);
@@ -169,16 +173,16 @@ class Workbench extends Layout {
169
173
  try {
170
174
  const storedFontInfo = JSON.parse(storedFontInfoRaw);
171
175
  if (Array.isArray(storedFontInfo)) {
172
- FontMeasurements.restoreFontInfo(storedFontInfo);
176
+ FontMeasurements.restoreFontInfo(mainWindow, storedFontInfo);
173
177
  }
174
178
  }
175
179
  catch (err) {
176
180
  }
177
181
  }
178
- FontMeasurements.readFontInfo(BareFontInfo.createFromRawSettings(configurationService.getValue('editor'), PixelRatio.value));
182
+ FontMeasurements.readFontInfo(mainWindow, BareFontInfo.createFromRawSettings(configurationService.getValue('editor'), PixelRatio.getInstance(mainWindow).value));
179
183
  }
180
184
  storeFontInfo(storageService) {
181
- const serializedFontInfo = FontMeasurements.serializeFontInfo();
185
+ const serializedFontInfo = FontMeasurements.serializeFontInfo(mainWindow);
182
186
  if (serializedFontInfo) {
183
187
  storageService.store('editorFontInfo', JSON.stringify(serializedFontInfo), -1 , 1 );
184
188
  }
package/workbench.js CHANGED
@@ -49,6 +49,8 @@ import { BrowserWindow } from 'vscode/vscode/vs/workbench/browser/window';
49
49
  import { detectFullscreen } from 'vscode/vscode/vs/base/browser/dom';
50
50
  import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
51
51
  import { setFullscreen } from 'vscode/vscode/vs/base/browser/browser';
52
+ import { EditorPaneService } from 'vscode/vscode/vs/workbench/services/editor/browser/editorPaneService';
53
+ import { IEditorPaneService } from 'vscode/vscode/vs/workbench/services/editor/common/editorPaneService';
52
54
  import getServiceOverride$3 from '@codingame/monaco-vscode-keybindings-service-override';
53
55
  import getServiceOverride$2 from '@codingame/monaco-vscode-quickaccess-service-override';
54
56
  import getServiceOverride$1 from '@codingame/monaco-vscode-bulk-edit-service-override';
@@ -58,6 +60,7 @@ import getServiceOverride$5 from '@codingame/monaco-vscode-view-status-bar-servi
58
60
  import getServiceOverride$6 from '@codingame/monaco-vscode-view-banner-service-override';
59
61
  import { getWorkbenchContainer } from 'vscode/workbench';
60
62
  import { onLayout, onRenderWorkbench } from 'vscode/lifecycle';
63
+ import { registerAssets } from 'vscode/assets';
61
64
  import 'vscode/vscode/vs/workbench/contrib/files/browser/fileCommands';
62
65
  import 'vscode/vscode/vs/workbench/contrib/files/browser/fileActions.contribution';
63
66
  import 'vscode/vscode/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution';
@@ -77,16 +80,15 @@ import 'vscode/vscode/vs/workbench/contrib/files/browser/files.contribution';
77
80
  import 'vscode/vscode/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution';
78
81
  import 'vscode/vscode/vs/workbench/contrib/sash/browser/sash.contribution';
79
82
  import 'vscode/vscode/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker';
80
- import { registerAssets } from 'vscode/assets';
81
- export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
83
+ export { EditorPane, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
82
84
  export { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
83
85
  export { ConfirmResult } from './override/vs/platform/dialogs/common/dialogs.js';
84
- export { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
85
86
  export { AbstractResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/resourceEditorInput';
86
87
  export { AbstractTextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
87
88
  export { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
88
89
  export { EditorInputCapabilities } from 'vscode/vscode/vs/workbench/common/editor';
89
90
  export { SplitView } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
91
+ export { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
90
92
 
91
93
  let webviewIframeAlternateDomains;
92
94
  registerAssets({
@@ -161,6 +163,7 @@ function getServiceOverride(options, _webviewIframeAlternateDomains) {
161
163
  [( IWebviewWorkbenchService.toString())]: new SyncDescriptor(WebviewEditorService, [], true),
162
164
  [( IProgressService.toString())]: new SyncDescriptor(ProgressService, [], true),
163
165
  [( IAuxiliaryWindowService.toString())]: new SyncDescriptor(BrowserAuxiliaryWindowService, [], true),
166
+ [( IEditorPaneService.toString())]: new SyncDescriptor(EditorPaneService, [], true),
164
167
  ...getServiceOverride$4(),
165
168
  ...getServiceOverride$5(),
166
169
  ...getServiceOverride$6()