@codingame/monaco-vscode-api 1.85.0-next.2 → 1.85.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 +19 -10
- package/contributions.js +1 -0
- package/missing-services.js +91 -5
- package/monaco-editor-treemending.patch +2540 -2533
- package/package.json +6 -6
- package/vscode/src/vs/base/common/jsonFormatter.js +8 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +128 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +191 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +238 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +205 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +168 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +340 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1195 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +81 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +583 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +290 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +167 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +562 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +31 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +24 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +22 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +52 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +258 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +25 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +388 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +61 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +49 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +647 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +300 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +60 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +333 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +99 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +55 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +2 -0
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +20 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +855 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +410 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1591 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1485 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +125 -0
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +29 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +41 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +102 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +988 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +431 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +417 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +806 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +915 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +19 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +129 -10
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +205 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +150 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +480 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +90 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +258 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +614 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +44 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +169 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +64 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.js +49 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +120 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +416 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +663 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +593 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +72 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +326 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +539 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +265 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +348 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +95 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +437 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2730 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +139 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +564 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +119 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +135 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +178 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +35 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +377 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +97 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +194 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +71 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +652 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +303 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +228 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +302 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +438 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +45 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +435 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +95 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +107 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +430 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +54 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +1131 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +1591 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +341 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +2155 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +65 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +95 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +507 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +47 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +435 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +31 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +257 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +239 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +103 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +211 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +808 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +381 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +527 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +163 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +651 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +173 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +98 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +62 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +346 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +152 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +296 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +261 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKeymapService.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookLoggingService.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +16 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookRange.js +66 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWorkerService.js +4 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +130 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +847 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +89 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +1942 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +107 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +49 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +387 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/common/constants.js +66 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +24 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +95 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -1
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService.js +159 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint.js +375 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +563 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.js +932 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +2 -2
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +190 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +77 -0
- package/assets/break.mp3 +0 -0
- package/assets/chatRequestSent.mp3 +0 -0
- package/assets/chatResponsePending.mp3 +0 -0
- package/assets/chatResponseReceived1.mp3 +0 -0
- package/assets/chatResponseReceived2.mp3 +0 -0
- package/assets/chatResponseReceived3.mp3 +0 -0
- package/assets/chatResponseReceived4.mp3 +0 -0
- package/assets/clear.mp3 +0 -0
- package/assets/defaultIcon.png +0 -0
- package/assets/diffLineDeleted.mp3 +0 -0
- package/assets/diffLineInserted.mp3 +0 -0
- package/assets/diffLineModified.mp3 +0 -0
- package/assets/error.mp3 +0 -0
- package/assets/fake.html +0 -10
- package/assets/foldedAreas.mp3 +0 -0
- package/assets/format.mp3 +0 -0
- package/assets/index-no-csp.html +0 -1226
- package/assets/index.html +0 -1227
- package/assets/quickFixes.mp3 +0 -0
- package/assets/save.mp3 +0 -0
- package/assets/service-worker.js +0 -457
- package/assets/taskCompleted.mp3 +0 -0
- package/assets/taskFailed.mp3 +0 -0
- package/assets/terminalBell.mp3 +0 -0
- package/assets/warning.mp3 +0 -0
- package/assets/webWorkerExtensionHostIframe.html +0 -123
- package/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
- package/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -5
package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js
ADDED
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { createDecorator, IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
3
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
5
|
+
import { Memento } from '../../../common/memento.js';
|
|
6
|
+
import { registerAction2, Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
7
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
8
|
+
import { ContextKeyExpr, IContextKeyService, RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
9
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
10
|
+
import { IUserDataSyncEnablementService } from '../../../../platform/userDataSync/common/userDataSync.js';
|
|
11
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
12
|
+
import { joinPath } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
13
|
+
import { FileAccess } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
14
|
+
import { IExtensionManagementService, EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT, EXTENSION_INSTALL_DEP_PACK_CONTEXT } from '../../../../platform/extensionManagement/common/extensionManagement.js';
|
|
15
|
+
import { walkthroughs } from '../common/gettingStartedContent.js';
|
|
16
|
+
import { IWorkbenchAssignmentService } from '../../../services/assignment/common/assignmentService.js';
|
|
17
|
+
import { IHostService } from '../../../services/host/browser/host.js';
|
|
18
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
19
|
+
import { parseLinkedText } from 'monaco-editor/esm/vs/base/common/linkedText.js';
|
|
20
|
+
import { walkthroughsExtensionPoint } from './gettingStartedExtensionPoint.js';
|
|
21
|
+
import { dirname } from 'monaco-editor/esm/vs/base/common/path.js';
|
|
22
|
+
import { coalesce, flatten } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
23
|
+
import { IViewsService } from '../../../common/views.js';
|
|
24
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
25
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
26
|
+
import { checkGlobFileExists } from '../../../services/extensions/common/workspaceContains.js';
|
|
27
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
28
|
+
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
29
|
+
import { getDefaultIconPath } from '../../../services/extensionManagement/common/extensionManagement.js';
|
|
30
|
+
const HasMultipleNewFileEntries = ( new RawContextKey('hasMultipleNewFileEntries', false));
|
|
31
|
+
const IWalkthroughsService = ( createDecorator('walkthroughsService'));
|
|
32
|
+
const hiddenEntriesConfigurationKey = 'workbench.welcomePage.hiddenCategories';
|
|
33
|
+
const walkthroughMetadataConfigurationKey = 'workbench.welcomePage.walkthroughMetadata';
|
|
34
|
+
const BUILT_IN_SOURCE = ( localizeWithPath(
|
|
35
|
+
'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService',
|
|
36
|
+
'builtin',
|
|
37
|
+
"Built-In"
|
|
38
|
+
));
|
|
39
|
+
const DAYS = 24 * 60 * 60 * 1000;
|
|
40
|
+
const NEW_WALKTHROUGH_TIME = 7 * DAYS;
|
|
41
|
+
let WalkthroughsService = class WalkthroughsService extends Disposable {
|
|
42
|
+
constructor(storageService, commandService, instantiationService, workspaceContextService, contextService, userDataSyncEnablementService, configurationService, extensionManagementService, hostService, viewsService, telemetryService, tasExperimentService) {
|
|
43
|
+
super();
|
|
44
|
+
this.storageService = storageService;
|
|
45
|
+
this.commandService = commandService;
|
|
46
|
+
this.instantiationService = instantiationService;
|
|
47
|
+
this.workspaceContextService = workspaceContextService;
|
|
48
|
+
this.contextService = contextService;
|
|
49
|
+
this.userDataSyncEnablementService = userDataSyncEnablementService;
|
|
50
|
+
this.configurationService = configurationService;
|
|
51
|
+
this.extensionManagementService = extensionManagementService;
|
|
52
|
+
this.hostService = hostService;
|
|
53
|
+
this.viewsService = viewsService;
|
|
54
|
+
this.telemetryService = telemetryService;
|
|
55
|
+
this.tasExperimentService = tasExperimentService;
|
|
56
|
+
this._onDidAddWalkthrough = ( new Emitter());
|
|
57
|
+
this.onDidAddWalkthrough = this._onDidAddWalkthrough.event;
|
|
58
|
+
this._onDidRemoveWalkthrough = ( new Emitter());
|
|
59
|
+
this.onDidRemoveWalkthrough = this._onDidRemoveWalkthrough.event;
|
|
60
|
+
this._onDidChangeWalkthrough = ( new Emitter());
|
|
61
|
+
this.onDidChangeWalkthrough = this._onDidChangeWalkthrough.event;
|
|
62
|
+
this._onDidProgressStep = ( new Emitter());
|
|
63
|
+
this.onDidProgressStep = this._onDidProgressStep.event;
|
|
64
|
+
this.sessionEvents = ( new Set());
|
|
65
|
+
this.completionListeners = ( new Map());
|
|
66
|
+
this.gettingStartedContributions = ( new Map());
|
|
67
|
+
this.steps = ( new Map());
|
|
68
|
+
this.sessionInstalledExtensions = ( new Set());
|
|
69
|
+
this.categoryVisibilityContextKeys = ( new Set());
|
|
70
|
+
this.stepCompletionContextKeyExpressions = ( new Set());
|
|
71
|
+
this.stepCompletionContextKeys = ( new Set());
|
|
72
|
+
this.metadata = ( new Map(
|
|
73
|
+
JSON.parse(this.storageService.get(walkthroughMetadataConfigurationKey, 0 , '[]'))
|
|
74
|
+
));
|
|
75
|
+
this.memento = ( new Memento('gettingStartedService', this.storageService));
|
|
76
|
+
this.stepProgress = this.memento.getMemento(0 , 0 );
|
|
77
|
+
this.initCompletionEventListeners();
|
|
78
|
+
HasMultipleNewFileEntries.bindTo(this.contextService).set(false);
|
|
79
|
+
this.registerWalkthroughs();
|
|
80
|
+
}
|
|
81
|
+
registerWalkthroughs() {
|
|
82
|
+
walkthroughs.forEach(async (category, index) => {
|
|
83
|
+
this._registerWalkthrough({
|
|
84
|
+
...category,
|
|
85
|
+
icon: { type: 'icon', icon: category.icon },
|
|
86
|
+
order: walkthroughs.length - index,
|
|
87
|
+
source: BUILT_IN_SOURCE,
|
|
88
|
+
when: ContextKeyExpr.deserialize(category.when) ?? ContextKeyExpr.true(),
|
|
89
|
+
steps: ( category.content.steps.map((step, index) => {
|
|
90
|
+
return ({
|
|
91
|
+
...step,
|
|
92
|
+
completionEvents: step.completionEvents ?? [],
|
|
93
|
+
description: parseDescription(step.description),
|
|
94
|
+
category: category.id,
|
|
95
|
+
order: index,
|
|
96
|
+
when: ContextKeyExpr.deserialize(step.when) ?? ContextKeyExpr.true(),
|
|
97
|
+
media: step.media.type === 'image'
|
|
98
|
+
? {
|
|
99
|
+
type: 'image',
|
|
100
|
+
altText: step.media.altText,
|
|
101
|
+
path: convertInternalMediaPathsToBrowserURIs(step.media.path)
|
|
102
|
+
}
|
|
103
|
+
: step.media.type === 'svg'
|
|
104
|
+
? {
|
|
105
|
+
type: 'svg',
|
|
106
|
+
altText: step.media.altText,
|
|
107
|
+
path: convertInternalMediaPathToFileURI(step.media.path).with({ query: JSON.stringify({ moduleId: 'vs/workbench/contrib/welcomeGettingStarted/common/media/' + step.media.path }) })
|
|
108
|
+
}
|
|
109
|
+
: {
|
|
110
|
+
type: 'markdown',
|
|
111
|
+
path: convertInternalMediaPathToFileURI(step.media.path).with({ query: JSON.stringify({ moduleId: 'vs/workbench/contrib/welcomeGettingStarted/common/media/' + step.media.path }) }),
|
|
112
|
+
base: ( FileAccess.asFileUri('vs/workbench/contrib/welcomeGettingStarted/common/media/')),
|
|
113
|
+
root: ( FileAccess.asFileUri('vs/workbench/contrib/welcomeGettingStarted/common/media/')),
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}))
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
walkthroughsExtensionPoint.setHandler((_, { added, removed }) => {
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
initCompletionEventListeners() {
|
|
123
|
+
this._register(this.commandService.onDidExecuteCommand(command => this.progressByEvent(`onCommand:${command.commandId}`)));
|
|
124
|
+
this.extensionManagementService.getInstalled().then(installed => {
|
|
125
|
+
installed.forEach(ext => this.progressByEvent(`extensionInstalled:${ext.identifier.id.toLowerCase()}`));
|
|
126
|
+
});
|
|
127
|
+
this._register(this.extensionManagementService.onDidInstallExtensions(async (result) => {
|
|
128
|
+
const hadLastFoucs = await this.hostService.hadLastFocus();
|
|
129
|
+
for (const e of result) {
|
|
130
|
+
const skipWalkthrough = e?.context?.[EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT] || e?.context?.[EXTENSION_INSTALL_DEP_PACK_CONTEXT];
|
|
131
|
+
if (hadLastFoucs && !skipWalkthrough) {
|
|
132
|
+
this.sessionInstalledExtensions.add(e.identifier.id.toLowerCase());
|
|
133
|
+
}
|
|
134
|
+
this.progressByEvent(`extensionInstalled:${e.identifier.id.toLowerCase()}`);
|
|
135
|
+
}
|
|
136
|
+
}));
|
|
137
|
+
this._register(this.contextService.onDidChangeContext(event => {
|
|
138
|
+
if (event.affectsSome(this.stepCompletionContextKeys)) {
|
|
139
|
+
this.stepCompletionContextKeyExpressions.forEach(expression => {
|
|
140
|
+
if (event.affectsSome(( new Set(( expression.keys())))) && this.contextService.contextMatchesRules(expression)) {
|
|
141
|
+
this.progressByEvent(`onContext:` + expression.serialize());
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}));
|
|
146
|
+
this._register(this.viewsService.onDidChangeViewVisibility(e => {
|
|
147
|
+
if (e.visible) {
|
|
148
|
+
this.progressByEvent('onView:' + e.id);
|
|
149
|
+
}
|
|
150
|
+
}));
|
|
151
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
152
|
+
e.affectedKeys.forEach(key => { this.progressByEvent('onSettingChanged:' + key); });
|
|
153
|
+
}));
|
|
154
|
+
if (this.userDataSyncEnablementService.isEnabled()) {
|
|
155
|
+
this.progressByEvent('onEvent:sync-enabled');
|
|
156
|
+
}
|
|
157
|
+
this._register(this.userDataSyncEnablementService.onDidChangeEnablement(() => {
|
|
158
|
+
if (this.userDataSyncEnablementService.isEnabled()) {
|
|
159
|
+
this.progressByEvent('onEvent:sync-enabled');
|
|
160
|
+
}
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
markWalkthroughOpened(id) {
|
|
164
|
+
const walkthrough = this.gettingStartedContributions.get(id);
|
|
165
|
+
const prior = this.metadata.get(id);
|
|
166
|
+
if (prior && walkthrough) {
|
|
167
|
+
this.metadata.set(id, { ...prior, manaullyOpened: true, stepIDs: ( walkthrough.steps.map(s => s.id)) });
|
|
168
|
+
}
|
|
169
|
+
this.storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([...this.metadata.entries()]), 0 , 0 );
|
|
170
|
+
}
|
|
171
|
+
async registerExtensionWalkthroughContributions(extension) {
|
|
172
|
+
const convertExtensionPathToFileURI = (path) => path.startsWith('https://')
|
|
173
|
+
? ( URI.parse(path, true))
|
|
174
|
+
: FileAccess.uriToFileUri(joinPath(extension.extensionLocation, path));
|
|
175
|
+
const convertExtensionRelativePathsToBrowserURIs = (path) => {
|
|
176
|
+
const convertPath = (path) => path.startsWith('https://')
|
|
177
|
+
? ( URI.parse(path, true))
|
|
178
|
+
: FileAccess.uriToBrowserUri(joinPath(extension.extensionLocation, path));
|
|
179
|
+
if (typeof path === 'string') {
|
|
180
|
+
const converted = convertPath(path);
|
|
181
|
+
return { hcDark: converted, hcLight: converted, dark: converted, light: converted };
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
return {
|
|
185
|
+
hcDark: convertPath(path.hc),
|
|
186
|
+
hcLight: convertPath(path.hcLight ?? path.light),
|
|
187
|
+
light: convertPath(path.light),
|
|
188
|
+
dark: convertPath(path.dark)
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
if (!(extension.contributes?.walkthroughs?.length)) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
let sectionToOpen;
|
|
196
|
+
let sectionToOpenIndex = Math.min();
|
|
197
|
+
await Promise.all(extension.contributes?.walkthroughs?.map(async (walkthrough, index) => {
|
|
198
|
+
const categoryID = extension.identifier.value + '#' + walkthrough.id;
|
|
199
|
+
const isNewlyInstalled = !this.metadata.get(categoryID);
|
|
200
|
+
if (isNewlyInstalled) {
|
|
201
|
+
this.metadata.set(categoryID, { firstSeen: +( new Date()), stepIDs: walkthrough.steps?.map(s => s.id) ?? [], manaullyOpened: false });
|
|
202
|
+
}
|
|
203
|
+
const override = await Promise.race([
|
|
204
|
+
this.tasExperimentService?.getTreatment(`gettingStarted.overrideCategory.${extension.identifier.value + '.' + walkthrough.id}.when`),
|
|
205
|
+
( new Promise(resolve => setTimeout(() => resolve(walkthrough.when), 5000)))
|
|
206
|
+
]);
|
|
207
|
+
if (( this.sessionInstalledExtensions.has(extension.identifier.value.toLowerCase()))
|
|
208
|
+
&& this.contextService.contextMatchesRules(ContextKeyExpr.deserialize(override ?? walkthrough.when) ?? ContextKeyExpr.true())) {
|
|
209
|
+
this.sessionInstalledExtensions.delete(extension.identifier.value.toLowerCase());
|
|
210
|
+
if (index < sectionToOpenIndex && isNewlyInstalled) {
|
|
211
|
+
sectionToOpen = categoryID;
|
|
212
|
+
sectionToOpenIndex = index;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const steps = ( (walkthrough.steps ?? []).map((step, index) => {
|
|
216
|
+
const description = parseDescription(step.description || '');
|
|
217
|
+
const fullyQualifiedID = extension.identifier.value + '#' + walkthrough.id + '#' + step.id;
|
|
218
|
+
let media;
|
|
219
|
+
if (!step.media) {
|
|
220
|
+
throw Error('missing media in walkthrough step: ' + walkthrough.id + '@' + step.id);
|
|
221
|
+
}
|
|
222
|
+
if (step.media.image) {
|
|
223
|
+
const altText = step.media.altText;
|
|
224
|
+
if (altText === undefined) {
|
|
225
|
+
console.error('Walkthrough item:', fullyQualifiedID, 'is missing altText for its media element.');
|
|
226
|
+
}
|
|
227
|
+
media = { type: 'image', altText, path: convertExtensionRelativePathsToBrowserURIs(step.media.image) };
|
|
228
|
+
}
|
|
229
|
+
else if (step.media.markdown) {
|
|
230
|
+
media = {
|
|
231
|
+
type: 'markdown',
|
|
232
|
+
path: convertExtensionPathToFileURI(step.media.markdown),
|
|
233
|
+
base: convertExtensionPathToFileURI(dirname(step.media.markdown)),
|
|
234
|
+
root: FileAccess.uriToFileUri(extension.extensionLocation),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
else if (step.media.svg) {
|
|
238
|
+
media = {
|
|
239
|
+
type: 'svg',
|
|
240
|
+
path: convertExtensionPathToFileURI(step.media.svg),
|
|
241
|
+
altText: step.media.svg,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
throw new Error('Unknown walkthrough format detected for ' + fullyQualifiedID);
|
|
246
|
+
}
|
|
247
|
+
return ({
|
|
248
|
+
description,
|
|
249
|
+
media,
|
|
250
|
+
completionEvents: step.completionEvents?.filter(x => typeof x === 'string') ?? [],
|
|
251
|
+
id: fullyQualifiedID,
|
|
252
|
+
title: step.title,
|
|
253
|
+
when: ContextKeyExpr.deserialize(step.when) ?? ContextKeyExpr.true(),
|
|
254
|
+
category: categoryID,
|
|
255
|
+
order: index,
|
|
256
|
+
});
|
|
257
|
+
}));
|
|
258
|
+
let isFeatured = false;
|
|
259
|
+
if (walkthrough.featuredFor) {
|
|
260
|
+
const folders = ( this.workspaceContextService.getWorkspace().folders.map(f => f.uri));
|
|
261
|
+
const token = ( new CancellationTokenSource());
|
|
262
|
+
setTimeout(() => token.cancel(), 2000);
|
|
263
|
+
isFeatured = await this.instantiationService.invokeFunction(a => checkGlobFileExists(a, folders, walkthrough.featuredFor, token.token));
|
|
264
|
+
}
|
|
265
|
+
const iconStr = walkthrough.icon ?? extension.icon;
|
|
266
|
+
const walkthoughDescriptor = {
|
|
267
|
+
description: walkthrough.description,
|
|
268
|
+
title: walkthrough.title,
|
|
269
|
+
id: categoryID,
|
|
270
|
+
isFeatured,
|
|
271
|
+
source: extension.displayName ?? extension.name,
|
|
272
|
+
order: 0,
|
|
273
|
+
steps,
|
|
274
|
+
icon: {
|
|
275
|
+
type: 'image',
|
|
276
|
+
path: iconStr
|
|
277
|
+
? ( FileAccess.uriToBrowserUri(joinPath(extension.extensionLocation, iconStr)).toString(true))
|
|
278
|
+
: getDefaultIconPath()
|
|
279
|
+
},
|
|
280
|
+
when: ContextKeyExpr.deserialize(override ?? walkthrough.when) ?? ContextKeyExpr.true(),
|
|
281
|
+
};
|
|
282
|
+
this._registerWalkthrough(walkthoughDescriptor);
|
|
283
|
+
this._onDidAddWalkthrough.fire(this.resolveWalkthrough(walkthoughDescriptor));
|
|
284
|
+
}));
|
|
285
|
+
this.storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([...this.metadata.entries()]), 0 , 0 );
|
|
286
|
+
if (sectionToOpen && this.configurationService.getValue('workbench.welcomePage.walkthroughs.openOnInstall')) {
|
|
287
|
+
this.telemetryService.publicLog2('gettingStarted.didAutoOpenWalkthrough', { id: sectionToOpen });
|
|
288
|
+
this.commandService.executeCommand('workbench.action.openWalkthrough', sectionToOpen, true);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
unregisterExtensionWalkthroughContributions(extension) {
|
|
292
|
+
if (!(extension.contributes?.walkthroughs?.length)) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
extension.contributes?.walkthroughs?.forEach(section => {
|
|
296
|
+
const categoryID = extension.identifier.value + '#' + section.id;
|
|
297
|
+
section.steps.forEach(step => {
|
|
298
|
+
const fullyQualifiedID = extension.identifier.value + '#' + section.id + '#' + step.id;
|
|
299
|
+
this.steps.delete(fullyQualifiedID);
|
|
300
|
+
});
|
|
301
|
+
this.gettingStartedContributions.delete(categoryID);
|
|
302
|
+
this._onDidRemoveWalkthrough.fire(categoryID);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
getWalkthrough(id) {
|
|
306
|
+
const walkthrough = this.gettingStartedContributions.get(id);
|
|
307
|
+
if (!walkthrough) {
|
|
308
|
+
throw Error('Trying to get unknown walkthrough: ' + id);
|
|
309
|
+
}
|
|
310
|
+
return this.resolveWalkthrough(walkthrough);
|
|
311
|
+
}
|
|
312
|
+
getWalkthroughs() {
|
|
313
|
+
const registeredCategories = [...( this.gettingStartedContributions.values())];
|
|
314
|
+
const categoriesWithCompletion = ( ( registeredCategories
|
|
315
|
+
.map(category => {
|
|
316
|
+
return {
|
|
317
|
+
...category,
|
|
318
|
+
content: {
|
|
319
|
+
type: 'steps',
|
|
320
|
+
steps: category.steps
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
}))
|
|
324
|
+
.filter(category => category.content.type !== 'steps' || category.content.steps.length)
|
|
325
|
+
.map(category => this.resolveWalkthrough(category)));
|
|
326
|
+
return categoriesWithCompletion;
|
|
327
|
+
}
|
|
328
|
+
resolveWalkthrough(category) {
|
|
329
|
+
const stepsWithProgress = ( category.steps.map(step => this.getStepProgress(step)));
|
|
330
|
+
const hasOpened = this.metadata.get(category.id)?.manaullyOpened;
|
|
331
|
+
const firstSeenDate = this.metadata.get(category.id)?.firstSeen;
|
|
332
|
+
const isNew = firstSeenDate && firstSeenDate > (+( new Date()) - NEW_WALKTHROUGH_TIME);
|
|
333
|
+
const lastStepIDs = this.metadata.get(category.id)?.stepIDs;
|
|
334
|
+
const rawCategory = this.gettingStartedContributions.get(category.id);
|
|
335
|
+
if (!rawCategory) {
|
|
336
|
+
throw Error('Could not find walkthrough with id ' + category.id);
|
|
337
|
+
}
|
|
338
|
+
const currentStepIds = ( rawCategory.steps.map(s => s.id));
|
|
339
|
+
const hasNewSteps = lastStepIDs && (currentStepIds.length !== lastStepIDs.length || ( currentStepIds.some((id, index) => id !== lastStepIDs[index])));
|
|
340
|
+
let recencyBonus = 0;
|
|
341
|
+
if (firstSeenDate) {
|
|
342
|
+
const currentDate = +( new Date());
|
|
343
|
+
const timeSinceFirstSeen = currentDate - firstSeenDate;
|
|
344
|
+
recencyBonus = Math.max(0, (NEW_WALKTHROUGH_TIME - timeSinceFirstSeen) / NEW_WALKTHROUGH_TIME);
|
|
345
|
+
}
|
|
346
|
+
return {
|
|
347
|
+
...category,
|
|
348
|
+
recencyBonus,
|
|
349
|
+
steps: stepsWithProgress,
|
|
350
|
+
newItems: !!hasNewSteps,
|
|
351
|
+
newEntry: !!(isNew && !hasOpened),
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
getStepProgress(step) {
|
|
355
|
+
return {
|
|
356
|
+
...step,
|
|
357
|
+
done: false,
|
|
358
|
+
...this.stepProgress[step.id]
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
progressStep(id) {
|
|
362
|
+
const oldProgress = this.stepProgress[id];
|
|
363
|
+
if (!oldProgress || oldProgress.done !== true) {
|
|
364
|
+
this.stepProgress[id] = { done: true };
|
|
365
|
+
this.memento.saveMemento();
|
|
366
|
+
const step = this.getStep(id);
|
|
367
|
+
if (!step) {
|
|
368
|
+
throw Error('Tried to progress unknown step');
|
|
369
|
+
}
|
|
370
|
+
this._onDidProgressStep.fire(this.getStepProgress(step));
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
deprogressStep(id) {
|
|
374
|
+
delete this.stepProgress[id];
|
|
375
|
+
this.memento.saveMemento();
|
|
376
|
+
const step = this.getStep(id);
|
|
377
|
+
this._onDidProgressStep.fire(this.getStepProgress(step));
|
|
378
|
+
}
|
|
379
|
+
progressByEvent(event) {
|
|
380
|
+
if (( this.sessionEvents.has(event))) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
this.sessionEvents.add(event);
|
|
384
|
+
this.completionListeners.get(event)?.forEach(id => this.progressStep(id));
|
|
385
|
+
}
|
|
386
|
+
registerWalkthrough(walkthoughDescriptor) {
|
|
387
|
+
this._registerWalkthrough({
|
|
388
|
+
...walkthoughDescriptor,
|
|
389
|
+
steps: ( walkthoughDescriptor.steps.map(step => ({ ...step, description: parseDescription(step.description) })))
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
_registerWalkthrough(walkthroughDescriptor) {
|
|
393
|
+
const oldCategory = this.gettingStartedContributions.get(walkthroughDescriptor.id);
|
|
394
|
+
if (oldCategory) {
|
|
395
|
+
console.error(`Skipping attempt to overwrite walkthrough. (${walkthroughDescriptor.id})`);
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
this.gettingStartedContributions.set(walkthroughDescriptor.id, walkthroughDescriptor);
|
|
399
|
+
walkthroughDescriptor.steps.forEach(step => {
|
|
400
|
+
if (( this.steps.has(step.id))) {
|
|
401
|
+
throw Error('Attempting to register step with id ' + step.id + ' twice. Second is dropped.');
|
|
402
|
+
}
|
|
403
|
+
this.steps.set(step.id, step);
|
|
404
|
+
( step.when.keys()).forEach(key => this.categoryVisibilityContextKeys.add(key));
|
|
405
|
+
this.registerDoneListeners(step);
|
|
406
|
+
});
|
|
407
|
+
( walkthroughDescriptor.when.keys()).forEach(key => this.categoryVisibilityContextKeys.add(key));
|
|
408
|
+
}
|
|
409
|
+
registerDoneListeners(step) {
|
|
410
|
+
if (step.doneOn) {
|
|
411
|
+
console.error(`wakthrough step`, step, `uses deprecated 'doneOn' property. Adopt 'completionEvents' to silence this warning`);
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
if (!step.completionEvents.length) {
|
|
415
|
+
step.completionEvents = coalesce(flatten(( step.description
|
|
416
|
+
.filter(linkedText => linkedText.nodes.length === 1)
|
|
417
|
+
.map(linkedText => ( linkedText.nodes
|
|
418
|
+
.filter(((node) => typeof node !== 'string'))
|
|
419
|
+
.map(({ href }) => {
|
|
420
|
+
if (href.startsWith('command:')) {
|
|
421
|
+
return 'onCommand:' + href.slice('command:'.length, href.includes('?') ? href.indexOf('?') : undefined);
|
|
422
|
+
}
|
|
423
|
+
if (href.startsWith('https://') || href.startsWith('http://')) {
|
|
424
|
+
return 'onLink:' + href;
|
|
425
|
+
}
|
|
426
|
+
return undefined;
|
|
427
|
+
}))))));
|
|
428
|
+
}
|
|
429
|
+
if (!step.completionEvents.length) {
|
|
430
|
+
step.completionEvents.push('stepSelected');
|
|
431
|
+
}
|
|
432
|
+
for (let event of step.completionEvents) {
|
|
433
|
+
const [_, eventType, argument] = /^([^:]*):?(.*)$/.exec(event) ?? [];
|
|
434
|
+
if (!eventType) {
|
|
435
|
+
console.error(`Unknown completionEvent ${event} when registering step ${step.id}`);
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
switch (eventType) {
|
|
439
|
+
case 'onLink':
|
|
440
|
+
case 'onEvent':
|
|
441
|
+
case 'onView':
|
|
442
|
+
case 'onSettingChanged':
|
|
443
|
+
break;
|
|
444
|
+
case 'onContext': {
|
|
445
|
+
const expression = ContextKeyExpr.deserialize(argument);
|
|
446
|
+
if (expression) {
|
|
447
|
+
this.stepCompletionContextKeyExpressions.add(expression);
|
|
448
|
+
( expression.keys()).forEach(key => this.stepCompletionContextKeys.add(key));
|
|
449
|
+
event = eventType + ':' + expression.serialize();
|
|
450
|
+
if (this.contextService.contextMatchesRules(expression)) {
|
|
451
|
+
this.sessionEvents.add(event);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
console.error('Unable to parse context key expression:', expression, 'in walkthrough step', step.id);
|
|
456
|
+
}
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
case 'onStepSelected':
|
|
460
|
+
case 'stepSelected':
|
|
461
|
+
event = 'stepSelected:' + step.id;
|
|
462
|
+
break;
|
|
463
|
+
case 'onCommand':
|
|
464
|
+
event = eventType + ':' + argument.replace(/^toSide:/, '');
|
|
465
|
+
break;
|
|
466
|
+
case 'onExtensionInstalled':
|
|
467
|
+
case 'extensionInstalled':
|
|
468
|
+
event = 'extensionInstalled:' + argument.toLowerCase();
|
|
469
|
+
break;
|
|
470
|
+
default:
|
|
471
|
+
console.error(`Unknown completionEvent ${event} when registering step ${step.id}`);
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
this.registerCompletionListener(event, step);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
registerCompletionListener(event, step) {
|
|
478
|
+
if (!( this.completionListeners.has(event))) {
|
|
479
|
+
this.completionListeners.set(event, ( new Set()));
|
|
480
|
+
}
|
|
481
|
+
this.completionListeners.get(event)?.add(step.id);
|
|
482
|
+
}
|
|
483
|
+
getStep(id) {
|
|
484
|
+
const step = this.steps.get(id);
|
|
485
|
+
if (!step) {
|
|
486
|
+
throw Error('Attempting to access step which does not exist in registry ' + id);
|
|
487
|
+
}
|
|
488
|
+
return step;
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
WalkthroughsService = ( __decorate([
|
|
492
|
+
( __param(0, IStorageService)),
|
|
493
|
+
( __param(1, ICommandService)),
|
|
494
|
+
( __param(2, IInstantiationService)),
|
|
495
|
+
( __param(3, IWorkspaceContextService)),
|
|
496
|
+
( __param(4, IContextKeyService)),
|
|
497
|
+
( __param(5, IUserDataSyncEnablementService)),
|
|
498
|
+
( __param(6, IConfigurationService)),
|
|
499
|
+
( __param(7, IExtensionManagementService)),
|
|
500
|
+
( __param(8, IHostService)),
|
|
501
|
+
( __param(9, IViewsService)),
|
|
502
|
+
( __param(10, ITelemetryService)),
|
|
503
|
+
( __param(11, IWorkbenchAssignmentService))
|
|
504
|
+
], WalkthroughsService));
|
|
505
|
+
const parseDescription = (desc) => ( desc.split('\n').filter(x => x).map(text => parseLinkedText(text)));
|
|
506
|
+
const convertInternalMediaPathToFileURI = (path) => path.startsWith('https://')
|
|
507
|
+
? ( URI.parse(path, true))
|
|
508
|
+
: ( FileAccess.asFileUri(`vs/workbench/contrib/welcomeGettingStarted/common/media/${path}`));
|
|
509
|
+
const convertInternalMediaPathToBrowserURI = (path) => path.startsWith('https://')
|
|
510
|
+
? ( URI.parse(path, true))
|
|
511
|
+
: ( FileAccess.asBrowserUri(`vs/workbench/contrib/welcomeGettingStarted/common/media/${path}`));
|
|
512
|
+
const convertInternalMediaPathsToBrowserURIs = (path) => {
|
|
513
|
+
if (typeof path === 'string') {
|
|
514
|
+
const converted = convertInternalMediaPathToBrowserURI(path);
|
|
515
|
+
return { hcDark: converted, hcLight: converted, dark: converted, light: converted };
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
return {
|
|
519
|
+
hcDark: convertInternalMediaPathToBrowserURI(path.hc),
|
|
520
|
+
hcLight: convertInternalMediaPathToBrowserURI(path.hcLight ?? path.light),
|
|
521
|
+
light: convertInternalMediaPathToBrowserURI(path.light),
|
|
522
|
+
dark: convertInternalMediaPathToBrowserURI(path.dark)
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
registerAction2(class extends Action2 {
|
|
527
|
+
constructor() {
|
|
528
|
+
super({
|
|
529
|
+
id: 'resetGettingStartedProgress',
|
|
530
|
+
category: { original: 'Developer', value: ( localizeWithPath(
|
|
531
|
+
'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService',
|
|
532
|
+
'developer',
|
|
533
|
+
"Developer"
|
|
534
|
+
)) },
|
|
535
|
+
title: { original: 'Reset Welcome Page Walkthrough Progress', value: ( localizeWithPath(
|
|
536
|
+
'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService',
|
|
537
|
+
'resetWelcomePageWalkthroughProgress',
|
|
538
|
+
"Reset Welcome Page Walkthrough Progress"
|
|
539
|
+
)) },
|
|
540
|
+
f1: true
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
run(accessor) {
|
|
544
|
+
const gettingStartedService = accessor.get(IWalkthroughsService);
|
|
545
|
+
const storageService = accessor.get(IStorageService);
|
|
546
|
+
storageService.store(hiddenEntriesConfigurationKey, JSON.stringify([]), 0 , 0 );
|
|
547
|
+
storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([]), 0 , 0 );
|
|
548
|
+
const memento = ( new Memento('gettingStartedService', accessor.get(IStorageService)));
|
|
549
|
+
const record = memento.getMemento(0 , 0 );
|
|
550
|
+
for (const key in record) {
|
|
551
|
+
if (Object.prototype.hasOwnProperty.call(record, key)) {
|
|
552
|
+
try {
|
|
553
|
+
gettingStartedService.deprogressStep(key);
|
|
554
|
+
}
|
|
555
|
+
catch (e) {
|
|
556
|
+
console.error(e);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
memento.saveMemento();
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
export { HasMultipleNewFileEntries, IWalkthroughsService, WalkthroughsService, convertInternalMediaPathToFileURI, hiddenEntriesConfigurationKey, walkthroughMetadataConfigurationKey };
|