@codingame/monaco-vscode-api 1.79.0-next.0 → 1.79.1
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/README.md +7 -5
- package/dist/activity.d.ts +8 -108
- package/dist/api.js +3 -3
- package/dist/colorRegistry.d.ts +2 -2
- package/dist/contextkey.d.ts +2 -2
- package/dist/default-extension.js +23 -0
- package/dist/editor.d.ts +4 -320
- package/dist/editorBrowser.d.ts +327 -10
- package/dist/event.d.ts +1 -1
- package/dist/{extension-tools-d0cfdea1.js → extension-tools-0c4c1ad7.js} +345 -210
- package/dist/extensions.d.ts +3 -4
- package/dist/extensions.d2.ts +1 -1
- package/dist/extensions.js +4 -37
- package/dist/extensionsRegistry.d.ts +1 -1
- package/dist/files.d.ts +2 -2
- package/dist/keybinding.d.ts +1 -1
- package/dist/languageFeatures.d.ts +6 -7
- package/dist/log.d.ts +1 -1
- package/dist/monaco-treemending.js +15 -1
- package/dist/monaco.d.ts +31 -32
- package/dist/monaco.js +62 -6
- package/dist/node_modules/rollup-plugin-styles/dist/runtime/inject-css.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +4 -0
- package/dist/rollup-extension-directory-plugin.js +1 -2
- package/dist/rollup-vsix-plugin.js +1 -2
- package/dist/service-override/configuration.d.ts +2 -2
- package/dist/service-override/editor.d.ts +13 -0
- package/dist/service-override/{modelEditor.js → editor.js} +6 -62
- package/dist/service-override/files.d.ts +5 -5
- package/dist/service-override/files.js +14 -2
- package/dist/service-override/keybindings.js +3 -79
- package/dist/service-override/layout.js +6 -2
- package/dist/service-override/model.d.ts +7 -0
- package/dist/service-override/model.js +10 -0
- package/dist/service-override/quickaccess.d.ts +7 -0
- package/dist/service-override/quickaccess.js +80 -0
- package/dist/service-override/snippets.js +5 -1
- package/dist/service-override/textmate.js +7 -2
- package/dist/service-override/theme.d.ts +1 -1
- package/dist/service-override/tools/editor.js +73 -0
- package/dist/service-override/views.d.ts +63 -201
- package/dist/service-override/views.js +102 -8
- package/dist/services.d.ts +116 -19
- package/dist/vscode/vs/base/browser/ui/centered/centeredViewLayout.js +178 -0
- package/dist/vscode/vs/base/browser/ui/grid/grid.js +452 -0
- package/dist/vscode/vs/base/browser/ui/grid/gridview.css.js +4 -0
- package/dist/vscode/vs/base/browser/ui/grid/gridview.js +999 -0
- package/dist/vscode/vs/base/browser/ui/iconLabel/simpleIconLabel.js +14 -0
- package/dist/vscode/vs/base/browser/ui/menu/menubar.css.js +4 -0
- package/dist/vscode/vs/base/browser/ui/menu/menubar.js +1 -1
- package/dist/vscode/vs/base/browser/ui/splitview/paneview.css.js +4 -0
- package/dist/vscode/vs/base/browser/ui/splitview/paneview.js +1 -1
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
- package/dist/vscode/vs/platform/extensionManagement/common/extensionStorage.js +1 -1
- package/dist/vscode/vs/platform/product/common/product.js +48 -0
- package/dist/vscode/vs/platform/quickinput/browser/quickPickPin.js +94 -0
- package/dist/vscode/vs/platform/terminal/common/terminal.js +3 -0
- package/dist/vscode/vs/platform/update/common/update.js +11 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +1 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadStatusBar.js +68 -0
- package/dist/vscode/vs/workbench/api/common/extHostStatusBar.js +234 -0
- package/dist/vscode/vs/workbench/api/common/extHostTypes.js +6 -1
- package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +20 -17
- package/dist/vscode/vs/workbench/browser/actions/quickAccessActions.js +204 -0
- package/dist/vscode/vs/workbench/browser/dnd.js +27 -2
- package/dist/vscode/vs/workbench/browser/editor.js +94 -0
- package/dist/vscode/vs/workbench/browser/labels.js +23 -2
- package/dist/vscode/vs/workbench/browser/media/part.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/part.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/activitybar/activitybarActions.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/activitybar/activitybarPart.js +3 -3
- package/dist/vscode/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +14 -26
- package/dist/vscode/vs/workbench/browser/parts/compositePart.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/binaryDiffEditor.js +43 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/binaryEditor.js +55 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/breadcrumbs.js +330 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/breadcrumbsControl.js +690 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/breadcrumbsModel.js +142 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +414 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +800 -6
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +56 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorActions.js +1484 -107
- package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +1121 -4
- package/dist/vscode/vs/workbench/browser/parts/editor/editorDropTarget.js +499 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupView.js +1219 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupWatermark.js +137 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPane.js +242 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPanes.js +297 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPart.js +841 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPlaceholder.js +235 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorQuickAccess.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +1152 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorWithViewState.js +139 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorsObserver.js +339 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/editorplaceholder.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/editorquickaccess.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/editorstatus.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/sidebysideeditor.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/media/titlecontrol.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/noTabsTitleControl.js +243 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/sideBySideEditor.js +387 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/tabFocus.js +77 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/tabsTitleControl.js +1504 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/textCodeEditor.js +79 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +304 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/textEditor.js +220 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/textResourceEditor.js +149 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/titleControl.js +284 -0
- package/dist/vscode/vs/workbench/browser/parts/media/compositepart.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsActions.js +8 -8
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCenter.js +2 -2
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsList.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsToasts.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/panel/media/basepanelpart.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/panel/media/panelpart.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/panel/panelActions.js +19 -5
- package/dist/vscode/vs/workbench/browser/parts/panel/panelPart.js +2 -2
- package/dist/vscode/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/sidebar/sidebarPart.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/statusbar/media/statusbarpart.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/statusbar/statusbarActions.js +109 -0
- package/dist/vscode/vs/workbench/browser/parts/statusbar/statusbarItem.js +224 -0
- package/dist/vscode/vs/workbench/browser/parts/statusbar/statusbarModel.js +251 -0
- package/dist/vscode/vs/workbench/browser/parts/statusbar/statusbarPart.js +439 -0
- package/dist/vscode/vs/workbench/browser/parts/titlebar/media/menubarControl.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/titlebar/menubarControl.js +76 -3
- package/dist/vscode/vs/workbench/browser/parts/views/media/paneviewlet.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/views/media/views.css.js +4 -0
- package/dist/vscode/vs/workbench/browser/parts/views/treeView.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/views/viewPane.js +5 -5
- package/dist/vscode/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/views/viewsService.js +4 -4
- package/dist/vscode/vs/workbench/browser/quickaccess.js +6 -2
- package/dist/vscode/vs/workbench/browser/workbench.contribution.js +1108 -0
- package/dist/vscode/vs/workbench/common/contextkeys.js +34 -1
- package/dist/vscode/vs/workbench/common/editor/editorGroupModel.js +674 -0
- package/dist/vscode/vs/workbench/common/editor.js +57 -1
- package/dist/vscode/vs/workbench/common/theme.js +35 -35
- package/dist/vscode/vs/workbench/common/views.js +1 -1
- package/dist/vscode/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +4 -4
- package/dist/vscode/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +1 -1
- package/dist/vscode/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +77 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +217 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/workbenchReferenceSearch.js +24 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointWidget.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debug.contribution.js +30 -4
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +13 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugIcons.js +77 -127
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugToolBar.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugViewlet.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/disassemblyView.js +620 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/exceptionWidget.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/media/debugHover.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/media/repl.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/repl.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/common/debug.js +2 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +71 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/textFileEditor.js +225 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerViewlet.js +5 -4
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.contribution.js +270 -4
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.js +4 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/fileCommands.js +24 -6
- package/dist/vscode/vs/workbench/contrib/files/browser/fileConstants.js +8 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +10 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/media/explorerviewlet.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/views/media/openeditors.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/views/openEditorsView.js +608 -0
- package/dist/vscode/vs/workbench/contrib/files/common/files.js +2 -1
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionInputPart.js +1 -1
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.js +1 -1
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/media/interactiveSession.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionContextKeys.js +9 -1
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionModel.js +305 -0
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionService.js +6 -1
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionServiceImpl.js +379 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser.js +2 -2
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +33 -1
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +130 -0
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +225 -0
- package/dist/vscode/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/remote/browser/remoteIcons.js +21 -17
- package/dist/vscode/vs/workbench/contrib/remote/browser/tunnelView.js +1 -1
- package/dist/vscode/vs/workbench/contrib/search/browser/anythingQuickAccess.js +757 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/search.contribution.js +428 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +219 -0
- package/dist/vscode/vs/workbench/contrib/search/common/cacheState.js +85 -0
- package/dist/vscode/vs/workbench/contrib/search/common/constants.js +2 -0
- package/dist/vscode/vs/workbench/contrib/search/common/search.js +119 -1
- package/dist/vscode/vs/workbench/contrib/tasks/browser/taskQuickPick.js +385 -0
- package/dist/vscode/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +108 -0
- package/dist/vscode/vs/workbench/contrib/tasks/common/tasks.js +351 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcon.js +44 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +147 -1
- package/dist/vscode/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +1 -1
- package/dist/vscode/vs/workbench/services/editor/browser/editorDropService.js +3 -0
- package/dist/vscode/vs/workbench/services/editor/browser/editorResolverService.js +619 -0
- package/dist/vscode/vs/workbench/services/editor/browser/editorService.js +720 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorGroupFinder.js +116 -0
- package/dist/vscode/vs/workbench/services/editor/common/editorGroupsService.js +6 -1
- package/dist/vscode/vs/workbench/services/editor/common/editorResolverService.js +34 -1
- package/dist/vscode/vs/workbench/services/history/browser/historyService.js +1451 -0
- package/dist/vscode/vs/workbench/services/hover/browser/hoverService.js +1 -1
- package/dist/vscode/vs/workbench/services/hover/browser/media/hover.css.js +4 -0
- package/dist/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.js +2 -1
- package/dist/vscode/vs/workbench/services/outline/browser/outline.js +3 -0
- package/dist/vscode/vs/workbench/services/progress/browser/progressIndicator.js +72 -1
- package/dist/vscode/vs/workbench/services/quickinput/browser/quickInputService.js +67 -0
- package/dist/vscode/vs/workbench/services/search/common/search.js +2 -112
- package/dist/vscode/vs/workbench/services/semanticSimilarity/common/semanticSimilarityService.js +54 -1
- package/dist/vscode/vs/workbench/services/statusbar/browser/statusbar.js +15 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/worker/textMate.worker.js +90 -0
- package/dist/vscode/vs/workbench/services/textMate/browser/worker/textMateWorkerModel.js +133 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +110 -3
- package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.js +1 -1
- package/dist/vscode-services/extHost.js +12 -5
- package/dist/vscode-services/missing-services.js +117 -3
- package/dist/vscode-services/window.js +21 -2
- package/dist/vscode-services/workspace.js +2 -1
- package/dist/workbenchThemeService.d.ts +1 -1
- package/dist/workers/textMate.worker.d.ts +2 -0
- package/dist/workers/textMate.worker.js +3 -0
- package/dist/workspace.d.ts +1 -1
- package/monaco-editor-treemending.patch +784 -784
- package/package.json +42 -22
- package/dist/assets/activityaction.css +0 -224
- package/dist/assets/activitybarpart.css +0 -65
- package/dist/assets/basepanelpart.css +0 -221
- package/dist/assets/breakpointWidget.css +0 -31
- package/dist/assets/callHierarchy.css +0 -62
- package/dist/assets/callStackEditorContribution.css +0 -12
- package/dist/assets/compositepart.css +0 -17
- package/dist/assets/debug.contribution.css +0 -138
- package/dist/assets/debugHover.css +0 -80
- package/dist/assets/debugToolBar.css +0 -49
- package/dist/assets/debugViewlet.css +0 -337
- package/dist/assets/editorquickaccess.css +0 -8
- package/dist/assets/exceptionWidget.css +0 -52
- package/dist/assets/explorerviewlet.css +0 -129
- package/dist/assets/hover.css +0 -127
- package/dist/assets/interactiveSession.css +0 -340
- package/dist/assets/menubar.css +0 -111
- package/dist/assets/menubarControl.css +0 -61
- package/dist/assets/notificationsActions.css +0 -14
- package/dist/assets/notificationsCenter.css +0 -69
- package/dist/assets/notificationsList.css +0 -152
- package/dist/assets/notificationsToasts.css +0 -63
- package/dist/assets/panelpart.css +0 -75
- package/dist/assets/paneview.css +0 -148
- package/dist/assets/paneviewlet.css +0 -79
- package/dist/assets/part.css +0 -109
- package/dist/assets/repl.css +0 -145
- package/dist/assets/sidebarpart.css +0 -61
- package/dist/assets/tunnelView.css +0 -107
- package/dist/assets/typeHierarchy.css +0 -62
- package/dist/assets/views.css +0 -297
- package/dist/override/vs/workbench/browser/parts/editor/textEditor.js +0 -2
- package/dist/override/vs/workbench/contrib/files/browser/views/openEditorsView.js +0 -2
- package/dist/service-override/modelEditor.d.ts +0 -14
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -249
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookService.js +0 -10
- package/dist/vscode/vs/workbench/services/search/common/searchHelpers.js +0 -72
- package/dist/vscode/vs/workbench/services/search/common/searchService.js +0 -355
|
@@ -0,0 +1,841 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
3
|
+
import { Part } from '../../part.js';
|
|
4
|
+
import { isAncestor, addDisposableGenericMouseDownListener, EventHelper, Dimension, $ } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
5
|
+
import { Emitter, Relay, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
6
|
+
import { contrastBorder, editorBackground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
7
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
8
|
+
import { isGridBranchNode, createSerializedGrid, Sizing, SerializableGrid } from '../../../../base/browser/ui/grid/grid.js';
|
|
9
|
+
import { EDITOR_GROUP_BORDER, EDITOR_PANE_BACKGROUND } from '../../../common/theme.js';
|
|
10
|
+
import { coalesce, distinct, firstOrDefault } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
11
|
+
import { getEditorPartOptions, impactsEditorPartOptions } from './editor.js';
|
|
12
|
+
import { EditorGroupView } from './editorGroupView.js';
|
|
13
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
14
|
+
import { toDisposable, dispose, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
15
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
16
|
+
import { isSerializedEditorGroupModel } from '../../../common/editor/editorGroupModel.js';
|
|
17
|
+
import { EditorDropTarget } from './editorDropTarget.js';
|
|
18
|
+
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
19
|
+
import { CenteredViewLayout } from '../../../../base/browser/ui/centered/centeredViewLayout.js';
|
|
20
|
+
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
21
|
+
import { IWorkbenchLayoutService } from '../../../services/layout/browser/layoutService.js';
|
|
22
|
+
import { assertIsDefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
23
|
+
import { CompositeDragAndDropObserver } from '../../dnd.js';
|
|
24
|
+
import { DeferredPromise, Promises } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
25
|
+
import { findGroup } from '../../../services/editor/common/editorGroupFinder.js';
|
|
26
|
+
import { SIDE_GROUP } from '../../../services/editor/common/editorService.js';
|
|
27
|
+
import { orthogonal } from '../../../../base/browser/ui/grid/gridview.js';
|
|
28
|
+
class GridWidgetView {
|
|
29
|
+
constructor() {
|
|
30
|
+
this.element = $('.grid-view-container');
|
|
31
|
+
this._onDidChange = ( new Relay());
|
|
32
|
+
this.onDidChange = this._onDidChange.event;
|
|
33
|
+
}
|
|
34
|
+
get minimumWidth() { return this.gridWidget ? this.gridWidget.minimumWidth : 0; }
|
|
35
|
+
get maximumWidth() { return this.gridWidget ? this.gridWidget.maximumWidth : Number.POSITIVE_INFINITY; }
|
|
36
|
+
get minimumHeight() { return this.gridWidget ? this.gridWidget.minimumHeight : 0; }
|
|
37
|
+
get maximumHeight() { return this.gridWidget ? this.gridWidget.maximumHeight : Number.POSITIVE_INFINITY; }
|
|
38
|
+
get gridWidget() {
|
|
39
|
+
return this._gridWidget;
|
|
40
|
+
}
|
|
41
|
+
set gridWidget(grid) {
|
|
42
|
+
this.element.innerText = '';
|
|
43
|
+
if (grid) {
|
|
44
|
+
this.element.appendChild(grid.element);
|
|
45
|
+
this._onDidChange.input = grid.onDidChange;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this._onDidChange.input = Event.None;
|
|
49
|
+
}
|
|
50
|
+
this._gridWidget = grid;
|
|
51
|
+
}
|
|
52
|
+
layout(width, height, top, left) {
|
|
53
|
+
this.gridWidget?.layout(width, height, top, left);
|
|
54
|
+
}
|
|
55
|
+
dispose() {
|
|
56
|
+
this._onDidChange.dispose();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
let EditorPart = class EditorPart extends Part {
|
|
60
|
+
constructor(instantiationService, themeService, configurationService, storageService, layoutService) {
|
|
61
|
+
super("workbench.parts.editor" , { hasTitle: false }, themeService, storageService, layoutService);
|
|
62
|
+
this.instantiationService = instantiationService;
|
|
63
|
+
this.configurationService = configurationService;
|
|
64
|
+
this._onDidLayout = this._register(( new Emitter()));
|
|
65
|
+
this.onDidLayout = this._onDidLayout.event;
|
|
66
|
+
this._onDidChangeActiveGroup = this._register(( new Emitter()));
|
|
67
|
+
this.onDidChangeActiveGroup = this._onDidChangeActiveGroup.event;
|
|
68
|
+
this._onDidChangeGroupIndex = this._register(( new Emitter()));
|
|
69
|
+
this.onDidChangeGroupIndex = this._onDidChangeGroupIndex.event;
|
|
70
|
+
this._onDidChangeGroupLocked = this._register(( new Emitter()));
|
|
71
|
+
this.onDidChangeGroupLocked = this._onDidChangeGroupLocked.event;
|
|
72
|
+
this._onDidActivateGroup = this._register(( new Emitter()));
|
|
73
|
+
this.onDidActivateGroup = this._onDidActivateGroup.event;
|
|
74
|
+
this._onDidAddGroup = this._register(( new Emitter()));
|
|
75
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
76
|
+
this._onDidRemoveGroup = this._register(( new Emitter()));
|
|
77
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
78
|
+
this._onDidMoveGroup = this._register(( new Emitter()));
|
|
79
|
+
this.onDidMoveGroup = this._onDidMoveGroup.event;
|
|
80
|
+
this.onDidSetGridWidget = this._register(( new Emitter()));
|
|
81
|
+
this._onDidChangeSizeConstraints = this._register(( new Relay()));
|
|
82
|
+
this.onDidChangeSizeConstraints = Event.any(this.onDidSetGridWidget.event, this._onDidChangeSizeConstraints.event);
|
|
83
|
+
this._onDidScroll = this._register(( new Relay()));
|
|
84
|
+
this.onDidScroll = Event.any(this.onDidSetGridWidget.event, this._onDidScroll.event);
|
|
85
|
+
this._onDidChangeEditorPartOptions = this._register(( new Emitter()));
|
|
86
|
+
this.onDidChangeEditorPartOptions = this._onDidChangeEditorPartOptions.event;
|
|
87
|
+
this.workspaceMemento = this.getMemento(1 , 1 );
|
|
88
|
+
this.profileMemento = this.getMemento(0 , 1 );
|
|
89
|
+
this.groupViews = ( new Map());
|
|
90
|
+
this.mostRecentActiveGroups = [];
|
|
91
|
+
this.gridWidgetView = this._register(( new GridWidgetView()));
|
|
92
|
+
this.enforcedPartOptions = [];
|
|
93
|
+
this._partOptions = getEditorPartOptions(this.configurationService, this.themeService);
|
|
94
|
+
this._top = 0;
|
|
95
|
+
this._left = 0;
|
|
96
|
+
this.sideGroup = {
|
|
97
|
+
openEditor: (editor, options) => {
|
|
98
|
+
const [group] = this.instantiationService.invokeFunction(accessor => findGroup(accessor, { editor, options }, SIDE_GROUP));
|
|
99
|
+
return group.openEditor(editor, options);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
this._isReady = false;
|
|
103
|
+
this.whenReadyPromise = ( new DeferredPromise());
|
|
104
|
+
this.whenReady = this.whenReadyPromise.p;
|
|
105
|
+
this.whenRestoredPromise = ( new DeferredPromise());
|
|
106
|
+
this.whenRestored = this.whenRestoredPromise.p;
|
|
107
|
+
this.priority = 2 ;
|
|
108
|
+
this.registerListeners();
|
|
109
|
+
}
|
|
110
|
+
registerListeners() {
|
|
111
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
|
|
112
|
+
this._register(this.themeService.onDidFileIconThemeChange(() => this.handleChangedPartOptions()));
|
|
113
|
+
}
|
|
114
|
+
onConfigurationUpdated(event) {
|
|
115
|
+
if (impactsEditorPartOptions(event)) {
|
|
116
|
+
this.handleChangedPartOptions();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
handleChangedPartOptions() {
|
|
120
|
+
const oldPartOptions = this._partOptions;
|
|
121
|
+
const newPartOptions = getEditorPartOptions(this.configurationService, this.themeService);
|
|
122
|
+
for (const enforcedPartOptions of this.enforcedPartOptions) {
|
|
123
|
+
Object.assign(newPartOptions, enforcedPartOptions);
|
|
124
|
+
}
|
|
125
|
+
this._partOptions = newPartOptions;
|
|
126
|
+
this._onDidChangeEditorPartOptions.fire({ oldPartOptions, newPartOptions });
|
|
127
|
+
}
|
|
128
|
+
get partOptions() { return this._partOptions; }
|
|
129
|
+
enforcePartOptions(options) {
|
|
130
|
+
this.enforcedPartOptions.push(options);
|
|
131
|
+
this.handleChangedPartOptions();
|
|
132
|
+
return toDisposable(() => {
|
|
133
|
+
this.enforcedPartOptions.splice(this.enforcedPartOptions.indexOf(options), 1);
|
|
134
|
+
this.handleChangedPartOptions();
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
get contentDimension() { return this._contentDimension; }
|
|
138
|
+
get activeGroup() {
|
|
139
|
+
return this._activeGroup;
|
|
140
|
+
}
|
|
141
|
+
get groups() {
|
|
142
|
+
return Array.from(( this.groupViews.values()));
|
|
143
|
+
}
|
|
144
|
+
get count() {
|
|
145
|
+
return this.groupViews.size;
|
|
146
|
+
}
|
|
147
|
+
get orientation() {
|
|
148
|
+
return ((this.gridWidget && this.gridWidget.orientation === 0) ) ? 1 : 0 ;
|
|
149
|
+
}
|
|
150
|
+
get isReady() { return this._isReady; }
|
|
151
|
+
get hasRestorableState() {
|
|
152
|
+
return !!this.workspaceMemento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY];
|
|
153
|
+
}
|
|
154
|
+
getGroups(order = 0 ) {
|
|
155
|
+
switch (order) {
|
|
156
|
+
case 0 :
|
|
157
|
+
return this.groups;
|
|
158
|
+
case 1 : {
|
|
159
|
+
const mostRecentActive = coalesce(( this.mostRecentActiveGroups.map(groupId => this.getGroup(groupId))));
|
|
160
|
+
return distinct([...mostRecentActive, ...this.groups]);
|
|
161
|
+
}
|
|
162
|
+
case 2 : {
|
|
163
|
+
const views = [];
|
|
164
|
+
if (this.gridWidget) {
|
|
165
|
+
this.fillGridNodes(views, this.gridWidget.getViews());
|
|
166
|
+
}
|
|
167
|
+
return views;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
fillGridNodes(target, node) {
|
|
172
|
+
if (isGridBranchNode(node)) {
|
|
173
|
+
node.children.forEach(child => this.fillGridNodes(target, child));
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
target.push(node.view);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
getGroup(identifier) {
|
|
180
|
+
return this.groupViews.get(identifier);
|
|
181
|
+
}
|
|
182
|
+
findGroup(scope, source = this.activeGroup, wrap) {
|
|
183
|
+
if (typeof scope.direction === 'number') {
|
|
184
|
+
return this.doFindGroupByDirection(scope.direction, source, wrap);
|
|
185
|
+
}
|
|
186
|
+
if (typeof scope.location === 'number') {
|
|
187
|
+
return this.doFindGroupByLocation(scope.location, source, wrap);
|
|
188
|
+
}
|
|
189
|
+
throw new Error('invalid arguments');
|
|
190
|
+
}
|
|
191
|
+
doFindGroupByDirection(direction, source, wrap) {
|
|
192
|
+
const sourceGroupView = this.assertGroupView(source);
|
|
193
|
+
const neighbours = this.gridWidget.getNeighborViews(sourceGroupView, this.toGridViewDirection(direction), wrap);
|
|
194
|
+
neighbours.sort(((n1, n2) => this.mostRecentActiveGroups.indexOf(n1.id) - this.mostRecentActiveGroups.indexOf(n2.id)));
|
|
195
|
+
return neighbours[0];
|
|
196
|
+
}
|
|
197
|
+
doFindGroupByLocation(location, source, wrap) {
|
|
198
|
+
const sourceGroupView = this.assertGroupView(source);
|
|
199
|
+
const groups = this.getGroups(2 );
|
|
200
|
+
const index = groups.indexOf(sourceGroupView);
|
|
201
|
+
switch (location) {
|
|
202
|
+
case 0 :
|
|
203
|
+
return groups[0];
|
|
204
|
+
case 1 :
|
|
205
|
+
return groups[groups.length - 1];
|
|
206
|
+
case 2 : {
|
|
207
|
+
let nextGroup = groups[index + 1];
|
|
208
|
+
if (!nextGroup && wrap) {
|
|
209
|
+
nextGroup = this.doFindGroupByLocation(0 , source);
|
|
210
|
+
}
|
|
211
|
+
return nextGroup;
|
|
212
|
+
}
|
|
213
|
+
case 3 : {
|
|
214
|
+
let previousGroup = groups[index - 1];
|
|
215
|
+
if (!previousGroup && wrap) {
|
|
216
|
+
previousGroup = this.doFindGroupByLocation(1 , source);
|
|
217
|
+
}
|
|
218
|
+
return previousGroup;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
activateGroup(group) {
|
|
223
|
+
const groupView = this.assertGroupView(group);
|
|
224
|
+
this.doSetGroupActive(groupView);
|
|
225
|
+
this._onDidActivateGroup.fire(groupView);
|
|
226
|
+
return groupView;
|
|
227
|
+
}
|
|
228
|
+
restoreGroup(group) {
|
|
229
|
+
const groupView = this.assertGroupView(group);
|
|
230
|
+
this.doRestoreGroup(groupView);
|
|
231
|
+
return groupView;
|
|
232
|
+
}
|
|
233
|
+
getSize(group) {
|
|
234
|
+
const groupView = this.assertGroupView(group);
|
|
235
|
+
return this.gridWidget.getViewSize(groupView);
|
|
236
|
+
}
|
|
237
|
+
setSize(group, size) {
|
|
238
|
+
const groupView = this.assertGroupView(group);
|
|
239
|
+
this.gridWidget.resizeView(groupView, size);
|
|
240
|
+
}
|
|
241
|
+
arrangeGroups(arrangement, target = this.activeGroup) {
|
|
242
|
+
if (this.count < 2) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (!this.gridWidget) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
switch (arrangement) {
|
|
249
|
+
case 1 :
|
|
250
|
+
this.gridWidget.distributeViewSizes();
|
|
251
|
+
break;
|
|
252
|
+
case 0 :
|
|
253
|
+
this.gridWidget.maximizeViewSize(target);
|
|
254
|
+
break;
|
|
255
|
+
case 2 :
|
|
256
|
+
if (this.isGroupMaximized(target)) {
|
|
257
|
+
this.arrangeGroups(1 );
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
this.arrangeGroups(0 );
|
|
261
|
+
}
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
isGroupMaximized(targetGroup) {
|
|
266
|
+
return this.gridWidget.isViewSizeMaximized(targetGroup);
|
|
267
|
+
}
|
|
268
|
+
setGroupOrientation(orientation) {
|
|
269
|
+
if (!this.gridWidget) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const newOrientation = ((orientation === 0) ) ? 1 : 0 ;
|
|
273
|
+
if (this.gridWidget.orientation !== newOrientation) {
|
|
274
|
+
this.gridWidget.orientation = newOrientation;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
applyLayout(layout) {
|
|
278
|
+
const restoreFocus = this.shouldRestoreFocus(this.container);
|
|
279
|
+
let layoutGroupsCount = 0;
|
|
280
|
+
function countGroups(groups) {
|
|
281
|
+
for (const group of groups) {
|
|
282
|
+
if (Array.isArray(group.groups)) {
|
|
283
|
+
countGroups(group.groups);
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
layoutGroupsCount++;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
countGroups(layout.groups);
|
|
291
|
+
let currentGroupViews = this.getGroups(2 );
|
|
292
|
+
if (layoutGroupsCount < currentGroupViews.length) {
|
|
293
|
+
const lastGroupInLayout = currentGroupViews[layoutGroupsCount - 1];
|
|
294
|
+
currentGroupViews.forEach((group, index) => {
|
|
295
|
+
if (index >= layoutGroupsCount) {
|
|
296
|
+
this.mergeGroup(group, lastGroupInLayout);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
currentGroupViews = this.getGroups(2 );
|
|
300
|
+
}
|
|
301
|
+
const activeGroup = this.activeGroup;
|
|
302
|
+
const gridDescriptor = createSerializedGrid({
|
|
303
|
+
orientation: this.toGridViewOrientation(layout.orientation, this.isTwoDimensionalGrid() ?
|
|
304
|
+
this.gridWidget.orientation :
|
|
305
|
+
orthogonal(this.gridWidget.orientation)
|
|
306
|
+
),
|
|
307
|
+
groups: layout.groups
|
|
308
|
+
});
|
|
309
|
+
this.doCreateGridControlWithState(gridDescriptor, activeGroup.id, currentGroupViews);
|
|
310
|
+
this.doLayout(this._contentDimension);
|
|
311
|
+
this.updateContainer();
|
|
312
|
+
for (const groupView of this.getGroups(2 )) {
|
|
313
|
+
if (!currentGroupViews.includes(groupView)) {
|
|
314
|
+
this._onDidAddGroup.fire(groupView);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
this.notifyGroupIndexChange();
|
|
318
|
+
if (restoreFocus) {
|
|
319
|
+
this._activeGroup.focus();
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
getLayout() {
|
|
323
|
+
const serializedGrid = this.gridWidget.serialize();
|
|
324
|
+
const orientation = serializedGrid.orientation === 1 ? 0 : 1 ;
|
|
325
|
+
const root = this.serializedNodeToGroupLayoutArgument(serializedGrid.root);
|
|
326
|
+
return {
|
|
327
|
+
orientation,
|
|
328
|
+
groups: root.groups
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
serializedNodeToGroupLayoutArgument(serializedNode) {
|
|
332
|
+
if (serializedNode.type === 'branch') {
|
|
333
|
+
return {
|
|
334
|
+
size: serializedNode.size,
|
|
335
|
+
groups: ( serializedNode.data.map(node => this.serializedNodeToGroupLayoutArgument(node)))
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
return { size: serializedNode.size };
|
|
339
|
+
}
|
|
340
|
+
shouldRestoreFocus(target) {
|
|
341
|
+
if (!target) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
const activeElement = document.activeElement;
|
|
345
|
+
if (activeElement === document.body) {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
return isAncestor(activeElement, target);
|
|
349
|
+
}
|
|
350
|
+
isTwoDimensionalGrid() {
|
|
351
|
+
const views = this.gridWidget.getViews();
|
|
352
|
+
if (isGridBranchNode(views)) {
|
|
353
|
+
return ( views.children.some(child => isGridBranchNode(child)));
|
|
354
|
+
}
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
addGroup(location, direction, options) {
|
|
358
|
+
const locationView = this.assertGroupView(location);
|
|
359
|
+
const group = this.doAddGroup(locationView, direction);
|
|
360
|
+
if (options?.activate) {
|
|
361
|
+
this.doSetGroupActive(group);
|
|
362
|
+
}
|
|
363
|
+
return group;
|
|
364
|
+
}
|
|
365
|
+
doAddGroup(locationView, direction, groupToCopy) {
|
|
366
|
+
const shouldMaximize = this.groupViews.size > 1 && this.isGroupMaximized(locationView);
|
|
367
|
+
const newGroupView = this.doCreateGroupView(groupToCopy);
|
|
368
|
+
this.gridWidget.addView(newGroupView, this.getSplitSizingStyle(), locationView, this.toGridViewDirection(direction));
|
|
369
|
+
this.updateContainer();
|
|
370
|
+
this._onDidAddGroup.fire(newGroupView);
|
|
371
|
+
this.notifyGroupIndexChange();
|
|
372
|
+
if (shouldMaximize) {
|
|
373
|
+
this.arrangeGroups(0 , newGroupView);
|
|
374
|
+
}
|
|
375
|
+
return newGroupView;
|
|
376
|
+
}
|
|
377
|
+
getSplitSizingStyle() {
|
|
378
|
+
return this._partOptions.splitSizing === 'split' ? Sizing.Split : Sizing.Distribute;
|
|
379
|
+
}
|
|
380
|
+
doCreateGroupView(from) {
|
|
381
|
+
let groupView;
|
|
382
|
+
if (from instanceof EditorGroupView) {
|
|
383
|
+
groupView = EditorGroupView.createCopy(from, this, this.count, this.instantiationService);
|
|
384
|
+
}
|
|
385
|
+
else if (isSerializedEditorGroupModel(from)) {
|
|
386
|
+
groupView = EditorGroupView.createFromSerialized(from, this, this.count, this.instantiationService);
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
groupView = EditorGroupView.createNew(this, this.count, this.instantiationService);
|
|
390
|
+
}
|
|
391
|
+
this.groupViews.set(groupView.id, groupView);
|
|
392
|
+
const groupDisposables = ( new DisposableStore());
|
|
393
|
+
groupDisposables.add(groupView.onDidFocus(() => {
|
|
394
|
+
this.doSetGroupActive(groupView);
|
|
395
|
+
}));
|
|
396
|
+
groupDisposables.add(groupView.onDidModelChange(e => {
|
|
397
|
+
switch (e.kind) {
|
|
398
|
+
case 2 :
|
|
399
|
+
this._onDidChangeGroupLocked.fire(groupView);
|
|
400
|
+
break;
|
|
401
|
+
case 1 :
|
|
402
|
+
this._onDidChangeGroupIndex.fire(groupView);
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
}));
|
|
406
|
+
groupDisposables.add(groupView.onDidActiveEditorChange(() => {
|
|
407
|
+
this.updateContainer();
|
|
408
|
+
}));
|
|
409
|
+
Event.once(groupView.onWillDispose)(() => {
|
|
410
|
+
dispose(groupDisposables);
|
|
411
|
+
this.groupViews.delete(groupView.id);
|
|
412
|
+
this.doUpdateMostRecentActive(groupView);
|
|
413
|
+
});
|
|
414
|
+
return groupView;
|
|
415
|
+
}
|
|
416
|
+
doSetGroupActive(group) {
|
|
417
|
+
if (this._activeGroup === group) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
const previousActiveGroup = this._activeGroup;
|
|
421
|
+
this._activeGroup = group;
|
|
422
|
+
this.doUpdateMostRecentActive(group, true);
|
|
423
|
+
previousActiveGroup?.setActive(false);
|
|
424
|
+
group.setActive(true);
|
|
425
|
+
this.doRestoreGroup(group);
|
|
426
|
+
this._onDidChangeActiveGroup.fire(group);
|
|
427
|
+
}
|
|
428
|
+
doRestoreGroup(group) {
|
|
429
|
+
if (this.gridWidget) {
|
|
430
|
+
const viewSize = this.gridWidget.getViewSize(group);
|
|
431
|
+
if (viewSize.width === group.minimumWidth || viewSize.height === group.minimumHeight) {
|
|
432
|
+
this.arrangeGroups(0 , group);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
doUpdateMostRecentActive(group, makeMostRecentlyActive) {
|
|
437
|
+
const index = this.mostRecentActiveGroups.indexOf(group.id);
|
|
438
|
+
if (index !== -1) {
|
|
439
|
+
this.mostRecentActiveGroups.splice(index, 1);
|
|
440
|
+
}
|
|
441
|
+
if (makeMostRecentlyActive) {
|
|
442
|
+
this.mostRecentActiveGroups.unshift(group.id);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
toGridViewDirection(direction) {
|
|
446
|
+
switch (direction) {
|
|
447
|
+
case 0 : return 0 ;
|
|
448
|
+
case 1 : return 1 ;
|
|
449
|
+
case 2 : return 2 ;
|
|
450
|
+
case 3 : return 3 ;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
toGridViewOrientation(orientation, fallback) {
|
|
454
|
+
if (typeof orientation === 'number') {
|
|
455
|
+
return orientation === 0 ? 1 : 0 ;
|
|
456
|
+
}
|
|
457
|
+
return fallback;
|
|
458
|
+
}
|
|
459
|
+
removeGroup(group) {
|
|
460
|
+
const groupView = this.assertGroupView(group);
|
|
461
|
+
if (this.count === 1) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
if (groupView.isEmpty) {
|
|
465
|
+
return this.doRemoveEmptyGroup(groupView);
|
|
466
|
+
}
|
|
467
|
+
this.doRemoveGroupWithEditors(groupView);
|
|
468
|
+
}
|
|
469
|
+
doRemoveGroupWithEditors(groupView) {
|
|
470
|
+
const mostRecentlyActiveGroups = this.getGroups(1 );
|
|
471
|
+
let lastActiveGroup;
|
|
472
|
+
if (this._activeGroup === groupView) {
|
|
473
|
+
lastActiveGroup = mostRecentlyActiveGroups[1];
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
lastActiveGroup = mostRecentlyActiveGroups[0];
|
|
477
|
+
}
|
|
478
|
+
this.mergeGroup(groupView, lastActiveGroup);
|
|
479
|
+
}
|
|
480
|
+
doRemoveEmptyGroup(groupView) {
|
|
481
|
+
const restoreFocus = this.shouldRestoreFocus(this.container);
|
|
482
|
+
if (this._activeGroup === groupView) {
|
|
483
|
+
const mostRecentlyActiveGroups = this.getGroups(1 );
|
|
484
|
+
const nextActiveGroup = mostRecentlyActiveGroups[1];
|
|
485
|
+
this.activateGroup(nextActiveGroup);
|
|
486
|
+
}
|
|
487
|
+
this.gridWidget.removeView(groupView, this.getSplitSizingStyle());
|
|
488
|
+
groupView.dispose();
|
|
489
|
+
if (restoreFocus) {
|
|
490
|
+
this._activeGroup.focus();
|
|
491
|
+
}
|
|
492
|
+
this.notifyGroupIndexChange();
|
|
493
|
+
this.updateContainer();
|
|
494
|
+
if (this.count === 1) {
|
|
495
|
+
firstOrDefault(this.groups)?.lock(false);
|
|
496
|
+
}
|
|
497
|
+
this._onDidRemoveGroup.fire(groupView);
|
|
498
|
+
}
|
|
499
|
+
moveGroup(group, location, direction) {
|
|
500
|
+
const sourceView = this.assertGroupView(group);
|
|
501
|
+
const targetView = this.assertGroupView(location);
|
|
502
|
+
if (sourceView.id === targetView.id) {
|
|
503
|
+
throw new Error('Cannot move group into its own');
|
|
504
|
+
}
|
|
505
|
+
const restoreFocus = this.shouldRestoreFocus(sourceView.element);
|
|
506
|
+
this.gridWidget.moveView(sourceView, this.getSplitSizingStyle(), targetView, this.toGridViewDirection(direction));
|
|
507
|
+
if (restoreFocus) {
|
|
508
|
+
sourceView.focus();
|
|
509
|
+
}
|
|
510
|
+
this._onDidMoveGroup.fire(sourceView);
|
|
511
|
+
this.notifyGroupIndexChange();
|
|
512
|
+
return sourceView;
|
|
513
|
+
}
|
|
514
|
+
copyGroup(group, location, direction) {
|
|
515
|
+
const groupView = this.assertGroupView(group);
|
|
516
|
+
const locationView = this.assertGroupView(location);
|
|
517
|
+
const restoreFocus = this.shouldRestoreFocus(groupView.element);
|
|
518
|
+
const copiedGroupView = this.doAddGroup(locationView, direction, groupView);
|
|
519
|
+
if (restoreFocus) {
|
|
520
|
+
copiedGroupView.focus();
|
|
521
|
+
}
|
|
522
|
+
return copiedGroupView;
|
|
523
|
+
}
|
|
524
|
+
mergeGroup(group, target, options) {
|
|
525
|
+
const sourceView = this.assertGroupView(group);
|
|
526
|
+
const targetView = this.assertGroupView(target);
|
|
527
|
+
const editors = [];
|
|
528
|
+
let index = (options && typeof options.index === 'number') ? options.index : targetView.count;
|
|
529
|
+
for (const editor of sourceView.editors) {
|
|
530
|
+
const inactive = !sourceView.isActive(editor) || this._activeGroup !== sourceView;
|
|
531
|
+
const sticky = sourceView.isSticky(editor);
|
|
532
|
+
const options = { index: !sticky ? index : undefined , inactive, preserveFocus: inactive };
|
|
533
|
+
editors.push({ editor, options });
|
|
534
|
+
index++;
|
|
535
|
+
}
|
|
536
|
+
if (options?.mode === 0 ) {
|
|
537
|
+
sourceView.copyEditors(editors, targetView);
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
sourceView.moveEditors(editors, targetView);
|
|
541
|
+
}
|
|
542
|
+
if (sourceView.isEmpty && !sourceView.disposed ) {
|
|
543
|
+
this.removeGroup(sourceView);
|
|
544
|
+
}
|
|
545
|
+
return targetView;
|
|
546
|
+
}
|
|
547
|
+
mergeAllGroups(target = this.activeGroup) {
|
|
548
|
+
for (const group of this.getGroups(1 )) {
|
|
549
|
+
if (group === target) {
|
|
550
|
+
continue;
|
|
551
|
+
}
|
|
552
|
+
this.mergeGroup(group, target);
|
|
553
|
+
}
|
|
554
|
+
return target;
|
|
555
|
+
}
|
|
556
|
+
assertGroupView(group) {
|
|
557
|
+
let groupView;
|
|
558
|
+
if (typeof group === 'number') {
|
|
559
|
+
groupView = this.getGroup(group);
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
groupView = group;
|
|
563
|
+
}
|
|
564
|
+
if (!groupView) {
|
|
565
|
+
throw new Error('Invalid editor group provided!');
|
|
566
|
+
}
|
|
567
|
+
return groupView;
|
|
568
|
+
}
|
|
569
|
+
createEditorDropTarget(container, delegate) {
|
|
570
|
+
return this.instantiationService.createInstance(EditorDropTarget, this, container, delegate);
|
|
571
|
+
}
|
|
572
|
+
get minimumWidth() { return Math.min(this.centeredLayoutWidget.minimumWidth, this.layoutService.getMaximumEditorDimensions().width); }
|
|
573
|
+
get maximumWidth() { return this.centeredLayoutWidget.maximumWidth; }
|
|
574
|
+
get minimumHeight() { return Math.min(this.centeredLayoutWidget.minimumHeight, this.layoutService.getMaximumEditorDimensions().height); }
|
|
575
|
+
get maximumHeight() { return this.centeredLayoutWidget.maximumHeight; }
|
|
576
|
+
get snap() { return this.layoutService.getPanelAlignment() === 'center'; }
|
|
577
|
+
get onDidChange() { return Event.any(this.centeredLayoutWidget.onDidChange, this.onDidSetGridWidget.event); }
|
|
578
|
+
get gridSeparatorBorder() {
|
|
579
|
+
return this.theme.getColor(EDITOR_GROUP_BORDER) || this.theme.getColor(contrastBorder) || Color.transparent;
|
|
580
|
+
}
|
|
581
|
+
updateStyles() {
|
|
582
|
+
const container = assertIsDefined(this.container);
|
|
583
|
+
container.style.backgroundColor = this.getColor(editorBackground) || '';
|
|
584
|
+
const separatorBorderStyle = { separatorBorder: this.gridSeparatorBorder, background: this.theme.getColor(EDITOR_PANE_BACKGROUND) || Color.transparent };
|
|
585
|
+
this.gridWidget.style(separatorBorderStyle);
|
|
586
|
+
this.centeredLayoutWidget.styles(separatorBorderStyle);
|
|
587
|
+
}
|
|
588
|
+
createContentArea(parent, options) {
|
|
589
|
+
this.element = parent;
|
|
590
|
+
this.container = document.createElement('div');
|
|
591
|
+
this.container.classList.add('content');
|
|
592
|
+
parent.appendChild(this.container);
|
|
593
|
+
this.doCreateGridControl(options);
|
|
594
|
+
this.centeredLayoutWidget = this._register(( new CenteredViewLayout(
|
|
595
|
+
this.container,
|
|
596
|
+
this.gridWidgetView,
|
|
597
|
+
this.profileMemento[EditorPart.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY]
|
|
598
|
+
)));
|
|
599
|
+
this._register(this.onDidChangeEditorPartOptions(e => this.centeredLayoutWidget.setFixedWidth(e.newPartOptions.centeredLayoutFixedWidth ?? false)));
|
|
600
|
+
this.setupDragAndDropSupport(parent, this.container);
|
|
601
|
+
this.whenReadyPromise.complete();
|
|
602
|
+
this._isReady = true;
|
|
603
|
+
Promises.settled(( this.groups.map(group => group.whenRestored))).finally(() => {
|
|
604
|
+
this.whenRestoredPromise.complete();
|
|
605
|
+
});
|
|
606
|
+
return this.container;
|
|
607
|
+
}
|
|
608
|
+
setupDragAndDropSupport(parent, container) {
|
|
609
|
+
this._register(this.createEditorDropTarget(container, Object.create(null)));
|
|
610
|
+
const overlay = document.createElement('div');
|
|
611
|
+
overlay.classList.add('drop-block-overlay');
|
|
612
|
+
parent.appendChild(overlay);
|
|
613
|
+
this._register(addDisposableGenericMouseDownListener(overlay, () => overlay.classList.remove('visible')));
|
|
614
|
+
this._register(CompositeDragAndDropObserver.INSTANCE.registerTarget(this.element, {
|
|
615
|
+
onDragStart: e => overlay.classList.add('visible'),
|
|
616
|
+
onDragEnd: e => overlay.classList.remove('visible')
|
|
617
|
+
}));
|
|
618
|
+
let horizontalOpenerTimeout;
|
|
619
|
+
let verticalOpenerTimeout;
|
|
620
|
+
let lastOpenHorizontalPosition;
|
|
621
|
+
let lastOpenVerticalPosition;
|
|
622
|
+
const openPartAtPosition = (position) => {
|
|
623
|
+
if (!this.layoutService.isVisible("workbench.parts.panel" ) && position === this.layoutService.getPanelPosition()) {
|
|
624
|
+
this.layoutService.setPartHidden(false, "workbench.parts.panel" );
|
|
625
|
+
}
|
|
626
|
+
else if (!this.layoutService.isVisible("workbench.parts.auxiliarybar" ) && position === ((this.layoutService.getSideBarPosition() === 1 ? 0 : 1) )) {
|
|
627
|
+
this.layoutService.setPartHidden(false, "workbench.parts.auxiliarybar" );
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
const clearAllTimeouts = () => {
|
|
631
|
+
if (horizontalOpenerTimeout) {
|
|
632
|
+
clearTimeout(horizontalOpenerTimeout);
|
|
633
|
+
horizontalOpenerTimeout = undefined;
|
|
634
|
+
}
|
|
635
|
+
if (verticalOpenerTimeout) {
|
|
636
|
+
clearTimeout(verticalOpenerTimeout);
|
|
637
|
+
verticalOpenerTimeout = undefined;
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
this._register(CompositeDragAndDropObserver.INSTANCE.registerTarget(overlay, {
|
|
641
|
+
onDragOver: e => {
|
|
642
|
+
EventHelper.stop(e.eventData, true);
|
|
643
|
+
if (e.eventData.dataTransfer) {
|
|
644
|
+
e.eventData.dataTransfer.dropEffect = 'none';
|
|
645
|
+
}
|
|
646
|
+
const boundingRect = overlay.getBoundingClientRect();
|
|
647
|
+
let openHorizontalPosition = undefined;
|
|
648
|
+
let openVerticalPosition = undefined;
|
|
649
|
+
const proximity = 100;
|
|
650
|
+
if (e.eventData.clientX < boundingRect.left + proximity) {
|
|
651
|
+
openHorizontalPosition = 0 ;
|
|
652
|
+
}
|
|
653
|
+
if (e.eventData.clientX > boundingRect.right - proximity) {
|
|
654
|
+
openHorizontalPosition = 1 ;
|
|
655
|
+
}
|
|
656
|
+
if (e.eventData.clientY > boundingRect.bottom - proximity) {
|
|
657
|
+
openVerticalPosition = 2 ;
|
|
658
|
+
}
|
|
659
|
+
if (horizontalOpenerTimeout && openHorizontalPosition !== lastOpenHorizontalPosition) {
|
|
660
|
+
clearTimeout(horizontalOpenerTimeout);
|
|
661
|
+
horizontalOpenerTimeout = undefined;
|
|
662
|
+
}
|
|
663
|
+
if (verticalOpenerTimeout && openVerticalPosition !== lastOpenVerticalPosition) {
|
|
664
|
+
clearTimeout(verticalOpenerTimeout);
|
|
665
|
+
verticalOpenerTimeout = undefined;
|
|
666
|
+
}
|
|
667
|
+
if (!horizontalOpenerTimeout && openHorizontalPosition !== undefined) {
|
|
668
|
+
lastOpenHorizontalPosition = openHorizontalPosition;
|
|
669
|
+
horizontalOpenerTimeout = setTimeout(() => openPartAtPosition(openHorizontalPosition), 200);
|
|
670
|
+
}
|
|
671
|
+
if (!verticalOpenerTimeout && openVerticalPosition !== undefined) {
|
|
672
|
+
lastOpenVerticalPosition = openVerticalPosition;
|
|
673
|
+
verticalOpenerTimeout = setTimeout(() => openPartAtPosition(openVerticalPosition), 200);
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
onDragLeave: () => clearAllTimeouts(),
|
|
677
|
+
onDragEnd: () => clearAllTimeouts(),
|
|
678
|
+
onDrop: () => clearAllTimeouts()
|
|
679
|
+
}));
|
|
680
|
+
}
|
|
681
|
+
centerLayout(active) {
|
|
682
|
+
this.centeredLayoutWidget.activate(active);
|
|
683
|
+
this._activeGroup.focus();
|
|
684
|
+
}
|
|
685
|
+
isLayoutCentered() {
|
|
686
|
+
if (this.centeredLayoutWidget) {
|
|
687
|
+
return this.centeredLayoutWidget.isActive();
|
|
688
|
+
}
|
|
689
|
+
return false;
|
|
690
|
+
}
|
|
691
|
+
doCreateGridControl(options) {
|
|
692
|
+
let restoreError = false;
|
|
693
|
+
if (!options || options.restorePreviousState) {
|
|
694
|
+
restoreError = !this.doCreateGridControlWithPreviousState();
|
|
695
|
+
}
|
|
696
|
+
if (!this.gridWidget || restoreError) {
|
|
697
|
+
const initialGroup = this.doCreateGroupView();
|
|
698
|
+
this.doSetGridWidget(( new SerializableGrid(initialGroup)));
|
|
699
|
+
this.doSetGroupActive(initialGroup);
|
|
700
|
+
}
|
|
701
|
+
this.updateContainer();
|
|
702
|
+
this.notifyGroupIndexChange();
|
|
703
|
+
}
|
|
704
|
+
doCreateGridControlWithPreviousState() {
|
|
705
|
+
const uiState = this.workspaceMemento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY];
|
|
706
|
+
if (uiState?.serializedGrid) {
|
|
707
|
+
try {
|
|
708
|
+
this.mostRecentActiveGroups = uiState.mostRecentActiveGroups;
|
|
709
|
+
this.doCreateGridControlWithState(uiState.serializedGrid, uiState.activeGroup);
|
|
710
|
+
this._activeGroup.focus();
|
|
711
|
+
}
|
|
712
|
+
catch (error) {
|
|
713
|
+
onUnexpectedError(( new Error(
|
|
714
|
+
`Error restoring editor grid widget: ${error} (with state: ${JSON.stringify(uiState)})`
|
|
715
|
+
)));
|
|
716
|
+
this.groupViews.forEach(group => group.dispose());
|
|
717
|
+
this.groupViews.clear();
|
|
718
|
+
this.mostRecentActiveGroups = [];
|
|
719
|
+
return false;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
return true;
|
|
723
|
+
}
|
|
724
|
+
doCreateGridControlWithState(serializedGrid, activeGroupId, editorGroupViewsToReuse) {
|
|
725
|
+
let reuseGroupViews;
|
|
726
|
+
if (editorGroupViewsToReuse) {
|
|
727
|
+
reuseGroupViews = editorGroupViewsToReuse.slice(0);
|
|
728
|
+
}
|
|
729
|
+
else {
|
|
730
|
+
reuseGroupViews = [];
|
|
731
|
+
}
|
|
732
|
+
const groupViews = [];
|
|
733
|
+
const gridWidget = SerializableGrid.deserialize(serializedGrid, {
|
|
734
|
+
fromJSON: (serializedEditorGroup) => {
|
|
735
|
+
let groupView;
|
|
736
|
+
if (reuseGroupViews.length > 0) {
|
|
737
|
+
groupView = reuseGroupViews.shift();
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
groupView = this.doCreateGroupView(serializedEditorGroup);
|
|
741
|
+
}
|
|
742
|
+
groupViews.push(groupView);
|
|
743
|
+
if (groupView.id === activeGroupId) {
|
|
744
|
+
this.doSetGroupActive(groupView);
|
|
745
|
+
}
|
|
746
|
+
return groupView;
|
|
747
|
+
}
|
|
748
|
+
}, { styles: { separatorBorder: this.gridSeparatorBorder } });
|
|
749
|
+
if (!this._activeGroup) {
|
|
750
|
+
this.doSetGroupActive(groupViews[0]);
|
|
751
|
+
}
|
|
752
|
+
if (( this.mostRecentActiveGroups.some(groupId => !this.getGroup(groupId)))) {
|
|
753
|
+
this.mostRecentActiveGroups = ( groupViews.map(group => group.id));
|
|
754
|
+
}
|
|
755
|
+
this.doSetGridWidget(gridWidget);
|
|
756
|
+
}
|
|
757
|
+
doSetGridWidget(gridWidget) {
|
|
758
|
+
let boundarySashes = {};
|
|
759
|
+
if (this.gridWidget) {
|
|
760
|
+
boundarySashes = this.gridWidget.boundarySashes;
|
|
761
|
+
this.gridWidget.dispose();
|
|
762
|
+
}
|
|
763
|
+
this.gridWidget = gridWidget;
|
|
764
|
+
this.gridWidget.boundarySashes = boundarySashes;
|
|
765
|
+
this.gridWidgetView.gridWidget = gridWidget;
|
|
766
|
+
this._onDidChangeSizeConstraints.input = gridWidget.onDidChange;
|
|
767
|
+
this._onDidScroll.input = gridWidget.onDidScroll;
|
|
768
|
+
this.onDidSetGridWidget.fire(undefined);
|
|
769
|
+
}
|
|
770
|
+
updateContainer() {
|
|
771
|
+
const container = assertIsDefined(this.container);
|
|
772
|
+
container.classList.toggle('empty', this.isEmpty);
|
|
773
|
+
}
|
|
774
|
+
notifyGroupIndexChange() {
|
|
775
|
+
this.getGroups(2 ).forEach((group, index) => group.notifyIndexChanged(index));
|
|
776
|
+
}
|
|
777
|
+
get isEmpty() {
|
|
778
|
+
return this.count === 1 && this._activeGroup.isEmpty;
|
|
779
|
+
}
|
|
780
|
+
setBoundarySashes(sashes) {
|
|
781
|
+
this.gridWidget.boundarySashes = sashes;
|
|
782
|
+
this.centeredLayoutWidget.boundarySashes = sashes;
|
|
783
|
+
}
|
|
784
|
+
layout(width, height, top, left) {
|
|
785
|
+
this._top = top;
|
|
786
|
+
this._left = left;
|
|
787
|
+
const contentAreaSize = super.layoutContents(width, height).contentSize;
|
|
788
|
+
this.doLayout(Dimension.lift(contentAreaSize), top, left);
|
|
789
|
+
}
|
|
790
|
+
doLayout(dimension, top = this._top, left = this._left) {
|
|
791
|
+
this._contentDimension = dimension;
|
|
792
|
+
this.centeredLayoutWidget.layout(this._contentDimension.width, this._contentDimension.height, top, left);
|
|
793
|
+
this._onDidLayout.fire(dimension);
|
|
794
|
+
}
|
|
795
|
+
saveState() {
|
|
796
|
+
if (this.gridWidget) {
|
|
797
|
+
const uiState = {
|
|
798
|
+
serializedGrid: this.gridWidget.serialize(),
|
|
799
|
+
activeGroup: this._activeGroup.id,
|
|
800
|
+
mostRecentActiveGroups: this.mostRecentActiveGroups
|
|
801
|
+
};
|
|
802
|
+
if (this.isEmpty) {
|
|
803
|
+
delete this.workspaceMemento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY];
|
|
804
|
+
}
|
|
805
|
+
else {
|
|
806
|
+
this.workspaceMemento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY] = uiState;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
if (this.centeredLayoutWidget) {
|
|
810
|
+
const centeredLayoutState = this.centeredLayoutWidget.state;
|
|
811
|
+
if (this.centeredLayoutWidget.isDefault(centeredLayoutState)) {
|
|
812
|
+
delete this.profileMemento[EditorPart.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY];
|
|
813
|
+
}
|
|
814
|
+
else {
|
|
815
|
+
this.profileMemento[EditorPart.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY] = centeredLayoutState;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
super.saveState();
|
|
819
|
+
}
|
|
820
|
+
toJSON() {
|
|
821
|
+
return {
|
|
822
|
+
type: "workbench.parts.editor"
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
dispose() {
|
|
826
|
+
this.groupViews.forEach(group => group.dispose());
|
|
827
|
+
this.groupViews.clear();
|
|
828
|
+
this.gridWidget?.dispose();
|
|
829
|
+
super.dispose();
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY = 'editorpart.state';
|
|
833
|
+
EditorPart.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY = 'editorpart.centeredview';
|
|
834
|
+
EditorPart = ( __decorate([
|
|
835
|
+
( __param(0, IInstantiationService)),
|
|
836
|
+
( __param(1, IThemeService)),
|
|
837
|
+
( __param(2, IConfigurationService)),
|
|
838
|
+
( __param(3, IStorageService)),
|
|
839
|
+
( __param(4, IWorkbenchLayoutService))
|
|
840
|
+
], EditorPart));
|
|
841
|
+
export { EditorPart };
|