@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,85 @@
|
|
|
1
|
+
import { defaultGenerator } from 'monaco-editor/esm/vs/base/common/idGenerator.js';
|
|
2
|
+
import { equals } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
3
|
+
var LoadingPhase;
|
|
4
|
+
( (function(LoadingPhase) {
|
|
5
|
+
LoadingPhase[LoadingPhase["Created"] = 1] = "Created";
|
|
6
|
+
LoadingPhase[LoadingPhase["Loading"] = 2] = "Loading";
|
|
7
|
+
LoadingPhase[LoadingPhase["Loaded"] = 3] = "Loaded";
|
|
8
|
+
LoadingPhase[LoadingPhase["Errored"] = 4] = "Errored";
|
|
9
|
+
LoadingPhase[LoadingPhase["Disposed"] = 5] = "Disposed";
|
|
10
|
+
})(LoadingPhase || (LoadingPhase = {})));
|
|
11
|
+
class FileQueryCacheState {
|
|
12
|
+
get cacheKey() {
|
|
13
|
+
if (this.loadingPhase === LoadingPhase.Loaded || !this.previousCacheState) {
|
|
14
|
+
return this._cacheKey;
|
|
15
|
+
}
|
|
16
|
+
return this.previousCacheState.cacheKey;
|
|
17
|
+
}
|
|
18
|
+
get isLoaded() {
|
|
19
|
+
const isLoaded = this.loadingPhase === LoadingPhase.Loaded;
|
|
20
|
+
return isLoaded || !this.previousCacheState ? isLoaded : this.previousCacheState.isLoaded;
|
|
21
|
+
}
|
|
22
|
+
get isUpdating() {
|
|
23
|
+
const isUpdating = this.loadingPhase === LoadingPhase.Loading;
|
|
24
|
+
return isUpdating || !this.previousCacheState ? isUpdating : this.previousCacheState.isUpdating;
|
|
25
|
+
}
|
|
26
|
+
constructor(cacheQuery, loadFn, disposeFn, previousCacheState) {
|
|
27
|
+
this.cacheQuery = cacheQuery;
|
|
28
|
+
this.loadFn = loadFn;
|
|
29
|
+
this.disposeFn = disposeFn;
|
|
30
|
+
this.previousCacheState = previousCacheState;
|
|
31
|
+
this._cacheKey = defaultGenerator.nextId();
|
|
32
|
+
this.query = this.cacheQuery(this._cacheKey);
|
|
33
|
+
this.loadingPhase = LoadingPhase.Created;
|
|
34
|
+
if (this.previousCacheState) {
|
|
35
|
+
const current = Object.assign({}, this.query, { cacheKey: null });
|
|
36
|
+
const previous = Object.assign({}, this.previousCacheState.query, { cacheKey: null });
|
|
37
|
+
if (!equals(current, previous)) {
|
|
38
|
+
this.previousCacheState.dispose();
|
|
39
|
+
this.previousCacheState = undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
load() {
|
|
44
|
+
if (this.isUpdating) {
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
this.loadingPhase = LoadingPhase.Loading;
|
|
48
|
+
this.loadPromise = (async () => {
|
|
49
|
+
try {
|
|
50
|
+
await this.loadFn(this.query);
|
|
51
|
+
this.loadingPhase = LoadingPhase.Loaded;
|
|
52
|
+
if (this.previousCacheState) {
|
|
53
|
+
this.previousCacheState.dispose();
|
|
54
|
+
this.previousCacheState = undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
this.loadingPhase = LoadingPhase.Errored;
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
dispose() {
|
|
65
|
+
if (this.loadPromise) {
|
|
66
|
+
(async () => {
|
|
67
|
+
try {
|
|
68
|
+
await this.loadPromise;
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
}
|
|
72
|
+
this.loadingPhase = LoadingPhase.Disposed;
|
|
73
|
+
this.disposeFn(this._cacheKey);
|
|
74
|
+
})();
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.loadingPhase = LoadingPhase.Disposed;
|
|
78
|
+
}
|
|
79
|
+
if (this.previousCacheState) {
|
|
80
|
+
this.previousCacheState.dispose();
|
|
81
|
+
this.previousCacheState = undefined;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export { FileQueryCacheState };
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { onUnexpectedExternalError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
2
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
3
|
+
import { EditorResourceAccessor, SideBySideEditor } from '../../../common/editor.js';
|
|
4
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
5
|
+
import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
6
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
7
|
+
import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
|
|
8
|
+
import { isNumber } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
9
|
+
import { compare } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
10
|
+
import { groupBy } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
1
11
|
var WorkspaceSymbolProviderRegistry;
|
|
2
12
|
( (function(WorkspaceSymbolProviderRegistry) {
|
|
3
13
|
const _supports = [];
|
|
@@ -24,4 +34,112 @@ var WorkspaceSymbolProviderRegistry;
|
|
|
24
34
|
}
|
|
25
35
|
WorkspaceSymbolProviderRegistry.all = all;
|
|
26
36
|
})(WorkspaceSymbolProviderRegistry || (WorkspaceSymbolProviderRegistry = {})));
|
|
27
|
-
|
|
37
|
+
class WorkspaceSymbolItem {
|
|
38
|
+
constructor(symbol, provider) {
|
|
39
|
+
this.symbol = symbol;
|
|
40
|
+
this.provider = provider;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function getWorkspaceSymbols(query, token = CancellationToken.None) {
|
|
44
|
+
const all = [];
|
|
45
|
+
const promises = ( WorkspaceSymbolProviderRegistry.all().map(async (provider) => {
|
|
46
|
+
try {
|
|
47
|
+
const value = await provider.provideWorkspaceSymbols(query, token);
|
|
48
|
+
if (!value) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
for (const symbol of value) {
|
|
52
|
+
all.push(( new WorkspaceSymbolItem(symbol, provider)));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
onUnexpectedExternalError(err);
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
await Promise.all(promises);
|
|
60
|
+
if (token.isCancellationRequested) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
function compareItems(a, b) {
|
|
64
|
+
let res = compare(a.symbol.name, b.symbol.name);
|
|
65
|
+
if (res === 0) {
|
|
66
|
+
res = a.symbol.kind - b.symbol.kind;
|
|
67
|
+
}
|
|
68
|
+
if (res === 0) {
|
|
69
|
+
res = compare(( a.symbol.location.uri.toString()), ( b.symbol.location.uri.toString()));
|
|
70
|
+
}
|
|
71
|
+
if (res === 0) {
|
|
72
|
+
if (a.symbol.location.range && b.symbol.location.range) {
|
|
73
|
+
if (!Range.areIntersecting(a.symbol.location.range, b.symbol.location.range)) {
|
|
74
|
+
res = Range.compareRangesUsingStarts(a.symbol.location.range, b.symbol.location.range);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else if (a.provider.resolveWorkspaceSymbol && !b.provider.resolveWorkspaceSymbol) {
|
|
78
|
+
res = -1;
|
|
79
|
+
}
|
|
80
|
+
else if (!a.provider.resolveWorkspaceSymbol && b.provider.resolveWorkspaceSymbol) {
|
|
81
|
+
res = 1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (res === 0) {
|
|
85
|
+
res = compare(a.symbol.containerName ?? '', b.symbol.containerName ?? '');
|
|
86
|
+
}
|
|
87
|
+
return res;
|
|
88
|
+
}
|
|
89
|
+
return ( groupBy(all, compareItems).map(group => group[0])).flat();
|
|
90
|
+
}
|
|
91
|
+
function getOutOfWorkspaceEditorResources(accessor) {
|
|
92
|
+
const editorService = accessor.get(IEditorService);
|
|
93
|
+
const contextService = accessor.get(IWorkspaceContextService);
|
|
94
|
+
const fileService = accessor.get(IFileService);
|
|
95
|
+
const resources = ( editorService.editors
|
|
96
|
+
.map(
|
|
97
|
+
editor => EditorResourceAccessor.getOriginalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY })
|
|
98
|
+
))
|
|
99
|
+
.filter(resource => !!resource && !contextService.isInsideWorkspace(resource) && fileService.hasProvider(resource));
|
|
100
|
+
return resources;
|
|
101
|
+
}
|
|
102
|
+
const LINE_COLON_PATTERN = /\s?[#:\(](?:line )?(\d*)(?:[#:,](\d*))?\)?\s*$/;
|
|
103
|
+
function extractRangeFromFilter(filter, unless) {
|
|
104
|
+
if (!filter || unless?.some(value => filter.indexOf(value) !== -1)) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
let range = undefined;
|
|
108
|
+
const patternMatch = LINE_COLON_PATTERN.exec(filter);
|
|
109
|
+
if (patternMatch) {
|
|
110
|
+
const startLineNumber = parseInt(patternMatch[1] ?? '', 10);
|
|
111
|
+
if (isNumber(startLineNumber)) {
|
|
112
|
+
range = {
|
|
113
|
+
startLineNumber: startLineNumber,
|
|
114
|
+
startColumn: 1,
|
|
115
|
+
endLineNumber: startLineNumber,
|
|
116
|
+
endColumn: 1
|
|
117
|
+
};
|
|
118
|
+
const startColumn = parseInt(patternMatch[2] ?? '', 10);
|
|
119
|
+
if (isNumber(startColumn)) {
|
|
120
|
+
range = {
|
|
121
|
+
startLineNumber: range.startLineNumber,
|
|
122
|
+
startColumn: startColumn,
|
|
123
|
+
endLineNumber: range.endLineNumber,
|
|
124
|
+
endColumn: startColumn
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else if (patternMatch[1] === '') {
|
|
129
|
+
range = {
|
|
130
|
+
startLineNumber: 1,
|
|
131
|
+
startColumn: 1,
|
|
132
|
+
endLineNumber: 1,
|
|
133
|
+
endColumn: 1
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (patternMatch && range) {
|
|
138
|
+
return {
|
|
139
|
+
filter: filter.substr(0, patternMatch.index),
|
|
140
|
+
range
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
export { WorkspaceSymbolItem, WorkspaceSymbolProviderRegistry, extractRangeFromFilter, getOutOfWorkspaceEditorResources, getWorkspaceSymbols };
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import * as objects from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
4
|
+
import { ConfiguringTask, ContributedTask, CustomTask } from '../common/tasks.js';
|
|
5
|
+
import * as types from 'monaco-editor/esm/vs/base/common/types.js';
|
|
6
|
+
import { ITaskService } from '../common/taskService.js';
|
|
7
|
+
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
8
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
9
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
10
|
+
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
11
|
+
import { Severity, INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
12
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
13
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
14
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
15
|
+
import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
16
|
+
import { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
|
|
17
|
+
import { getColorStyleElement, getColorClass } from '../../terminal/browser/terminalIcon.js';
|
|
18
|
+
import { showWithPinnedItems } from '../../../../platform/quickinput/browser/quickPickPin.js';
|
|
19
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
20
|
+
const QUICKOPEN_DETAIL_CONFIG = 'task.quickOpen.detail';
|
|
21
|
+
const QUICKOPEN_SKIP_CONFIG = 'task.quickOpen.skip';
|
|
22
|
+
const SHOW_ALL = ( nls.localize('taskQuickPick.showAll', "Show All Tasks..."));
|
|
23
|
+
const configureTaskIcon = registerIcon('tasks-list-configure', Codicon.gear, ( nls.localize('configureTaskIcon', 'Configuration icon in the tasks selection list.')));
|
|
24
|
+
const removeTaskIcon = registerIcon('tasks-remove', Codicon.close, ( nls.localize('removeTaskIcon', 'Icon for remove in the tasks selection list.')));
|
|
25
|
+
const runTaskStorageKey = 'runTaskStorageKey';
|
|
26
|
+
let TaskQuickPick = class TaskQuickPick extends Disposable {
|
|
27
|
+
constructor(_taskService, _configurationService, _quickInputService, _notificationService, _themeService, _dialogService, _storageService) {
|
|
28
|
+
super();
|
|
29
|
+
this._taskService = _taskService;
|
|
30
|
+
this._configurationService = _configurationService;
|
|
31
|
+
this._quickInputService = _quickInputService;
|
|
32
|
+
this._notificationService = _notificationService;
|
|
33
|
+
this._themeService = _themeService;
|
|
34
|
+
this._dialogService = _dialogService;
|
|
35
|
+
this._storageService = _storageService;
|
|
36
|
+
this._sorter = this._taskService.createSorter();
|
|
37
|
+
}
|
|
38
|
+
_showDetail() {
|
|
39
|
+
return !!this._configurationService.getValue(QUICKOPEN_DETAIL_CONFIG);
|
|
40
|
+
}
|
|
41
|
+
_guessTaskLabel(task) {
|
|
42
|
+
if (task._label) {
|
|
43
|
+
return task._label;
|
|
44
|
+
}
|
|
45
|
+
if (ConfiguringTask.is(task)) {
|
|
46
|
+
let label = task.configures.type;
|
|
47
|
+
const configures = objects.deepClone(task.configures);
|
|
48
|
+
delete configures['_key'];
|
|
49
|
+
delete configures['type'];
|
|
50
|
+
( Object.keys(configures)).forEach(key => label += `: ${configures[key]}`);
|
|
51
|
+
return label;
|
|
52
|
+
}
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
static getTaskLabelWithIcon(task, labelGuess) {
|
|
56
|
+
const label = labelGuess || task._label;
|
|
57
|
+
const icon = task.configurationProperties.icon;
|
|
58
|
+
if (!icon) {
|
|
59
|
+
return `${label}`;
|
|
60
|
+
}
|
|
61
|
+
return icon.id ? `$(${icon.id}) ${label}` : `$(${Codicon.tools.id}) ${label}`;
|
|
62
|
+
}
|
|
63
|
+
static applyColorStyles(task, entry, themeService) {
|
|
64
|
+
if (task.configurationProperties.icon?.color) {
|
|
65
|
+
const colorTheme = themeService.getColorTheme();
|
|
66
|
+
const styleElement = getColorStyleElement(colorTheme);
|
|
67
|
+
entry.iconClasses = [getColorClass(task.configurationProperties.icon.color)];
|
|
68
|
+
document.body.appendChild(styleElement);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
_createTaskEntry(task, extraButtons = []) {
|
|
72
|
+
const buttons = [
|
|
73
|
+
{ iconClass: ThemeIcon.asClassName(configureTaskIcon), tooltip: ( nls.localize('configureTask', "Configure Task")) },
|
|
74
|
+
...extraButtons
|
|
75
|
+
];
|
|
76
|
+
const entry = { label: TaskQuickPick.getTaskLabelWithIcon(task, this._guessTaskLabel(task)), description: this._taskService.getTaskDescription(task), task, detail: this._showDetail() ? task.configurationProperties.detail : undefined, buttons };
|
|
77
|
+
TaskQuickPick.applyColorStyles(task, entry, this._themeService);
|
|
78
|
+
return entry;
|
|
79
|
+
}
|
|
80
|
+
_createEntriesForGroup(entries, tasks, groupLabel, extraButtons = []) {
|
|
81
|
+
entries.push({ type: 'separator', label: groupLabel });
|
|
82
|
+
tasks.forEach(task => {
|
|
83
|
+
if (!task.configurationProperties.hide) {
|
|
84
|
+
entries.push(this._createTaskEntry(task, extraButtons));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
_createTypeEntries(entries, types) {
|
|
89
|
+
entries.push({ type: 'separator', label: ( nls.localize('contributedTasks', "contributed")) });
|
|
90
|
+
types.forEach(type => {
|
|
91
|
+
entries.push({ label: `$(folder) ${type}`, task: type, ariaLabel: ( nls.localize('taskType', "All {0} tasks", type)) });
|
|
92
|
+
});
|
|
93
|
+
entries.push({ label: SHOW_ALL, task: SHOW_ALL, alwaysShow: true });
|
|
94
|
+
}
|
|
95
|
+
_handleFolderTaskResult(result) {
|
|
96
|
+
const tasks = [];
|
|
97
|
+
Array.from(result).forEach(([key, folderTasks]) => {
|
|
98
|
+
if (folderTasks.set) {
|
|
99
|
+
tasks.push(...folderTasks.set.tasks);
|
|
100
|
+
}
|
|
101
|
+
if (folderTasks.configurations) {
|
|
102
|
+
for (const configuration in folderTasks.configurations.byIdentifier) {
|
|
103
|
+
tasks.push(folderTasks.configurations.byIdentifier[configuration]);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return tasks;
|
|
108
|
+
}
|
|
109
|
+
_dedupeConfiguredAndRecent(recentTasks, configuredTasks) {
|
|
110
|
+
let dedupedConfiguredTasks = [];
|
|
111
|
+
const foundRecentTasks = Array(recentTasks.length).fill(false);
|
|
112
|
+
for (let j = 0; j < configuredTasks.length; j++) {
|
|
113
|
+
const workspaceFolder = configuredTasks[j].getWorkspaceFolder()?.uri.toString();
|
|
114
|
+
const definition = configuredTasks[j].getDefinition()?._key;
|
|
115
|
+
const type = configuredTasks[j].type;
|
|
116
|
+
const label = configuredTasks[j]._label;
|
|
117
|
+
const recentKey = configuredTasks[j].getRecentlyUsedKey();
|
|
118
|
+
const findIndex = recentTasks.findIndex((value) => {
|
|
119
|
+
return (workspaceFolder && definition && value.getWorkspaceFolder()?.uri.toString() === workspaceFolder
|
|
120
|
+
&& ((value.getDefinition()?._key === definition) || (value.type === type && value._label === label)))
|
|
121
|
+
|| (recentKey && value.getRecentlyUsedKey() === recentKey);
|
|
122
|
+
});
|
|
123
|
+
if (findIndex === -1) {
|
|
124
|
+
dedupedConfiguredTasks.push(configuredTasks[j]);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
recentTasks[findIndex] = configuredTasks[j];
|
|
128
|
+
foundRecentTasks[findIndex] = true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
dedupedConfiguredTasks = dedupedConfiguredTasks.sort((a, b) => this._sorter.compare(a, b));
|
|
132
|
+
const prunedRecentTasks = [];
|
|
133
|
+
for (let i = 0; i < recentTasks.length; i++) {
|
|
134
|
+
if (foundRecentTasks[i] || ConfiguringTask.is(recentTasks[i])) {
|
|
135
|
+
prunedRecentTasks.push(recentTasks[i]);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return { configuredTasks: dedupedConfiguredTasks, recentTasks: prunedRecentTasks };
|
|
139
|
+
}
|
|
140
|
+
async getTopLevelEntries(defaultEntry) {
|
|
141
|
+
if (this._topLevelEntries !== undefined) {
|
|
142
|
+
return { entries: this._topLevelEntries };
|
|
143
|
+
}
|
|
144
|
+
let recentTasks = (await this._taskService.getSavedTasks('historical')).reverse();
|
|
145
|
+
const configuredTasks = this._handleFolderTaskResult(await this._taskService.getWorkspaceTasks());
|
|
146
|
+
const extensionTaskTypes = this._taskService.taskTypes();
|
|
147
|
+
this._topLevelEntries = [];
|
|
148
|
+
const dedupeAndPrune = this._dedupeConfiguredAndRecent(recentTasks, configuredTasks);
|
|
149
|
+
const dedupedConfiguredTasks = dedupeAndPrune.configuredTasks;
|
|
150
|
+
recentTasks = dedupeAndPrune.recentTasks;
|
|
151
|
+
if (recentTasks.length > 0) {
|
|
152
|
+
const removeRecentButton = {
|
|
153
|
+
iconClass: ThemeIcon.asClassName(removeTaskIcon),
|
|
154
|
+
tooltip: ( nls.localize('removeRecent', 'Remove Recently Used Task'))
|
|
155
|
+
};
|
|
156
|
+
this._createEntriesForGroup(this._topLevelEntries, recentTasks, ( nls.localize('recentlyUsed', 'recently used')), [removeRecentButton]);
|
|
157
|
+
}
|
|
158
|
+
if (configuredTasks.length > 0) {
|
|
159
|
+
if (dedupedConfiguredTasks.length > 0) {
|
|
160
|
+
this._createEntriesForGroup(this._topLevelEntries, dedupedConfiguredTasks, ( nls.localize('configured', 'configured')));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (defaultEntry && (configuredTasks.length === 0)) {
|
|
164
|
+
this._topLevelEntries.push({ type: 'separator', label: ( nls.localize('configured', 'configured')) });
|
|
165
|
+
this._topLevelEntries.push(defaultEntry);
|
|
166
|
+
}
|
|
167
|
+
if (extensionTaskTypes.length > 0) {
|
|
168
|
+
this._createTypeEntries(this._topLevelEntries, extensionTaskTypes);
|
|
169
|
+
}
|
|
170
|
+
return { entries: this._topLevelEntries, isSingleConfigured: configuredTasks.length === 1 ? configuredTasks[0] : undefined };
|
|
171
|
+
}
|
|
172
|
+
async handleSettingOption(selectedType) {
|
|
173
|
+
const { confirmed } = await this._dialogService.confirm({
|
|
174
|
+
type: Severity.Warning,
|
|
175
|
+
message: ( nls.localize(
|
|
176
|
+
'TaskQuickPick.changeSettingDetails',
|
|
177
|
+
"Task detection for {0} tasks causes files in any workspace you open to be run as code. Enabling {0} task detection is a user setting and will apply to any workspace you open. \n\n Do you want to enable {0} task detection for all workspaces?",
|
|
178
|
+
selectedType
|
|
179
|
+
)),
|
|
180
|
+
cancelButton: ( nls.localize('TaskQuickPick.changeSettingNo', "No"))
|
|
181
|
+
});
|
|
182
|
+
if (confirmed) {
|
|
183
|
+
await this._configurationService.updateValue(`${selectedType}.autoDetect`, 'on');
|
|
184
|
+
await ( new Promise(resolve => setTimeout(() => resolve(), 100)));
|
|
185
|
+
return this.show(( nls.localize('TaskService.pickRunTask', 'Select the task to run')), undefined, selectedType);
|
|
186
|
+
}
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
async show(placeHolder, defaultEntry, startAtType, name) {
|
|
190
|
+
const picker = this._quickInputService.createQuickPick();
|
|
191
|
+
picker.placeholder = placeHolder;
|
|
192
|
+
picker.matchOnDescription = true;
|
|
193
|
+
picker.ignoreFocusOut = false;
|
|
194
|
+
picker.onDidTriggerItemButton(async (context) => {
|
|
195
|
+
const task = context.item.task;
|
|
196
|
+
if (context.button.iconClass === ThemeIcon.asClassName(removeTaskIcon)) {
|
|
197
|
+
const key = (task && !types.isString(task)) ? task.getRecentlyUsedKey() : undefined;
|
|
198
|
+
if (key) {
|
|
199
|
+
this._taskService.removeRecentlyUsedTask(key);
|
|
200
|
+
}
|
|
201
|
+
const indexToRemove = picker.items.indexOf(context.item);
|
|
202
|
+
if (indexToRemove >= 0) {
|
|
203
|
+
picker.items = [...picker.items.slice(0, indexToRemove), ...picker.items.slice(indexToRemove + 1)];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else if (context.button.iconClass === ThemeIcon.asClassName(configureTaskIcon)) {
|
|
207
|
+
this._quickInputService.cancel();
|
|
208
|
+
if (ContributedTask.is(task)) {
|
|
209
|
+
this._taskService.customize(task, undefined, true);
|
|
210
|
+
}
|
|
211
|
+
else if (CustomTask.is(task) || ConfiguringTask.is(task)) {
|
|
212
|
+
let canOpenConfig = false;
|
|
213
|
+
try {
|
|
214
|
+
canOpenConfig = await this._taskService.openConfig(task);
|
|
215
|
+
}
|
|
216
|
+
catch (e) {
|
|
217
|
+
}
|
|
218
|
+
if (!canOpenConfig) {
|
|
219
|
+
this._taskService.customize(task, undefined, true);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
if (name) {
|
|
225
|
+
picker.value = name;
|
|
226
|
+
}
|
|
227
|
+
let firstLevelTask = startAtType;
|
|
228
|
+
if (!firstLevelTask) {
|
|
229
|
+
const topLevelEntriesResult = await this.getTopLevelEntries(defaultEntry);
|
|
230
|
+
if (topLevelEntriesResult.isSingleConfigured && this._configurationService.getValue(QUICKOPEN_SKIP_CONFIG)) {
|
|
231
|
+
picker.dispose();
|
|
232
|
+
return this._toTask(topLevelEntriesResult.isSingleConfigured);
|
|
233
|
+
}
|
|
234
|
+
const taskQuickPickEntries = topLevelEntriesResult.entries;
|
|
235
|
+
firstLevelTask = await this._doPickerFirstLevel(picker, taskQuickPickEntries);
|
|
236
|
+
}
|
|
237
|
+
do {
|
|
238
|
+
if (types.isString(firstLevelTask)) {
|
|
239
|
+
if (name) {
|
|
240
|
+
await this._doPickerFirstLevel(picker, (await this.getTopLevelEntries(defaultEntry)).entries);
|
|
241
|
+
picker.dispose();
|
|
242
|
+
return undefined;
|
|
243
|
+
}
|
|
244
|
+
const selectedEntry = await this.doPickerSecondLevel(picker, firstLevelTask);
|
|
245
|
+
if (selectedEntry && !selectedEntry.settingType && selectedEntry.task === null) {
|
|
246
|
+
picker.value = '';
|
|
247
|
+
firstLevelTask = await this._doPickerFirstLevel(picker, (await this.getTopLevelEntries(defaultEntry)).entries);
|
|
248
|
+
}
|
|
249
|
+
else if (selectedEntry && types.isString(selectedEntry.settingType)) {
|
|
250
|
+
picker.dispose();
|
|
251
|
+
return this.handleSettingOption(selectedEntry.settingType);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
picker.dispose();
|
|
255
|
+
return (selectedEntry?.task && !types.isString(selectedEntry?.task)) ? this._toTask(selectedEntry?.task) : undefined;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else if (firstLevelTask) {
|
|
259
|
+
picker.dispose();
|
|
260
|
+
return this._toTask(firstLevelTask);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
picker.dispose();
|
|
264
|
+
return firstLevelTask;
|
|
265
|
+
}
|
|
266
|
+
} while (1);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
async _doPickerFirstLevel(picker, taskQuickPickEntries) {
|
|
270
|
+
picker.items = taskQuickPickEntries;
|
|
271
|
+
showWithPinnedItems(this._storageService, runTaskStorageKey, picker, true);
|
|
272
|
+
const firstLevelPickerResult = await ( new Promise(resolve => {
|
|
273
|
+
Event.once(picker.onDidAccept)(async () => {
|
|
274
|
+
resolve(picker.selectedItems ? picker.selectedItems[0] : undefined);
|
|
275
|
+
});
|
|
276
|
+
}));
|
|
277
|
+
return firstLevelPickerResult?.task;
|
|
278
|
+
}
|
|
279
|
+
async doPickerSecondLevel(picker, type, name) {
|
|
280
|
+
picker.busy = true;
|
|
281
|
+
if (type === SHOW_ALL) {
|
|
282
|
+
const items = ( (await this._taskService.tasks()).filter(t => !t.configurationProperties.hide).sort((a, b) => this._sorter.compare(a, b)).map(task => this._createTaskEntry(task)));
|
|
283
|
+
items.push(...TaskQuickPick.allSettingEntries(this._configurationService));
|
|
284
|
+
picker.items = items;
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
picker.value = name || '';
|
|
288
|
+
picker.items = await this._getEntriesForProvider(type);
|
|
289
|
+
}
|
|
290
|
+
await picker.show();
|
|
291
|
+
picker.busy = false;
|
|
292
|
+
const secondLevelPickerResult = await ( new Promise(resolve => {
|
|
293
|
+
Event.once(picker.onDidAccept)(async () => {
|
|
294
|
+
resolve(picker.selectedItems ? picker.selectedItems[0] : undefined);
|
|
295
|
+
});
|
|
296
|
+
}));
|
|
297
|
+
return secondLevelPickerResult;
|
|
298
|
+
}
|
|
299
|
+
static allSettingEntries(configurationService) {
|
|
300
|
+
const entries = [];
|
|
301
|
+
const gruntEntry = TaskQuickPick.getSettingEntry(configurationService, 'grunt');
|
|
302
|
+
if (gruntEntry) {
|
|
303
|
+
entries.push(gruntEntry);
|
|
304
|
+
}
|
|
305
|
+
const gulpEntry = TaskQuickPick.getSettingEntry(configurationService, 'gulp');
|
|
306
|
+
if (gulpEntry) {
|
|
307
|
+
entries.push(gulpEntry);
|
|
308
|
+
}
|
|
309
|
+
const jakeEntry = TaskQuickPick.getSettingEntry(configurationService, 'jake');
|
|
310
|
+
if (jakeEntry) {
|
|
311
|
+
entries.push(jakeEntry);
|
|
312
|
+
}
|
|
313
|
+
return entries;
|
|
314
|
+
}
|
|
315
|
+
static getSettingEntry(configurationService, type) {
|
|
316
|
+
if (configurationService.getValue(`${type}.autoDetect`) === 'off') {
|
|
317
|
+
return {
|
|
318
|
+
label: ( nls.localize(
|
|
319
|
+
'TaskQuickPick.changeSettingsOptions',
|
|
320
|
+
"$(gear) {0} task detection is turned off. Enable {1} task detection...",
|
|
321
|
+
type[0].toUpperCase() + type.slice(1),
|
|
322
|
+
type
|
|
323
|
+
)),
|
|
324
|
+
task: null,
|
|
325
|
+
settingType: type,
|
|
326
|
+
alwaysShow: true
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
async _getEntriesForProvider(type) {
|
|
332
|
+
const tasks = (await this._taskService.tasks({ type })).sort((a, b) => this._sorter.compare(a, b));
|
|
333
|
+
let taskQuickPickEntries = [];
|
|
334
|
+
if (tasks.length > 0) {
|
|
335
|
+
for (const task of tasks) {
|
|
336
|
+
if (!task.configurationProperties.hide) {
|
|
337
|
+
taskQuickPickEntries.push(this._createTaskEntry(task));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
taskQuickPickEntries.push({
|
|
341
|
+
type: 'separator'
|
|
342
|
+
}, {
|
|
343
|
+
label: ( nls.localize('TaskQuickPick.goBack', 'Go back ↩')),
|
|
344
|
+
task: null,
|
|
345
|
+
alwaysShow: true
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
taskQuickPickEntries = [{
|
|
350
|
+
label: ( nls.localize('TaskQuickPick.noTasksForType', 'No {0} tasks found. Go back ↩', type)),
|
|
351
|
+
task: null,
|
|
352
|
+
alwaysShow: true
|
|
353
|
+
}];
|
|
354
|
+
}
|
|
355
|
+
const settingEntry = TaskQuickPick.getSettingEntry(this._configurationService, type);
|
|
356
|
+
if (settingEntry) {
|
|
357
|
+
taskQuickPickEntries.push(settingEntry);
|
|
358
|
+
}
|
|
359
|
+
return taskQuickPickEntries;
|
|
360
|
+
}
|
|
361
|
+
async _toTask(task) {
|
|
362
|
+
if (!ConfiguringTask.is(task)) {
|
|
363
|
+
return task;
|
|
364
|
+
}
|
|
365
|
+
const resolvedTask = await this._taskService.tryResolveTask(task);
|
|
366
|
+
if (!resolvedTask) {
|
|
367
|
+
this._notificationService.error(( nls.localize(
|
|
368
|
+
'noProviderForTask',
|
|
369
|
+
"There is no task provider registered for tasks of type \"{0}\".",
|
|
370
|
+
task.type
|
|
371
|
+
)));
|
|
372
|
+
}
|
|
373
|
+
return resolvedTask;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
TaskQuickPick = ( __decorate([
|
|
377
|
+
( __param(0, ITaskService)),
|
|
378
|
+
( __param(1, IConfigurationService)),
|
|
379
|
+
( __param(2, IQuickInputService)),
|
|
380
|
+
( __param(3, INotificationService)),
|
|
381
|
+
( __param(4, IThemeService)),
|
|
382
|
+
( __param(5, IDialogService)),
|
|
383
|
+
( __param(6, IStorageService))
|
|
384
|
+
], TaskQuickPick));
|
|
385
|
+
export { QUICKOPEN_DETAIL_CONFIG, QUICKOPEN_SKIP_CONFIG, TaskQuickPick, configureTaskIcon };
|