@codingame/monaco-vscode-api 1.79.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.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 +535 -535
- 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,243 @@
|
|
|
1
|
+
import './media/notabstitlecontrol.css.js';
|
|
2
|
+
import { EditorResourceAccessor, SideBySideEditor } from '../../../common/editor.js';
|
|
3
|
+
import { TitleControl } from './titleControl.js';
|
|
4
|
+
import { ResourceLabel } from '../../labels.js';
|
|
5
|
+
import { TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND } from '../../../common/theme.js';
|
|
6
|
+
import { Gesture, EventType as EventType$1 } from 'monaco-editor/esm/vs/base/browser/touch.js';
|
|
7
|
+
import { addDisposableListener, EventType, EventHelper, isAncestor, Dimension } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
8
|
+
import { CLOSE_EDITOR_COMMAND_ID, UNLOCK_GROUP_COMMAND_ID } from './editorCommands.js';
|
|
9
|
+
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
10
|
+
import { assertIsDefined, withNullAsUndefined, assertAllDefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
11
|
+
import { equals } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
12
|
+
import { toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
13
|
+
import { defaultBreadcrumbsWidgetStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
14
|
+
class NoTabsTitleControl extends TitleControl {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.activeLabel = Object.create(null);
|
|
18
|
+
}
|
|
19
|
+
create(parent) {
|
|
20
|
+
const titleContainer = this.titleContainer = parent;
|
|
21
|
+
titleContainer.draggable = true;
|
|
22
|
+
this.registerContainerListeners(titleContainer);
|
|
23
|
+
this._register(Gesture.addTarget(titleContainer));
|
|
24
|
+
const labelContainer = document.createElement('div');
|
|
25
|
+
labelContainer.classList.add('label-container');
|
|
26
|
+
titleContainer.appendChild(labelContainer);
|
|
27
|
+
this.editorLabel = this._register(this.instantiationService.createInstance(ResourceLabel, labelContainer, undefined)).element;
|
|
28
|
+
this._register(addDisposableListener(this.editorLabel.element, EventType.CLICK, e => this.onTitleLabelClick(e)));
|
|
29
|
+
this.createBreadcrumbsControl(labelContainer, { showFileIcons: false, showSymbolIcons: true, showDecorationColors: false, widgetStyles: { ...defaultBreadcrumbsWidgetStyles, breadcrumbsBackground: ( Color.transparent.toString()) }, showPlaceholder: false });
|
|
30
|
+
titleContainer.classList.toggle('breadcrumbs', Boolean(this.breadcrumbsControl));
|
|
31
|
+
this._register(toDisposable(() => titleContainer.classList.remove('breadcrumbs')));
|
|
32
|
+
const actionsContainer = document.createElement('div');
|
|
33
|
+
actionsContainer.classList.add('title-actions');
|
|
34
|
+
titleContainer.appendChild(actionsContainer);
|
|
35
|
+
this.createEditorActionsToolBar(actionsContainer);
|
|
36
|
+
}
|
|
37
|
+
registerContainerListeners(titleContainer) {
|
|
38
|
+
this.enableGroupDragging(titleContainer);
|
|
39
|
+
this._register(addDisposableListener(titleContainer, EventType.DBLCLICK, e => this.onTitleDoubleClick(e)));
|
|
40
|
+
this._register(addDisposableListener(titleContainer, EventType.AUXCLICK, e => this.onTitleAuxClick(e)));
|
|
41
|
+
this._register(addDisposableListener(titleContainer, EventType$1.Tap, (e) => this.onTitleTap(e)));
|
|
42
|
+
for (const event of [EventType.CONTEXT_MENU, EventType$1.Contextmenu]) {
|
|
43
|
+
this._register(addDisposableListener(titleContainer, event, e => {
|
|
44
|
+
if (this.group.activeEditor) {
|
|
45
|
+
this.onContextMenu(this.group.activeEditor, e, titleContainer);
|
|
46
|
+
}
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
onTitleLabelClick(e) {
|
|
51
|
+
EventHelper.stop(e, false);
|
|
52
|
+
setTimeout(() => this.quickInputService.quickAccess.show());
|
|
53
|
+
}
|
|
54
|
+
onTitleDoubleClick(e) {
|
|
55
|
+
EventHelper.stop(e);
|
|
56
|
+
this.group.pinEditor();
|
|
57
|
+
}
|
|
58
|
+
onTitleAuxClick(e) {
|
|
59
|
+
if (e.button === 1 && this.group.activeEditor) {
|
|
60
|
+
EventHelper.stop(e, true );
|
|
61
|
+
this.group.closeEditor(this.group.activeEditor);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
onTitleTap(e) {
|
|
65
|
+
const target = e.initialTarget;
|
|
66
|
+
if (!(target instanceof HTMLElement) || !this.editorLabel || !isAncestor(target, this.editorLabel.element)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
setTimeout(() => this.quickInputService.quickAccess.show(), 50);
|
|
70
|
+
}
|
|
71
|
+
openEditor(editor) {
|
|
72
|
+
this.doHandleOpenEditor();
|
|
73
|
+
}
|
|
74
|
+
openEditors(editors) {
|
|
75
|
+
this.doHandleOpenEditor();
|
|
76
|
+
}
|
|
77
|
+
doHandleOpenEditor() {
|
|
78
|
+
const activeEditorChanged = this.ifActiveEditorChanged(() => this.redraw());
|
|
79
|
+
if (!activeEditorChanged) {
|
|
80
|
+
this.ifActiveEditorPropertiesChanged(() => this.redraw());
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
closeEditor(editor, index) {
|
|
84
|
+
this.ifActiveEditorChanged(() => this.redraw());
|
|
85
|
+
}
|
|
86
|
+
closeEditors(editors) {
|
|
87
|
+
this.ifActiveEditorChanged(() => this.redraw());
|
|
88
|
+
}
|
|
89
|
+
moveEditor(editor, fromIndex, targetIndex) {
|
|
90
|
+
this.ifActiveEditorChanged(() => this.redraw());
|
|
91
|
+
}
|
|
92
|
+
pinEditor(editor) {
|
|
93
|
+
this.ifEditorIsActive(editor, () => this.redraw());
|
|
94
|
+
}
|
|
95
|
+
stickEditor(editor) {
|
|
96
|
+
}
|
|
97
|
+
unstickEditor(editor) {
|
|
98
|
+
}
|
|
99
|
+
setActive(isActive) {
|
|
100
|
+
this.redraw();
|
|
101
|
+
}
|
|
102
|
+
updateEditorLabel(editor) {
|
|
103
|
+
this.ifEditorIsActive(editor, () => this.redraw());
|
|
104
|
+
}
|
|
105
|
+
updateEditorDirty(editor) {
|
|
106
|
+
this.ifEditorIsActive(editor, () => {
|
|
107
|
+
const titleContainer = assertIsDefined(this.titleContainer);
|
|
108
|
+
if (editor.isDirty() && !editor.isSaving()) {
|
|
109
|
+
titleContainer.classList.add('dirty');
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
titleContainer.classList.remove('dirty');
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
updateOptions(oldOptions, newOptions) {
|
|
117
|
+
if (oldOptions.labelFormat !== newOptions.labelFormat || !equals(oldOptions.decorations, newOptions.decorations)) {
|
|
118
|
+
this.redraw();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
updateStyles() {
|
|
122
|
+
this.redraw();
|
|
123
|
+
}
|
|
124
|
+
handleBreadcrumbsEnablementChange() {
|
|
125
|
+
const titleContainer = assertIsDefined(this.titleContainer);
|
|
126
|
+
titleContainer.classList.toggle('breadcrumbs', Boolean(this.breadcrumbsControl));
|
|
127
|
+
this.redraw();
|
|
128
|
+
}
|
|
129
|
+
ifActiveEditorChanged(fn) {
|
|
130
|
+
if (!this.activeLabel.editor && this.group.activeEditor ||
|
|
131
|
+
this.activeLabel.editor && !this.group.activeEditor ||
|
|
132
|
+
(!this.activeLabel.editor || !this.group.isActive(this.activeLabel.editor))
|
|
133
|
+
) {
|
|
134
|
+
fn();
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
ifActiveEditorPropertiesChanged(fn) {
|
|
140
|
+
if (!this.activeLabel.editor || !this.group.activeEditor) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (this.activeLabel.pinned !== this.group.isPinned(this.group.activeEditor)) {
|
|
144
|
+
fn();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
ifEditorIsActive(editor, fn) {
|
|
148
|
+
if (this.group.isActive(editor)) {
|
|
149
|
+
fn();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
redraw() {
|
|
153
|
+
const editor = withNullAsUndefined(this.group.activeEditor);
|
|
154
|
+
const options = this.accessor.partOptions;
|
|
155
|
+
const isEditorPinned = editor ? this.group.isPinned(editor) : false;
|
|
156
|
+
const isGroupActive = this.accessor.activeGroup === this.group;
|
|
157
|
+
this.activeLabel = { editor, pinned: isEditorPinned };
|
|
158
|
+
if (this.breadcrumbsControl) {
|
|
159
|
+
if (isGroupActive) {
|
|
160
|
+
this.breadcrumbsControl.update();
|
|
161
|
+
this.breadcrumbsControl.domNode.classList.toggle('preview', !isEditorPinned);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.breadcrumbsControl.hide();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const [titleContainer, editorLabel] = assertAllDefined(this.titleContainer, this.editorLabel);
|
|
168
|
+
if (!editor) {
|
|
169
|
+
titleContainer.classList.remove('dirty');
|
|
170
|
+
editorLabel.clear();
|
|
171
|
+
this.clearEditorActionsToolbar();
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
this.updateEditorDirty(editor);
|
|
175
|
+
const { labelFormat } = this.accessor.partOptions;
|
|
176
|
+
let description;
|
|
177
|
+
if (this.breadcrumbsControl && !this.breadcrumbsControl.isHidden()) {
|
|
178
|
+
description = '';
|
|
179
|
+
}
|
|
180
|
+
else if (labelFormat === 'default' && !isGroupActive) {
|
|
181
|
+
description = '';
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
description = editor.getDescription(this.getVerbosity(labelFormat)) || '';
|
|
185
|
+
}
|
|
186
|
+
let title = editor.getTitle(2 );
|
|
187
|
+
if (description === title) {
|
|
188
|
+
title = '';
|
|
189
|
+
}
|
|
190
|
+
editorLabel.setResource({
|
|
191
|
+
resource: EditorResourceAccessor.getOriginalUri(editor, { supportSideBySide: SideBySideEditor.BOTH }),
|
|
192
|
+
name: editor.getName(),
|
|
193
|
+
description
|
|
194
|
+
}, {
|
|
195
|
+
title,
|
|
196
|
+
italic: !isEditorPinned,
|
|
197
|
+
extraClasses: ['no-tabs', 'title-label'].concat(editor.getLabelExtraClasses()),
|
|
198
|
+
fileDecorations: {
|
|
199
|
+
colors: Boolean(options.decorations?.colors),
|
|
200
|
+
badges: Boolean(options.decorations?.badges)
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
if (isGroupActive) {
|
|
204
|
+
titleContainer.style.color = this.getColor(TAB_ACTIVE_FOREGROUND) || '';
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
titleContainer.style.color = this.getColor(TAB_UNFOCUSED_ACTIVE_FOREGROUND) || '';
|
|
208
|
+
}
|
|
209
|
+
this.updateEditorActionsToolbar();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
getVerbosity(style) {
|
|
213
|
+
switch (style) {
|
|
214
|
+
case 'short': return 0 ;
|
|
215
|
+
case 'long': return 2 ;
|
|
216
|
+
default: return 1 ;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
prepareEditorActions(editorActions) {
|
|
220
|
+
const isGroupActive = this.accessor.activeGroup === this.group;
|
|
221
|
+
if (isGroupActive) {
|
|
222
|
+
return editorActions;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
return {
|
|
226
|
+
primary: editorActions.primary.filter(action => action.id === CLOSE_EDITOR_COMMAND_ID || action.id === UNLOCK_GROUP_COMMAND_ID),
|
|
227
|
+
secondary: editorActions.secondary
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
getHeight() {
|
|
232
|
+
return {
|
|
233
|
+
total: NoTabsTitleControl.HEIGHT,
|
|
234
|
+
offset: 0
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
layout(dimensions) {
|
|
238
|
+
this.breadcrumbsControl?.layout(undefined);
|
|
239
|
+
return ( new Dimension(dimensions.container.width, this.getHeight().total));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
NoTabsTitleControl.HEIGHT = 35;
|
|
243
|
+
export { NoTabsTitleControl };
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import './media/sidebysideeditor.css.js';
|
|
3
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
4
|
+
import { Dimension, $, multibyteAwareBtoa, clearNode } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
5
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
6
|
+
import { SIDE_BY_SIDE_EDITOR_ID, SideBySideEditor as SideBySideEditor$1, EditorExtensions, isEditorPaneWithSelection } from '../../../common/editor.js';
|
|
7
|
+
import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js';
|
|
8
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
9
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
10
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
11
|
+
import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js';
|
|
12
|
+
import { SplitView, Sizing } from 'monaco-editor/esm/vs/base/browser/ui/splitview/splitview.js';
|
|
13
|
+
import { Emitter, Relay, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
14
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
15
|
+
import { assertIsDefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
16
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
17
|
+
import { DEFAULT_EDITOR_MIN_DIMENSIONS } from './editor.js';
|
|
18
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
19
|
+
import { SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER, SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER } from '../../../common/theme.js';
|
|
20
|
+
import { AbstractEditorWithViewState } from './editorWithViewState.js';
|
|
21
|
+
import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
22
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
23
|
+
import { isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
24
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
25
|
+
function isSideBySideEditorViewState(thing) {
|
|
26
|
+
const candidate = thing;
|
|
27
|
+
return typeof candidate?.primary === 'object' && typeof candidate.secondary === 'object';
|
|
28
|
+
}
|
|
29
|
+
let SideBySideEditor = class SideBySideEditor extends AbstractEditorWithViewState {
|
|
30
|
+
get minimumPrimaryWidth() { return this.primaryEditorPane ? this.primaryEditorPane.minimumWidth : 0; }
|
|
31
|
+
get maximumPrimaryWidth() { return this.primaryEditorPane ? this.primaryEditorPane.maximumWidth : Number.POSITIVE_INFINITY; }
|
|
32
|
+
get minimumPrimaryHeight() { return this.primaryEditorPane ? this.primaryEditorPane.minimumHeight : 0; }
|
|
33
|
+
get maximumPrimaryHeight() { return this.primaryEditorPane ? this.primaryEditorPane.maximumHeight : Number.POSITIVE_INFINITY; }
|
|
34
|
+
get minimumSecondaryWidth() { return this.secondaryEditorPane ? this.secondaryEditorPane.minimumWidth : 0; }
|
|
35
|
+
get maximumSecondaryWidth() { return this.secondaryEditorPane ? this.secondaryEditorPane.maximumWidth : Number.POSITIVE_INFINITY; }
|
|
36
|
+
get minimumSecondaryHeight() { return this.secondaryEditorPane ? this.secondaryEditorPane.minimumHeight : 0; }
|
|
37
|
+
get maximumSecondaryHeight() { return this.secondaryEditorPane ? this.secondaryEditorPane.maximumHeight : Number.POSITIVE_INFINITY; }
|
|
38
|
+
set minimumWidth(value) { }
|
|
39
|
+
set maximumWidth(value) { }
|
|
40
|
+
set minimumHeight(value) { }
|
|
41
|
+
set maximumHeight(value) { }
|
|
42
|
+
get minimumWidth() { return this.minimumPrimaryWidth + this.minimumSecondaryWidth; }
|
|
43
|
+
get maximumWidth() { return this.maximumPrimaryWidth + this.maximumSecondaryWidth; }
|
|
44
|
+
get minimumHeight() { return this.minimumPrimaryHeight + this.minimumSecondaryHeight; }
|
|
45
|
+
get maximumHeight() { return this.maximumPrimaryHeight + this.maximumSecondaryHeight; }
|
|
46
|
+
constructor(telemetryService, instantiationService, themeService, storageService, configurationService, textResourceConfigurationService, editorService, editorGroupService) {
|
|
47
|
+
super(SideBySideEditor.ID, SideBySideEditor.VIEW_STATE_PREFERENCE_KEY, telemetryService, instantiationService, storageService, textResourceConfigurationService, themeService, editorService, editorGroupService);
|
|
48
|
+
this.configurationService = configurationService;
|
|
49
|
+
this.onDidCreateEditors = this._register(( (new Emitter())));
|
|
50
|
+
this._onDidChangeSizeConstraints = this._register(( (new Relay())));
|
|
51
|
+
this.onDidChangeSizeConstraints = Event.any(this.onDidCreateEditors.event, this._onDidChangeSizeConstraints.event);
|
|
52
|
+
this._onDidChangeSelection = this._register(( (new Emitter())));
|
|
53
|
+
this.onDidChangeSelection = this._onDidChangeSelection.event;
|
|
54
|
+
this.primaryEditorPane = undefined;
|
|
55
|
+
this.secondaryEditorPane = undefined;
|
|
56
|
+
this.splitviewDisposables = this._register(( (new DisposableStore())));
|
|
57
|
+
this.editorDisposables = this._register(( (new DisposableStore())));
|
|
58
|
+
this.orientation = this.configurationService.getValue(SideBySideEditor.SIDE_BY_SIDE_LAYOUT_SETTING) === 'vertical' ? 0 : 1 ;
|
|
59
|
+
this.dimension = ( (new Dimension(0, 0)));
|
|
60
|
+
this.lastFocusedSide = undefined;
|
|
61
|
+
this.registerListeners();
|
|
62
|
+
}
|
|
63
|
+
registerListeners() {
|
|
64
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
|
|
65
|
+
}
|
|
66
|
+
onConfigurationUpdated(event) {
|
|
67
|
+
if (event.affectsConfiguration(SideBySideEditor.SIDE_BY_SIDE_LAYOUT_SETTING)) {
|
|
68
|
+
this.orientation = this.configurationService.getValue(SideBySideEditor.SIDE_BY_SIDE_LAYOUT_SETTING) === 'vertical' ? 0 : 1 ;
|
|
69
|
+
if (this.splitview) {
|
|
70
|
+
this.recreateSplitview();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
recreateSplitview() {
|
|
75
|
+
const container = assertIsDefined(this.getContainer());
|
|
76
|
+
const ratio = this.getSplitViewRatio();
|
|
77
|
+
if (this.splitview) {
|
|
78
|
+
container.removeChild(this.splitview.el);
|
|
79
|
+
this.splitviewDisposables.clear();
|
|
80
|
+
}
|
|
81
|
+
this.createSplitView(container, ratio);
|
|
82
|
+
this.layout(this.dimension);
|
|
83
|
+
}
|
|
84
|
+
getSplitViewRatio() {
|
|
85
|
+
let ratio = undefined;
|
|
86
|
+
if (this.splitview) {
|
|
87
|
+
const leftViewSize = this.splitview.getViewSize(0);
|
|
88
|
+
const rightViewSize = this.splitview.getViewSize(1);
|
|
89
|
+
if (Math.abs(leftViewSize - rightViewSize) > 1) {
|
|
90
|
+
const totalSize = this.splitview.orientation === 1 ? this.dimension.width : this.dimension.height;
|
|
91
|
+
ratio = leftViewSize / totalSize;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return ratio;
|
|
95
|
+
}
|
|
96
|
+
createEditor(parent) {
|
|
97
|
+
parent.classList.add('side-by-side-editor');
|
|
98
|
+
this.secondaryEditorContainer = $('.side-by-side-editor-container.editor-instance');
|
|
99
|
+
this.primaryEditorContainer = $('.side-by-side-editor-container.editor-instance');
|
|
100
|
+
this.createSplitView(parent);
|
|
101
|
+
}
|
|
102
|
+
createSplitView(parent, ratio) {
|
|
103
|
+
this.splitview = this.splitviewDisposables.add(( (new SplitView(parent, { orientation: this.orientation }))));
|
|
104
|
+
this.splitviewDisposables.add(this.splitview.onDidSashReset(() => this.splitview?.distributeViewSizes()));
|
|
105
|
+
if (this.orientation === 1 ) {
|
|
106
|
+
this.splitview.orthogonalEndSash = this._boundarySashes?.bottom;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.splitview.orthogonalStartSash = this._boundarySashes?.left;
|
|
110
|
+
this.splitview.orthogonalEndSash = this._boundarySashes?.right;
|
|
111
|
+
}
|
|
112
|
+
let leftSizing = Sizing.Distribute;
|
|
113
|
+
let rightSizing = Sizing.Distribute;
|
|
114
|
+
if (ratio) {
|
|
115
|
+
const totalSize = this.splitview.orientation === 1 ? this.dimension.width : this.dimension.height;
|
|
116
|
+
leftSizing = Math.round(totalSize * ratio);
|
|
117
|
+
rightSizing = totalSize - leftSizing;
|
|
118
|
+
this.splitview.layout(this.orientation === 1 ? this.dimension.width : this.dimension.height);
|
|
119
|
+
}
|
|
120
|
+
const secondaryEditorContainer = assertIsDefined(this.secondaryEditorContainer);
|
|
121
|
+
this.splitview.addView({
|
|
122
|
+
element: secondaryEditorContainer,
|
|
123
|
+
layout: size => this.layoutPane(this.secondaryEditorPane, size),
|
|
124
|
+
minimumSize: this.orientation === 1 ? DEFAULT_EDITOR_MIN_DIMENSIONS.width : DEFAULT_EDITOR_MIN_DIMENSIONS.height,
|
|
125
|
+
maximumSize: Number.POSITIVE_INFINITY,
|
|
126
|
+
onDidChange: Event.None
|
|
127
|
+
}, leftSizing);
|
|
128
|
+
const primaryEditorContainer = assertIsDefined(this.primaryEditorContainer);
|
|
129
|
+
this.splitview.addView({
|
|
130
|
+
element: primaryEditorContainer,
|
|
131
|
+
layout: size => this.layoutPane(this.primaryEditorPane, size),
|
|
132
|
+
minimumSize: this.orientation === 1 ? DEFAULT_EDITOR_MIN_DIMENSIONS.width : DEFAULT_EDITOR_MIN_DIMENSIONS.height,
|
|
133
|
+
maximumSize: Number.POSITIVE_INFINITY,
|
|
134
|
+
onDidChange: Event.None
|
|
135
|
+
}, rightSizing);
|
|
136
|
+
this.updateStyles();
|
|
137
|
+
}
|
|
138
|
+
getTitle() {
|
|
139
|
+
if (this.input) {
|
|
140
|
+
return this.input.getName();
|
|
141
|
+
}
|
|
142
|
+
return (
|
|
143
|
+
(localize('sideBySideEditor', "Side by Side Editor"))
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
async setInput(input, options, context, token) {
|
|
147
|
+
const oldInput = this.input;
|
|
148
|
+
await super.setInput(input, options, context, token);
|
|
149
|
+
if (!oldInput || !input.matches(oldInput)) {
|
|
150
|
+
if (oldInput) {
|
|
151
|
+
this.disposeEditors();
|
|
152
|
+
}
|
|
153
|
+
this.createEditors(input);
|
|
154
|
+
}
|
|
155
|
+
const { primary, secondary, viewState } = this.loadViewState(input, options, context);
|
|
156
|
+
this.lastFocusedSide = viewState?.focus;
|
|
157
|
+
if (typeof viewState?.ratio === 'number' && this.splitview) {
|
|
158
|
+
const totalSize = this.splitview.orientation === 1 ? this.dimension.width : this.dimension.height;
|
|
159
|
+
this.splitview.resizeView(0, Math.round(totalSize * viewState.ratio));
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
this.splitview?.distributeViewSizes();
|
|
163
|
+
}
|
|
164
|
+
await Promise.all([
|
|
165
|
+
this.secondaryEditorPane?.setInput(input.secondary, secondary, context, token),
|
|
166
|
+
this.primaryEditorPane?.setInput(input.primary, primary, context, token)
|
|
167
|
+
]);
|
|
168
|
+
if (typeof options?.target === 'number') {
|
|
169
|
+
this.lastFocusedSide = options.target;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
loadViewState(input, options, context) {
|
|
173
|
+
const viewState = isSideBySideEditorViewState(options?.viewState) ? options?.viewState : this.loadEditorViewState(input, context);
|
|
174
|
+
let primaryOptions = Object.create(null);
|
|
175
|
+
let secondaryOptions = undefined;
|
|
176
|
+
if (options?.target === SideBySideEditor$1.SECONDARY) {
|
|
177
|
+
secondaryOptions = { ...options };
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
primaryOptions = { ...options };
|
|
181
|
+
}
|
|
182
|
+
primaryOptions.viewState = viewState?.primary;
|
|
183
|
+
if (viewState?.secondary) {
|
|
184
|
+
if (!secondaryOptions) {
|
|
185
|
+
secondaryOptions = { viewState: viewState.secondary };
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
secondaryOptions.viewState = viewState?.secondary;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return { primary: primaryOptions, secondary: secondaryOptions, viewState };
|
|
192
|
+
}
|
|
193
|
+
createEditors(newInput) {
|
|
194
|
+
this.secondaryEditorPane = this.doCreateEditor(newInput.secondary, assertIsDefined(this.secondaryEditorContainer));
|
|
195
|
+
this.primaryEditorPane = this.doCreateEditor(newInput.primary, assertIsDefined(this.primaryEditorContainer));
|
|
196
|
+
this.layout(this.dimension);
|
|
197
|
+
this._onDidChangeSizeConstraints.input = Event.any(( (Event.map(this.secondaryEditorPane.onDidChangeSizeConstraints, () => undefined))), ( (Event.map(this.primaryEditorPane.onDidChangeSizeConstraints, () => undefined))));
|
|
198
|
+
this.onDidCreateEditors.fire(undefined);
|
|
199
|
+
this.editorDisposables.add(this.primaryEditorPane.onDidFocus(() => this.onDidFocusChange(SideBySideEditor$1.PRIMARY)));
|
|
200
|
+
this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(() => this.onDidFocusChange(SideBySideEditor$1.SECONDARY)));
|
|
201
|
+
}
|
|
202
|
+
doCreateEditor(editorInput, container) {
|
|
203
|
+
const editorPaneDescriptor = ( (Registry.as(EditorExtensions.EditorPane))).getEditorPane(editorInput);
|
|
204
|
+
if (!editorPaneDescriptor) {
|
|
205
|
+
throw new Error('No editor pane descriptor for editor found');
|
|
206
|
+
}
|
|
207
|
+
const editorPane = editorPaneDescriptor.instantiate(this.instantiationService);
|
|
208
|
+
editorPane.create(container);
|
|
209
|
+
editorPane.setVisible(this.isVisible(), this.group);
|
|
210
|
+
if (isEditorPaneWithSelection(editorPane)) {
|
|
211
|
+
this.editorDisposables.add(editorPane.onDidChangeSelection(e => this._onDidChangeSelection.fire(e)));
|
|
212
|
+
}
|
|
213
|
+
this.editorDisposables.add(editorPane);
|
|
214
|
+
return editorPane;
|
|
215
|
+
}
|
|
216
|
+
onDidFocusChange(side) {
|
|
217
|
+
this.lastFocusedSide = side;
|
|
218
|
+
this._onDidChangeControl.fire();
|
|
219
|
+
}
|
|
220
|
+
getSelection() {
|
|
221
|
+
const lastFocusedEditorPane = this.getLastFocusedEditorPane();
|
|
222
|
+
if (isEditorPaneWithSelection(lastFocusedEditorPane)) {
|
|
223
|
+
const selection = lastFocusedEditorPane.getSelection();
|
|
224
|
+
if (selection) {
|
|
225
|
+
return (
|
|
226
|
+
(new SideBySideAwareEditorPaneSelection(
|
|
227
|
+
selection,
|
|
228
|
+
lastFocusedEditorPane === this.primaryEditorPane ? SideBySideEditor$1.PRIMARY : SideBySideEditor$1.SECONDARY
|
|
229
|
+
))
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return undefined;
|
|
234
|
+
}
|
|
235
|
+
setOptions(options) {
|
|
236
|
+
super.setOptions(options);
|
|
237
|
+
if (typeof options?.target === 'number') {
|
|
238
|
+
this.lastFocusedSide = options.target;
|
|
239
|
+
}
|
|
240
|
+
this.getLastFocusedEditorPane()?.setOptions(options);
|
|
241
|
+
}
|
|
242
|
+
setEditorVisible(visible, group) {
|
|
243
|
+
this.primaryEditorPane?.setVisible(visible, group);
|
|
244
|
+
this.secondaryEditorPane?.setVisible(visible, group);
|
|
245
|
+
super.setEditorVisible(visible, group);
|
|
246
|
+
}
|
|
247
|
+
clearInput() {
|
|
248
|
+
super.clearInput();
|
|
249
|
+
this.primaryEditorPane?.clearInput();
|
|
250
|
+
this.secondaryEditorPane?.clearInput();
|
|
251
|
+
this.disposeEditors();
|
|
252
|
+
}
|
|
253
|
+
focus() {
|
|
254
|
+
this.getLastFocusedEditorPane()?.focus();
|
|
255
|
+
}
|
|
256
|
+
getLastFocusedEditorPane() {
|
|
257
|
+
if (this.lastFocusedSide === SideBySideEditor$1.SECONDARY) {
|
|
258
|
+
return this.secondaryEditorPane;
|
|
259
|
+
}
|
|
260
|
+
return this.primaryEditorPane;
|
|
261
|
+
}
|
|
262
|
+
layout(dimension) {
|
|
263
|
+
this.dimension = dimension;
|
|
264
|
+
const splitview = assertIsDefined(this.splitview);
|
|
265
|
+
splitview.layout(this.orientation === 1 ? dimension.width : dimension.height);
|
|
266
|
+
}
|
|
267
|
+
setBoundarySashes(sashes) {
|
|
268
|
+
this._boundarySashes = sashes;
|
|
269
|
+
if (this.splitview) {
|
|
270
|
+
this.splitview.orthogonalEndSash = sashes.bottom;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
layoutPane(pane, size) {
|
|
274
|
+
pane?.layout(this.orientation === 1 ? ( (new Dimension(size, this.dimension.height))) : ( (new Dimension(this.dimension.width, size))));
|
|
275
|
+
}
|
|
276
|
+
getControl() {
|
|
277
|
+
return this.getLastFocusedEditorPane()?.getControl();
|
|
278
|
+
}
|
|
279
|
+
getPrimaryEditorPane() {
|
|
280
|
+
return this.primaryEditorPane;
|
|
281
|
+
}
|
|
282
|
+
getSecondaryEditorPane() {
|
|
283
|
+
return this.secondaryEditorPane;
|
|
284
|
+
}
|
|
285
|
+
tracksEditorViewState(input) {
|
|
286
|
+
return input instanceof SideBySideEditorInput;
|
|
287
|
+
}
|
|
288
|
+
computeEditorViewState(resource) {
|
|
289
|
+
if (!this.input || !isEqual(resource, this.toEditorViewStateResource(this.input))) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const primarViewState = this.primaryEditorPane?.getViewState();
|
|
293
|
+
const secondaryViewState = this.secondaryEditorPane?.getViewState();
|
|
294
|
+
if (!primarViewState || !secondaryViewState) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
primary: primarViewState,
|
|
299
|
+
secondary: secondaryViewState,
|
|
300
|
+
focus: this.lastFocusedSide,
|
|
301
|
+
ratio: this.getSplitViewRatio()
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
toEditorViewStateResource(input) {
|
|
305
|
+
let primary;
|
|
306
|
+
let secondary;
|
|
307
|
+
if (input instanceof SideBySideEditorInput) {
|
|
308
|
+
primary = input.primary.resource;
|
|
309
|
+
secondary = input.secondary.resource;
|
|
310
|
+
}
|
|
311
|
+
if (!secondary || !primary) {
|
|
312
|
+
return undefined;
|
|
313
|
+
}
|
|
314
|
+
return (
|
|
315
|
+
(URI.from({ scheme: 'sideBySide', path: `${multibyteAwareBtoa(( ( secondary.toString())))}${multibyteAwareBtoa(( ( primary.toString())))}` }))
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
updateStyles() {
|
|
319
|
+
super.updateStyles();
|
|
320
|
+
if (this.primaryEditorContainer) {
|
|
321
|
+
if (this.orientation === 1 ) {
|
|
322
|
+
this.primaryEditorContainer.style.borderLeftWidth = '1px';
|
|
323
|
+
this.primaryEditorContainer.style.borderLeftStyle = 'solid';
|
|
324
|
+
this.primaryEditorContainer.style.borderLeftColor = this.getColor(SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER) ?? '';
|
|
325
|
+
this.primaryEditorContainer.style.borderTopWidth = '0';
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
this.primaryEditorContainer.style.borderTopWidth = '1px';
|
|
329
|
+
this.primaryEditorContainer.style.borderTopStyle = 'solid';
|
|
330
|
+
this.primaryEditorContainer.style.borderTopColor = this.getColor(SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER) ?? '';
|
|
331
|
+
this.primaryEditorContainer.style.borderLeftWidth = '0';
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
dispose() {
|
|
336
|
+
this.disposeEditors();
|
|
337
|
+
super.dispose();
|
|
338
|
+
}
|
|
339
|
+
disposeEditors() {
|
|
340
|
+
this.editorDisposables.clear();
|
|
341
|
+
this.secondaryEditorPane = undefined;
|
|
342
|
+
this.primaryEditorPane = undefined;
|
|
343
|
+
this.lastFocusedSide = undefined;
|
|
344
|
+
if (this.secondaryEditorContainer) {
|
|
345
|
+
clearNode(this.secondaryEditorContainer);
|
|
346
|
+
}
|
|
347
|
+
if (this.primaryEditorContainer) {
|
|
348
|
+
clearNode(this.primaryEditorContainer);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
SideBySideEditor.ID = SIDE_BY_SIDE_EDITOR_ID;
|
|
353
|
+
SideBySideEditor.SIDE_BY_SIDE_LAYOUT_SETTING = 'workbench.editor.splitInGroupLayout';
|
|
354
|
+
SideBySideEditor.VIEW_STATE_PREFERENCE_KEY = 'sideBySideEditorViewState';
|
|
355
|
+
SideBySideEditor = ( (__decorate([
|
|
356
|
+
( (__param(0, ITelemetryService))),
|
|
357
|
+
( (__param(1, IInstantiationService))),
|
|
358
|
+
( (__param(2, IThemeService))),
|
|
359
|
+
( (__param(3, IStorageService))),
|
|
360
|
+
( (__param(4, IConfigurationService))),
|
|
361
|
+
( (__param(5, ITextResourceConfigurationService))),
|
|
362
|
+
( (__param(6, IEditorService))),
|
|
363
|
+
( (__param(7, IEditorGroupsService)))
|
|
364
|
+
], SideBySideEditor)));
|
|
365
|
+
class SideBySideAwareEditorPaneSelection {
|
|
366
|
+
constructor(selection, side) {
|
|
367
|
+
this.selection = selection;
|
|
368
|
+
this.side = side;
|
|
369
|
+
}
|
|
370
|
+
compare(other) {
|
|
371
|
+
if (!(other instanceof SideBySideAwareEditorPaneSelection)) {
|
|
372
|
+
return 3 ;
|
|
373
|
+
}
|
|
374
|
+
if (this.side !== other.side) {
|
|
375
|
+
return 3 ;
|
|
376
|
+
}
|
|
377
|
+
return this.selection.compare(other.selection);
|
|
378
|
+
}
|
|
379
|
+
restore(options) {
|
|
380
|
+
const sideBySideEditorOptions = {
|
|
381
|
+
...options,
|
|
382
|
+
target: this.side
|
|
383
|
+
};
|
|
384
|
+
return this.selection.restore(sideBySideEditorOptions);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
export { SideBySideEditor };
|