@codingame/monaco-vscode-api 1.85.0 → 1.85.2
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 +31 -13
- package/contributions.js +1 -0
- package/missing-services.js +396 -68
- package/monaco-editor-treemending.patch +957 -950
- package/package.json +8 -7
- package/service-override/tools/editor.js +1 -1
- package/services.js +10 -6
- package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +14 -0
- 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/extensionEnablementService.js +140 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1062 -93
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +220 -0
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
- package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +102 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
- package/vscode/src/vs/platform/userDataSync/common/content.js +9 -0
- package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +514 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +154 -2
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +43 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +177 -0
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostWebview.js +2 -2
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +105 -0
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +1614 -0
- 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/codeEditor/browser/languageConfigurationExtensionPoint.js +7 -7
- 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/files/browser/explorerViewlet.js +73 -2
- 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/tasks/common/taskDefinitionRegistry.js +6 -6
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +12 -2
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +712 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +130 -0
- 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/authentication/browser/authenticationService.js +20 -1
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +205 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +11 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +9 -9
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +2 -2
- package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.js +24 -1
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +41 -0
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +588 -0
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +43 -0
- 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/search/common/search.js +3 -3
- package/vscode/src/vs/workbench/services/terminal/common/embedderTerminalService.js +75 -1
- package/vscode/src/vs/workbench/services/timer/browser/timerService.js +240 -1
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +31 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +25 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +75 -1
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +74 -4
- 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/base/parts/request/browser/request.js +0 -60
- package/vscode/src/vs/platform/request/browser/requestService.js +0 -28
- package/vscode/src/vs/platform/request/common/requestIpc.js +0 -17
- package/vscode/src/vs/platform/url/common/urlService.js +0 -17
- package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +0 -120
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +0 -319
- package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +0 -9
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +0 -408
- package/vscode/src/vs/workbench/services/request/browser/requestService.js +0 -48
- package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +0 -56
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +0 -639
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +0 -402
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +0 -62
- package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +0 -38
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -295
- package/vscode/src/vs/workbench/services/url/browser/urlService.js +0 -47
- package/vscode/src/vs/workbench/services/views/common/treeViewsService.js +0 -20
- package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +0 -19
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
2
|
+
import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
|
|
3
|
+
import { Action, ActionRunner } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
4
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
5
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
7
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
8
|
+
import { createActionViewItem } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
|
|
9
|
+
import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
10
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
11
|
+
import { StandardMouseEvent } from 'monaco-editor/esm/vs/base/browser/mouseEvent.js';
|
|
12
|
+
const collapseIcon = registerIcon('review-comment-collapse', Codicon.chevronUp, ( nls.localizeWithPath(
|
|
13
|
+
'vs/workbench/contrib/comments/browser/commentThreadHeader',
|
|
14
|
+
'collapseIcon',
|
|
15
|
+
'Icon to collapse a review comment.'
|
|
16
|
+
)));
|
|
17
|
+
const COLLAPSE_ACTION_CLASS = 'expand-review-action ' + ThemeIcon.asClassName(collapseIcon);
|
|
18
|
+
class CommentThreadHeader extends Disposable {
|
|
19
|
+
constructor(container, _delegate, _commentMenus, _commentThread, _contextKeyService, instantiationService, _contextMenuService) {
|
|
20
|
+
super();
|
|
21
|
+
this._delegate = _delegate;
|
|
22
|
+
this._commentMenus = _commentMenus;
|
|
23
|
+
this._commentThread = _commentThread;
|
|
24
|
+
this._contextKeyService = _contextKeyService;
|
|
25
|
+
this.instantiationService = instantiationService;
|
|
26
|
+
this._contextMenuService = _contextMenuService;
|
|
27
|
+
this._headElement = dom.$('.head');
|
|
28
|
+
container.appendChild(this._headElement);
|
|
29
|
+
this._fillHead();
|
|
30
|
+
}
|
|
31
|
+
_fillHead() {
|
|
32
|
+
const titleElement = dom.append(this._headElement, dom.$('.review-title'));
|
|
33
|
+
this._headingLabel = dom.append(titleElement, dom.$('span.filename'));
|
|
34
|
+
this.createThreadLabel();
|
|
35
|
+
const actionsContainer = dom.append(this._headElement, dom.$('.review-actions'));
|
|
36
|
+
this._actionbarWidget = ( new ActionBar(actionsContainer, {
|
|
37
|
+
actionViewItemProvider: createActionViewItem.bind(undefined, this.instantiationService)
|
|
38
|
+
}));
|
|
39
|
+
this._register(this._actionbarWidget);
|
|
40
|
+
this._collapseAction = ( new Action('review.expand', ( nls.localizeWithPath(
|
|
41
|
+
'vs/workbench/contrib/comments/browser/commentThreadHeader',
|
|
42
|
+
'label.collapse',
|
|
43
|
+
"Collapse"
|
|
44
|
+
)), COLLAPSE_ACTION_CLASS, true, () => this._delegate.collapse()));
|
|
45
|
+
const menu = this._commentMenus.getCommentThreadTitleActions(this._contextKeyService);
|
|
46
|
+
this.setActionBarActions(menu);
|
|
47
|
+
this._register(menu);
|
|
48
|
+
this._register(menu.onDidChange(e => {
|
|
49
|
+
this.setActionBarActions(menu);
|
|
50
|
+
}));
|
|
51
|
+
this._register(dom.addDisposableListener(this._headElement, dom.EventType.CONTEXT_MENU, e => {
|
|
52
|
+
return this.onContextMenu(e);
|
|
53
|
+
}));
|
|
54
|
+
this._actionbarWidget.context = this._commentThread;
|
|
55
|
+
}
|
|
56
|
+
setActionBarActions(menu) {
|
|
57
|
+
const groups = menu.getActions({ shouldForwardArgs: true }).reduce((r, [, actions]) => [...r, ...actions], []);
|
|
58
|
+
this._actionbarWidget.clear();
|
|
59
|
+
this._actionbarWidget.push([...groups, this._collapseAction], { label: false, icon: true });
|
|
60
|
+
}
|
|
61
|
+
updateCommentThread(commentThread) {
|
|
62
|
+
this._commentThread = commentThread;
|
|
63
|
+
this._actionbarWidget.context = this._commentThread;
|
|
64
|
+
this.createThreadLabel();
|
|
65
|
+
}
|
|
66
|
+
createThreadLabel() {
|
|
67
|
+
let label;
|
|
68
|
+
label = this._commentThread.label;
|
|
69
|
+
if (label === undefined) {
|
|
70
|
+
if (!(this._commentThread.comments && this._commentThread.comments.length)) {
|
|
71
|
+
label = ( nls.localizeWithPath(
|
|
72
|
+
'vs/workbench/contrib/comments/browser/commentThreadHeader',
|
|
73
|
+
'startThread',
|
|
74
|
+
"Start discussion"
|
|
75
|
+
));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (label) {
|
|
79
|
+
this._headingLabel.textContent = strings.escape(label);
|
|
80
|
+
this._headingLabel.setAttribute('aria-label', label);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
updateHeight(headHeight) {
|
|
84
|
+
this._headElement.style.height = `${headHeight}px`;
|
|
85
|
+
this._headElement.style.lineHeight = this._headElement.style.height;
|
|
86
|
+
}
|
|
87
|
+
onContextMenu(e) {
|
|
88
|
+
const actions = ( this._commentMenus.getCommentThreadTitleContextActions(this._contextKeyService).getActions({ shouldForwardArgs: true }).map((value) => value[1])).flat();
|
|
89
|
+
if (!actions.length) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const event = ( new StandardMouseEvent(dom.getWindow(this._headElement), e));
|
|
93
|
+
this._contextMenuService.showContextMenu({
|
|
94
|
+
getAnchor: () => event,
|
|
95
|
+
getActions: () => actions,
|
|
96
|
+
actionRunner: ( new ActionRunner()),
|
|
97
|
+
getActionsContext: () => {
|
|
98
|
+
return {
|
|
99
|
+
commentControlHandle: this._commentThread.controllerHandle,
|
|
100
|
+
commentThreadHandle: this._commentThread.commentThreadHandle,
|
|
101
|
+
$mid: 7
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export { CommentThreadHeader };
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/review.css.js';
|
|
3
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
4
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
5
|
+
import { Disposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import * as languages from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
7
|
+
import { CommentReply } from './commentReply.js';
|
|
8
|
+
import { ICommentService } from './commentService.js';
|
|
9
|
+
import { CommentThreadBody } from './commentThreadBody.js';
|
|
10
|
+
import { CommentThreadHeader } from './commentThreadHeader.js';
|
|
11
|
+
import { CommentThreadAdditionalActions } from './commentThreadAdditionalActions.js';
|
|
12
|
+
import { CommentContextKeys } from '../common/commentContextKeys.js';
|
|
13
|
+
import { textLinkForeground, textLinkActiveForeground, focusBorder, textBlockQuoteBackground, textBlockQuoteBorder, contrastBorder, inputValidationErrorBorder, inputValidationErrorBackground, inputValidationErrorForeground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
14
|
+
import { PANEL_BORDER } from '../../../common/theme.js';
|
|
15
|
+
import { commentThreadStateColorVar, commentThreadStateBackgroundColorVar } from './commentColors.js';
|
|
16
|
+
import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
17
|
+
import { registerNavigableContainer } from '../../../browser/actions/widgetNavigationCommands.js';
|
|
18
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
19
|
+
import { COMMENTS_SECTION } from '../common/commentsConfiguration.js';
|
|
20
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
21
|
+
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
22
|
+
let CommentThreadWidget = class CommentThreadWidget extends Disposable {
|
|
23
|
+
get commentThread() {
|
|
24
|
+
return this._commentThread;
|
|
25
|
+
}
|
|
26
|
+
constructor(container, _parentEditor, _owner, _parentResourceUri, _contextKeyService, _scopedInstantiationService, _commentThread, _pendingComment, _pendingEdits, _markdownOptions, _commentOptions, _containerDelegate, commentService, contextMenuService, configurationService, _keybindingService) {
|
|
27
|
+
super();
|
|
28
|
+
this.container = container;
|
|
29
|
+
this._parentEditor = _parentEditor;
|
|
30
|
+
this._owner = _owner;
|
|
31
|
+
this._parentResourceUri = _parentResourceUri;
|
|
32
|
+
this._contextKeyService = _contextKeyService;
|
|
33
|
+
this._scopedInstantiationService = _scopedInstantiationService;
|
|
34
|
+
this._commentThread = _commentThread;
|
|
35
|
+
this._pendingComment = _pendingComment;
|
|
36
|
+
this._pendingEdits = _pendingEdits;
|
|
37
|
+
this._markdownOptions = _markdownOptions;
|
|
38
|
+
this._commentOptions = _commentOptions;
|
|
39
|
+
this._containerDelegate = _containerDelegate;
|
|
40
|
+
this.commentService = commentService;
|
|
41
|
+
this.configurationService = configurationService;
|
|
42
|
+
this._keybindingService = _keybindingService;
|
|
43
|
+
this._commentThreadDisposables = [];
|
|
44
|
+
this._onDidResize = ( new Emitter());
|
|
45
|
+
this.onDidResize = this._onDidResize.event;
|
|
46
|
+
this._threadIsEmpty = CommentContextKeys.commentThreadIsEmpty.bindTo(this._contextKeyService);
|
|
47
|
+
this._threadIsEmpty.set(!_commentThread.comments || !_commentThread.comments.length);
|
|
48
|
+
this._focusedContextKey = CommentContextKeys.commentFocused.bindTo(this._contextKeyService);
|
|
49
|
+
this._commentMenus = this.commentService.getCommentMenus(this._owner);
|
|
50
|
+
this._header = ( new CommentThreadHeader(container, {
|
|
51
|
+
collapse: this.collapse.bind(this)
|
|
52
|
+
}, this._commentMenus, this._commentThread, this._contextKeyService, this._scopedInstantiationService, contextMenuService));
|
|
53
|
+
this._header.updateCommentThread(this._commentThread);
|
|
54
|
+
const bodyElement = dom.$('.body');
|
|
55
|
+
container.appendChild(bodyElement);
|
|
56
|
+
const tracker = this._register(dom.trackFocus(bodyElement));
|
|
57
|
+
this._register(registerNavigableContainer({
|
|
58
|
+
focusNotifiers: [tracker],
|
|
59
|
+
focusNextWidget: () => {
|
|
60
|
+
if (!this._commentReply?.isCommentEditorFocused()) {
|
|
61
|
+
this._commentReply?.expandReplyAreaAndFocusCommentEditor();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
focusPreviousWidget: () => {
|
|
65
|
+
if (this._commentReply?.isCommentEditorFocused() && this._commentThread.comments?.length) {
|
|
66
|
+
this._body.focus();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
this._register(tracker.onDidFocus(() => this._focusedContextKey.set(true)));
|
|
71
|
+
this._register(tracker.onDidBlur(() => this._focusedContextKey.reset()));
|
|
72
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
73
|
+
if (e.affectsConfiguration("accessibility.verbosity.comments" )) {
|
|
74
|
+
this._setAriaLabel();
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
77
|
+
this._body = this._scopedInstantiationService.createInstance(CommentThreadBody, this._parentEditor, this._owner, this._parentResourceUri, bodyElement, this._markdownOptions, this._commentThread, this._pendingEdits, this._scopedInstantiationService, this);
|
|
78
|
+
this._register(this._body);
|
|
79
|
+
this._setAriaLabel();
|
|
80
|
+
this._styleElement = dom.createStyleSheet(this.container);
|
|
81
|
+
this._commentThreadContextValue = CommentContextKeys.commentThreadContext.bindTo(this._contextKeyService);
|
|
82
|
+
this._commentThreadContextValue.set(_commentThread.contextValue);
|
|
83
|
+
const commentControllerKey = CommentContextKeys.commentControllerContext.bindTo(this._contextKeyService);
|
|
84
|
+
const controller = this.commentService.getCommentController(this._owner);
|
|
85
|
+
if (controller?.contextValue) {
|
|
86
|
+
commentControllerKey.set(controller.contextValue);
|
|
87
|
+
}
|
|
88
|
+
this.currentThreadListeners();
|
|
89
|
+
}
|
|
90
|
+
_setAriaLabel() {
|
|
91
|
+
let ariaLabel = ( localizeWithPath(
|
|
92
|
+
'vs/workbench/contrib/comments/browser/commentThreadWidget',
|
|
93
|
+
'commentLabel',
|
|
94
|
+
"Comment"
|
|
95
|
+
));
|
|
96
|
+
let keybinding;
|
|
97
|
+
const verbose = this.configurationService.getValue("accessibility.verbosity.comments" );
|
|
98
|
+
if (verbose) {
|
|
99
|
+
keybinding = this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp" , this._contextKeyService)?.getLabel() ?? undefined;
|
|
100
|
+
}
|
|
101
|
+
if (keybinding) {
|
|
102
|
+
ariaLabel = ( localizeWithPath(
|
|
103
|
+
'vs/workbench/contrib/comments/browser/commentThreadWidget',
|
|
104
|
+
'commentLabelWithKeybinding',
|
|
105
|
+
"{0}, use ({1}) for accessibility help",
|
|
106
|
+
ariaLabel,
|
|
107
|
+
keybinding
|
|
108
|
+
));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
ariaLabel = ( localizeWithPath(
|
|
112
|
+
'vs/workbench/contrib/comments/browser/commentThreadWidget',
|
|
113
|
+
'commentLabelWithKeybindingNoKeybinding',
|
|
114
|
+
"{0}, run the command Open Accessibility Help which is currently not triggerable via keybinding.",
|
|
115
|
+
ariaLabel
|
|
116
|
+
));
|
|
117
|
+
}
|
|
118
|
+
this._body.container.ariaLabel = ariaLabel;
|
|
119
|
+
}
|
|
120
|
+
updateCurrentThread(hasMouse, hasFocus) {
|
|
121
|
+
if (hasMouse || hasFocus) {
|
|
122
|
+
this.commentService.setCurrentCommentThread(this.commentThread);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.commentService.setCurrentCommentThread(undefined);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
currentThreadListeners() {
|
|
129
|
+
let hasMouse = false;
|
|
130
|
+
let hasFocus = false;
|
|
131
|
+
this._register(dom.addDisposableListener(this.container, dom.EventType.MOUSE_ENTER, (e) => {
|
|
132
|
+
if (e.toElement === this.container) {
|
|
133
|
+
hasMouse = true;
|
|
134
|
+
this.updateCurrentThread(hasMouse, hasFocus);
|
|
135
|
+
}
|
|
136
|
+
}, true));
|
|
137
|
+
this._register(dom.addDisposableListener(this.container, dom.EventType.MOUSE_LEAVE, (e) => {
|
|
138
|
+
if (e.fromElement === this.container) {
|
|
139
|
+
hasMouse = false;
|
|
140
|
+
this.updateCurrentThread(hasMouse, hasFocus);
|
|
141
|
+
}
|
|
142
|
+
}, true));
|
|
143
|
+
this._register(dom.addDisposableListener(this.container, dom.EventType.FOCUS_IN, () => {
|
|
144
|
+
hasFocus = true;
|
|
145
|
+
this.updateCurrentThread(hasMouse, hasFocus);
|
|
146
|
+
}, true));
|
|
147
|
+
this._register(dom.addDisposableListener(this.container, dom.EventType.FOCUS_OUT, () => {
|
|
148
|
+
hasFocus = false;
|
|
149
|
+
this.updateCurrentThread(hasMouse, hasFocus);
|
|
150
|
+
}, true));
|
|
151
|
+
}
|
|
152
|
+
updateCommentThread(commentThread) {
|
|
153
|
+
const shouldCollapse = (this._commentThread.collapsibleState === languages.CommentThreadCollapsibleState.Expanded) && (this._commentThreadState === languages.CommentThreadState.Unresolved)
|
|
154
|
+
&& (commentThread.state === languages.CommentThreadState.Resolved);
|
|
155
|
+
this._commentThreadState = commentThread.state;
|
|
156
|
+
this._commentThread = commentThread;
|
|
157
|
+
dispose(this._commentThreadDisposables);
|
|
158
|
+
this._commentThreadDisposables = [];
|
|
159
|
+
this._bindCommentThreadListeners();
|
|
160
|
+
this._body.updateCommentThread(commentThread, this._commentReply?.isCommentEditorFocused() ?? false);
|
|
161
|
+
this._threadIsEmpty.set(!this._body.length);
|
|
162
|
+
this._header.updateCommentThread(commentThread);
|
|
163
|
+
this._commentReply?.updateCommentThread(commentThread);
|
|
164
|
+
if (this._commentThread.contextValue) {
|
|
165
|
+
this._commentThreadContextValue.set(this._commentThread.contextValue);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this._commentThreadContextValue.reset();
|
|
169
|
+
}
|
|
170
|
+
if (shouldCollapse && this.configurationService.getValue(COMMENTS_SECTION).collapseOnResolve) {
|
|
171
|
+
this.collapse();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
display(lineHeight) {
|
|
175
|
+
const headHeight = Math.max(23, Math.ceil(lineHeight * 1.2));
|
|
176
|
+
this._header.updateHeight(headHeight);
|
|
177
|
+
this._body.display();
|
|
178
|
+
if (this._commentThread.canReply) {
|
|
179
|
+
this._createCommentForm();
|
|
180
|
+
}
|
|
181
|
+
this._createAdditionalActions();
|
|
182
|
+
this._register(this._body.onDidResize(dimension => {
|
|
183
|
+
this._refresh(dimension);
|
|
184
|
+
}));
|
|
185
|
+
if (this._commentThread.canReply && this._commentReply) {
|
|
186
|
+
this._commentReply.focusIfNeeded();
|
|
187
|
+
}
|
|
188
|
+
this._bindCommentThreadListeners();
|
|
189
|
+
}
|
|
190
|
+
_refresh(dimension) {
|
|
191
|
+
this._body.layout();
|
|
192
|
+
this._onDidResize.fire(dimension);
|
|
193
|
+
}
|
|
194
|
+
dispose() {
|
|
195
|
+
super.dispose();
|
|
196
|
+
this.updateCurrentThread(false, false);
|
|
197
|
+
}
|
|
198
|
+
_bindCommentThreadListeners() {
|
|
199
|
+
this._commentThreadDisposables.push(this._commentThread.onDidChangeCanReply(() => {
|
|
200
|
+
if (this._commentReply) {
|
|
201
|
+
this._commentReply.updateCanReply();
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
if (this._commentThread.canReply) {
|
|
205
|
+
this._createCommentForm();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}));
|
|
209
|
+
this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async (_) => {
|
|
210
|
+
await this.updateCommentThread(this._commentThread);
|
|
211
|
+
}));
|
|
212
|
+
this._commentThreadDisposables.push(this._commentThread.onDidChangeLabel(_ => {
|
|
213
|
+
this._header.createThreadLabel();
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
_createCommentForm() {
|
|
217
|
+
this._commentReply = this._scopedInstantiationService.createInstance(CommentReply, this._owner, this._body.container, this._parentEditor, this._commentThread, this._scopedInstantiationService, this._contextKeyService, this._commentMenus, this._commentOptions, this._pendingComment, this, this._containerDelegate.actionRunner);
|
|
218
|
+
this._register(this._commentReply);
|
|
219
|
+
}
|
|
220
|
+
_createAdditionalActions() {
|
|
221
|
+
this._additionalActions = this._scopedInstantiationService.createInstance(CommentThreadAdditionalActions, this._body.container, this._commentThread, this._contextKeyService, this._commentMenus, this._containerDelegate.actionRunner);
|
|
222
|
+
this._register(this._additionalActions);
|
|
223
|
+
}
|
|
224
|
+
getCommentCoords(commentUniqueId) {
|
|
225
|
+
return this._body.getCommentCoords(commentUniqueId);
|
|
226
|
+
}
|
|
227
|
+
getPendingEdits() {
|
|
228
|
+
return this._body.getPendingEdits();
|
|
229
|
+
}
|
|
230
|
+
getPendingComment() {
|
|
231
|
+
if (this._commentReply) {
|
|
232
|
+
return this._commentReply.getPendingComment();
|
|
233
|
+
}
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
setPendingComment(comment) {
|
|
237
|
+
this._pendingComment = comment;
|
|
238
|
+
this._commentReply?.setPendingComment(comment);
|
|
239
|
+
}
|
|
240
|
+
getDimensions() {
|
|
241
|
+
return this._body.getDimensions();
|
|
242
|
+
}
|
|
243
|
+
layout(widthInPixel) {
|
|
244
|
+
this._body.layout(widthInPixel);
|
|
245
|
+
if (widthInPixel !== undefined) {
|
|
246
|
+
this._commentReply?.layout(widthInPixel);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
focusCommentEditor() {
|
|
250
|
+
this._commentReply?.focusCommentEditor();
|
|
251
|
+
}
|
|
252
|
+
focus() {
|
|
253
|
+
this._body.focus();
|
|
254
|
+
}
|
|
255
|
+
async submitComment() {
|
|
256
|
+
const activeComment = this._body.activeComment;
|
|
257
|
+
if (activeComment) {
|
|
258
|
+
return activeComment.submitComment();
|
|
259
|
+
}
|
|
260
|
+
else if ((this._commentReply?.getPendingComment()?.length ?? 0) > 0) {
|
|
261
|
+
return this._commentReply?.submitComment();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
collapse() {
|
|
265
|
+
this._containerDelegate.collapse();
|
|
266
|
+
}
|
|
267
|
+
applyTheme(theme, fontInfo) {
|
|
268
|
+
const content = [];
|
|
269
|
+
content.push(`.monaco-editor .review-widget > .body { border-top: 1px solid var(${commentThreadStateColorVar}) }`);
|
|
270
|
+
content.push(`.monaco-editor .review-widget > .head { background-color: var(${commentThreadStateBackgroundColorVar}) }`);
|
|
271
|
+
const linkColor = theme.getColor(textLinkForeground);
|
|
272
|
+
if (linkColor) {
|
|
273
|
+
content.push(`.review-widget .body .comment-body a { color: ${linkColor} }`);
|
|
274
|
+
}
|
|
275
|
+
const linkActiveColor = theme.getColor(textLinkActiveForeground);
|
|
276
|
+
if (linkActiveColor) {
|
|
277
|
+
content.push(`.review-widget .body .comment-body a:hover, a:active { color: ${linkActiveColor} }`);
|
|
278
|
+
}
|
|
279
|
+
const focusColor = theme.getColor(focusBorder);
|
|
280
|
+
if (focusColor) {
|
|
281
|
+
content.push(`.review-widget .body .comment-body a:focus { outline: 1px solid ${focusColor}; }`);
|
|
282
|
+
content.push(`.review-widget .body .monaco-editor.focused { outline: 1px solid ${focusColor}; }`);
|
|
283
|
+
}
|
|
284
|
+
const blockQuoteBackground = theme.getColor(textBlockQuoteBackground);
|
|
285
|
+
if (blockQuoteBackground) {
|
|
286
|
+
content.push(`.review-widget .body .review-comment blockquote { background: ${blockQuoteBackground}; }`);
|
|
287
|
+
}
|
|
288
|
+
const blockQuoteBOrder = theme.getColor(textBlockQuoteBorder);
|
|
289
|
+
if (blockQuoteBOrder) {
|
|
290
|
+
content.push(`.review-widget .body .review-comment blockquote { border-color: ${blockQuoteBOrder}; }`);
|
|
291
|
+
}
|
|
292
|
+
const border = theme.getColor(PANEL_BORDER);
|
|
293
|
+
if (border) {
|
|
294
|
+
content.push(`.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label { border-color: ${border}; }`);
|
|
295
|
+
}
|
|
296
|
+
const hcBorder = theme.getColor(contrastBorder);
|
|
297
|
+
if (hcBorder) {
|
|
298
|
+
content.push(`.review-widget .body .comment-form .review-thread-reply-button { outline-color: ${hcBorder}; }`);
|
|
299
|
+
content.push(`.review-widget .body .monaco-editor { outline: 1px solid ${hcBorder}; }`);
|
|
300
|
+
}
|
|
301
|
+
const errorBorder = theme.getColor(inputValidationErrorBorder);
|
|
302
|
+
if (errorBorder) {
|
|
303
|
+
content.push(`.review-widget .validation-error { border: 1px solid ${errorBorder}; }`);
|
|
304
|
+
}
|
|
305
|
+
const errorBackground = theme.getColor(inputValidationErrorBackground);
|
|
306
|
+
if (errorBackground) {
|
|
307
|
+
content.push(`.review-widget .validation-error { background: ${errorBackground}; }`);
|
|
308
|
+
}
|
|
309
|
+
const errorForeground = theme.getColor(inputValidationErrorForeground);
|
|
310
|
+
if (errorForeground) {
|
|
311
|
+
content.push(`.review-widget .body .comment-form .validation-error { color: ${errorForeground}; }`);
|
|
312
|
+
}
|
|
313
|
+
const fontFamilyVar = '--comment-thread-editor-font-family';
|
|
314
|
+
const fontSizeVar = '--comment-thread-editor-font-size';
|
|
315
|
+
const fontWeightVar = '--comment-thread-editor-font-weight';
|
|
316
|
+
this.container?.style.setProperty(fontFamilyVar, fontInfo.fontFamily);
|
|
317
|
+
this.container?.style.setProperty(fontSizeVar, `${fontInfo.fontSize}px`);
|
|
318
|
+
this.container?.style.setProperty(fontWeightVar, fontInfo.fontWeight);
|
|
319
|
+
content.push(`.review-widget .body code {
|
|
320
|
+
font-family: var(${fontFamilyVar});
|
|
321
|
+
font-weight: var(${fontWeightVar});
|
|
322
|
+
}`);
|
|
323
|
+
this._styleElement.textContent = content.join('\n');
|
|
324
|
+
this._commentReply?.setCommentEditorDecorations();
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
CommentThreadWidget = ( __decorate([
|
|
328
|
+
( __param(12, ICommentService)),
|
|
329
|
+
( __param(13, IContextMenuService)),
|
|
330
|
+
( __param(14, IConfigurationService)),
|
|
331
|
+
( __param(15, IKeybindingService))
|
|
332
|
+
], CommentThreadWidget));
|
|
333
|
+
export { CommentThreadWidget };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
var css = ".review-widget{position:absolute;width:100%}.monaco-editor .review-widget{background-color:var(--vscode-peekViewResult-background)}.review-widget .hidden{display:none!important}.review-widget .body{overflow:hidden}.review-widget .body .review-comment{display:flex;padding:8px 16px 8px 20px}@keyframes monaco-review-widget-focus{0%{background:var(--vscode-peekViewResult-selectionBackground)}to{background:transparent}}.review-widget .body .review-comment.focus{animation:monaco-review-widget-focus 3s ease 0s}.review-widget .body .review-comment .comment-actions{margin-left:auto}.review-widget .body .review-comment .comment-actions .monaco-toolbar{height:22px}.review-widget .body .review-comment .comment-title .comment-header-info{overflow:hidden;text-overflow:ellipsis}.review-widget .body .review-comment .comment-title{display:flex;width:100%}.review-widget .body .review-comment .comment-title .action-label.codicon{line-height:18px}.review-widget .body .review-comment .comment-title .monaco-dropdown .toolbar-toggle-more{height:18px;line-height:18px;vertical-align:middle;width:16px}.review-widget .body .comment-body blockquote{border-left-style:solid;border-left-width:5px;margin:0 7px 0 5px;padding:0 16px 0 10px}.review-widget .body .review-comment .avatar-container{margin-top:4px!important}.review-widget .body .review-comment .avatar-container img.avatar{border-radius:3px;border-style:none;display:inline-block;height:28px;line-height:1;overflow:hidden;vertical-align:middle;width:28px}.review-widget .body .comment-reactions .monaco-text-button{background-color:transparent;border:1px solid grey;border-radius:3px;margin:0 7px 0 0;width:30px}.review-widget .body .review-comment .review-comment-contents{overflow:hidden;padding-left:20px;user-select:text;-webkit-user-select:text;width:100%}.review-widget .body pre{word-wrap:normal;overflow:auto;white-space:pre}.review-widget .body .review-comment .review-comment-contents .author{line-height:22px}.review-widget .body .review-comment .review-comment-contents .isPending{font-style:italic;line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .timestamp{line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .comment-body .comment-body-plainstring{white-space:pre-wrap}.review-widget .body .review-comment .review-comment-contents .comment-body{padding-top:4px}.review-widget .body .review-comment .review-comment-contents .comment-body-max-height{max-height:20em}.review-widget .body .review-comment .review-comment-contents .comment-reactions{margin-top:8px;min-height:25px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label{display:flex;font-size:12px;padding:1px 4px;text-align:center;white-space:pre}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-icon{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-position:0;background-repeat:no-repeat;background-size:14px;display:inline-block;margin-right:4px;width:14px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-label{line-height:20px;margin-right:4px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.toolbar-toggle-pickReactions{background-position:50%;background-repeat:no-repeat;background-size:16px;border:none;display:none;font-size:16px;height:16px;margin-top:3px;width:26px}.review-widget .body .review-comment .review-comment-contents .comment-reactions:hover .action-item a.action-label.toolbar-toggle-pickReactions{background-size:16px;display:inline-block}.review-widget .body .review-comment .comment-title .action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block;height:16px;line-height:16px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label{border:1px solid}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.disabled{opacity:.6}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.active:hover{background-color:var(--vscode-statusBarItem-hoverBackground)}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label:active{background-color:var(--vscode-statusBarItem-activeBackground);border:1px solid transparent}.review-widget .body .review-comment .review-comment-contents a{cursor:pointer}.review-widget .body .comment-body p,.review-widget .body .comment-body ul{margin:8px 0}.review-widget .body .comment-body p:first-child,.review-widget .body .comment-body ul:first-child{margin-top:0}.review-widget .body .comment-body p:last-child,.review-widget .body.comment-body ul:last-child{margin-bottom:0}.review-widget .body .comment-body ul{padding-left:20px}.review-widget .body .comment-body li>p{margin-bottom:0}.review-widget .body .comment-body li>ul{margin-top:0}.review-widget .body .comment-body code{border-radius:3px;padding:0 .4em}.review-widget .body .comment-body span{white-space:pre}.review-widget .body .comment-body img{max-width:100%}.review-widget .body .comment-form{margin:8px 20px}.review-widget .validation-error{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-left:-1px;margin-top:-1px;min-height:34px;overflow:hidden;padding:.4em;text-align:left;width:100%}.review-widget .body .comment-additional-actions{margin:10px 20px}.review-widget .body .comment-additional-actions .section-separator{border-top:1px solid var(--vscode-menu-separatorBackground);margin:10px 0 14px}.review-widget .body .comment-additional-actions .button-bar{display:flex;white-space:nowrap}.review-widget .body .comment-additional-actions .monaco-button,.review-widget .body .comment-additional-actions .monaco-button-dropdown,.review-widget .body .comment-additional-actions .monaco-text-button{display:flex;width:auto}.review-widget .body .comment-additional-actions .button-bar>.monaco-button-dropdown,.review-widget .body .comment-additional-actions .button-bar>.monaco-text-button{margin:0 10px 0 0}.review-widget .body .comment-additional-actions .button-bar .monaco-text-button{padding:4px 10px}.review-widget .body .comment-additional-actions .codicon-drop-down-button{align-items:center}.review-widget .body .monaco-editor{color:var(--vscode-editor-foreground)}.review-widget .body .comment-form.expand .review-thread-reply-button{display:none}.review-widget .body .comment-form.expand .form-actions,.review-widget .body .comment-form.expand .monaco-editor{box-sizing:content-box;display:block}.review-widget .body .comment-form .review-thread-reply-button{background-color:var(--vscode-editorCommentsWidget-replyInputBackground);border:0;border-radius:0;box-sizing:border-box;color:var(--vscode-editor-foreground);display:block;font-family:var(--monaco-monospace-font);font-size:inherit;font-weight:600;line-height:20px;outline:1px solid transparent;padding:6px 12px;resize:vertical;text-align:left;white-space:nowrap;width:100%}.review-widget .body .comment-form .review-thread-reply-button:focus{outline-style:solid;outline-width:1px}.review-widget .body .comment-form .monaco-editor,.review-widget .body .comment-form .monaco-editor .monaco-editor-background,.review-widget .body .edit-container .monaco-editor .monaco-editor-background{background-color:var(--vscode-editorCommentsWidget-replyInputBackground)}.review-widget .body .comment-form .monaco-editor,.review-widget .body .edit-container .monaco-editor{border:0;border-radius:3px;box-sizing:content-box;max-height:500px;min-height:90px;padding:6px 0 6px 12px;width:100%}.review-widget .body .comment-form .form-actions,.review-widget .body .comment-form .monaco-editor{display:none}.review-widget .body .comment-form .form-actions,.review-widget .body .edit-container .form-actions{margin:10px 0;overflow:auto}.review-widget .body .edit-container .form-actions{padding-top:10px}.review-widget .body .edit-textarea{margin:5px 12px 10px 0}.review-widget .body .comment-form .monaco-text-button,.review-widget .body .edit-container .monaco-text-button{margin-left:5px;padding:4px 10px;width:auto}.review-widget .body .form-actions .monaco-text-button{float:right}.review-widget .head{box-sizing:border-box;display:flex;height:100%}.review-widget .head .review-title{cursor:default;display:inline-block;font-size:13px;margin-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.review-widget .head .review-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.review-widget .head .review-actions{flex:1;padding-right:2px;text-align:right}.review-widget .head .review-actions>.monaco-action-bar{display:inline-block}.review-widget .head .review-actions>.monaco-action-bar,.review-widget .head .review-actions>.monaco-action-bar>.actions-container{height:100%}.review-widget .action-item{margin-left:4px;min-height:20px;min-width:18px}.review-widget .head .review-actions>.monaco-action-bar .action-label{background-position:50%;background-repeat:no-repeat;line-height:inherit;margin:0}.review-widget .head .review-actions>.monaco-action-bar .action-label.codicon{margin:0}.review-widget>.body{border-top:1px solid;position:relative}.monaco-editor .comment-range-glyph{cursor:pointer;margin-left:10px;width:4px!important;z-index:10}div.preview.inline .monaco-editor .comment-range-glyph{display:none!important}.monaco-editor .comment-diff-added{border-left-style:solid;border-left-width:3px}.monaco-editor .comment-diff-added,.monaco-editor .comment-range-glyph.multiline-add{border-left-color:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-diff-added:before,.monaco-editor .comment-range-glyph.line-hover:before,.monaco-editor .comment-thread-unresolved:before,.monaco-editor .comment-thread:before{background:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-thread-range{background-color:var(--vscode-editorCommentsWidget-rangeBackground)}.monaco-editor .comment-thread-range-current{background-color:var(--vscode-editorCommentsWidget-rangeActiveBackground)}.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread,.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread-unresolved,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover{margin-left:13px}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{align-items:center;color:var(--vscode-editorGutter-commentGlyphForeground);display:flex;flex-direction:row;height:100%;justify-content:center;left:-6px;position:absolute;text-align:center;width:9px;z-index:10}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{color:var(--vscode-editorGutter-commentUnresolvedGlyphForeground)}.monaco-editor .margin-view-overlays .comment-range-glyph.multiline-add{border-left-style:dotted;border-left-width:3px;height:16px;margin-top:2px}.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{border-radius:3px;content:\"\\ea60\";font-family:codicon;margin-left:-5px;padding-left:1px;width:18px!important}.monaco-editor .comment-range-glyph.comment-thread,.monaco-editor .comment-range-glyph.comment-thread-unresolved{z-index:20}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before{border-radius:3px;font-family:codicon;font-size:13px;line-height:100%;margin-left:-5px;padding-left:1px;padding-top:1px;width:18px!important;z-index:20}.monaco-editor .comment-range-glyph.comment-thread:before{content:\"\\ea6b\"}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{content:\"\\ec0a\"}.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-collapsed,.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-expanded{margin-left:11px}.monaco-editor.inline-comment .margin-view-overlays .dirty-diff-glyph{margin-left:25px}";
|
|
3
|
+
n(css,{});
|
|
4
|
+
export { css, css as default };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
4
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
5
|
+
import { ActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
|
|
6
|
+
class ToggleReactionsAction extends Action {
|
|
7
|
+
static { this.ID = 'toolbar.toggle.pickReactions'; }
|
|
8
|
+
constructor(toggleDropdownMenu, title) {
|
|
9
|
+
super(ToggleReactionsAction.ID, title || ( nls.localizeWithPath(
|
|
10
|
+
'vs/workbench/contrib/comments/browser/reactionsAction',
|
|
11
|
+
'pickReactions',
|
|
12
|
+
"Pick Reactions..."
|
|
13
|
+
)), 'toggle-reactions', true);
|
|
14
|
+
this._menuActions = [];
|
|
15
|
+
this.toggleDropdownMenu = toggleDropdownMenu;
|
|
16
|
+
}
|
|
17
|
+
run() {
|
|
18
|
+
this.toggleDropdownMenu();
|
|
19
|
+
return Promise.resolve(true);
|
|
20
|
+
}
|
|
21
|
+
get menuActions() {
|
|
22
|
+
return this._menuActions;
|
|
23
|
+
}
|
|
24
|
+
set menuActions(actions) {
|
|
25
|
+
this._menuActions = actions;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class ReactionActionViewItem extends ActionViewItem {
|
|
29
|
+
constructor(action) {
|
|
30
|
+
super(null, action, {});
|
|
31
|
+
}
|
|
32
|
+
updateLabel() {
|
|
33
|
+
if (!this.label) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const action = this.action;
|
|
37
|
+
if (action.class) {
|
|
38
|
+
this.label.classList.add(action.class);
|
|
39
|
+
}
|
|
40
|
+
if (!action.icon) {
|
|
41
|
+
const reactionLabel = dom.append(this.label, dom.$('span.reaction-label'));
|
|
42
|
+
reactionLabel.innerText = action.label;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const reactionIcon = dom.append(this.label, dom.$('.reaction-icon'));
|
|
46
|
+
const uri = URI.revive(action.icon);
|
|
47
|
+
reactionIcon.style.backgroundImage = dom.asCSSUrl(uri);
|
|
48
|
+
reactionIcon.title = action.label;
|
|
49
|
+
}
|
|
50
|
+
if (action.count) {
|
|
51
|
+
const reactionCount = dom.append(this.label, dom.$('span.reaction-count'));
|
|
52
|
+
reactionCount.innerText = `${action.count}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
getTooltip() {
|
|
56
|
+
const action = this.action;
|
|
57
|
+
const toggleMessage = action.enabled ? ( nls.localizeWithPath(
|
|
58
|
+
'vs/workbench/contrib/comments/browser/reactionsAction',
|
|
59
|
+
'comment.toggleableReaction',
|
|
60
|
+
"Toggle reaction, "
|
|
61
|
+
)) : '';
|
|
62
|
+
if (action.count === undefined) {
|
|
63
|
+
return ( nls.localizeWithPath('vs/workbench/contrib/comments/browser/reactionsAction', {
|
|
64
|
+
key: 'comment.reactionLabelNone', comment: [
|
|
65
|
+
'This is a tooltip for an emoji button so that the current user can toggle their reaction to a comment.',
|
|
66
|
+
'The first arg is localized message "Toggle reaction" or empty if the user doesn\'t have permission to toggle the reaction, the second is the name of the reaction.'
|
|
67
|
+
]
|
|
68
|
+
}, "{0}{1} reaction", toggleMessage, action.label));
|
|
69
|
+
}
|
|
70
|
+
else if (action.count === 1) {
|
|
71
|
+
return ( nls.localizeWithPath('vs/workbench/contrib/comments/browser/reactionsAction', {
|
|
72
|
+
key: 'comment.reactionLabelOne', comment: [
|
|
73
|
+
'This is a tooltip for an emoji that is a "reaction" to a comment where the count of the reactions is 1.',
|
|
74
|
+
'The emoji is also a button so that the current user can also toggle their own emoji reaction.',
|
|
75
|
+
'The first arg is localized message "Toggle reaction" or empty if the user doesn\'t have permission to toggle the reaction, the second is the name of the reaction.'
|
|
76
|
+
]
|
|
77
|
+
}, "{0}1 reaction with {1}", toggleMessage, action.label));
|
|
78
|
+
}
|
|
79
|
+
else if (action.count > 1) {
|
|
80
|
+
return ( nls.localizeWithPath('vs/workbench/contrib/comments/browser/reactionsAction', {
|
|
81
|
+
key: 'comment.reactionLabelMany', comment: [
|
|
82
|
+
'This is a tooltip for an emoji that is a "reaction" to a comment where the count of the reactions is greater than 1.',
|
|
83
|
+
'The emoji is also a button so that the current user can also toggle their own emoji reaction.',
|
|
84
|
+
'The first arg is localized message "Toggle reaction" or empty if the user doesn\'t have permission to toggle the reaction, the second is number of users who have reacted with that reaction, and the third is the name of the reaction.'
|
|
85
|
+
]
|
|
86
|
+
}, "{0}{1} reactions with {2}", toggleMessage, action.count, action.label));
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
class ReactionAction extends Action {
|
|
92
|
+
static { this.ID = 'toolbar.toggle.reaction'; }
|
|
93
|
+
constructor(id, label = '', cssClass = '', enabled = true, actionCallback, icon, count) {
|
|
94
|
+
super(ReactionAction.ID, label, cssClass, enabled, actionCallback);
|
|
95
|
+
this.icon = icon;
|
|
96
|
+
this.count = count;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export { ReactionAction, ReactionActionViewItem, ToggleReactionsAction };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
2
|
+
import { fromNow } from '../../../../base/common/date.js';
|
|
3
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { language } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
5
|
+
import { COMMENTS_SECTION } from '../common/commentsConfiguration.js';
|
|
6
|
+
class TimestampWidget extends Disposable {
|
|
7
|
+
constructor(configurationService, container, timeStamp) {
|
|
8
|
+
super();
|
|
9
|
+
this.configurationService = configurationService;
|
|
10
|
+
this._date = dom.append(container, dom.$('span.timestamp'));
|
|
11
|
+
this._date.style.display = 'none';
|
|
12
|
+
this._useRelativeTime = this.useRelativeTimeSetting;
|
|
13
|
+
this.setTimestamp(timeStamp);
|
|
14
|
+
}
|
|
15
|
+
get useRelativeTimeSetting() {
|
|
16
|
+
return this.configurationService.getValue(COMMENTS_SECTION).useRelativeTime;
|
|
17
|
+
}
|
|
18
|
+
async setTimestamp(timestamp) {
|
|
19
|
+
if ((timestamp !== this._timestamp) || (this.useRelativeTimeSetting !== this._useRelativeTime)) {
|
|
20
|
+
this.updateDate(timestamp);
|
|
21
|
+
}
|
|
22
|
+
this._timestamp = timestamp;
|
|
23
|
+
this._useRelativeTime = this.useRelativeTimeSetting;
|
|
24
|
+
}
|
|
25
|
+
updateDate(timestamp) {
|
|
26
|
+
if (!timestamp) {
|
|
27
|
+
this._date.textContent = '';
|
|
28
|
+
this._date.style.display = 'none';
|
|
29
|
+
}
|
|
30
|
+
else if ((timestamp !== this._timestamp)
|
|
31
|
+
|| (this.useRelativeTimeSetting !== this._useRelativeTime)) {
|
|
32
|
+
this._date.style.display = '';
|
|
33
|
+
let textContent;
|
|
34
|
+
let tooltip;
|
|
35
|
+
if (this.useRelativeTimeSetting) {
|
|
36
|
+
textContent = this.getRelative(timestamp);
|
|
37
|
+
tooltip = this.getDateString(timestamp);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
textContent = this.getDateString(timestamp);
|
|
41
|
+
}
|
|
42
|
+
this._date.textContent = textContent;
|
|
43
|
+
if (tooltip) {
|
|
44
|
+
this._date.title = tooltip;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
getRelative(date) {
|
|
49
|
+
return fromNow(date, true, true);
|
|
50
|
+
}
|
|
51
|
+
getDateString(date) {
|
|
52
|
+
return date.toLocaleString(language);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export { TimestampWidget };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
4
|
+
import { ILayoutService } from 'monaco-editor/esm/vs/platform/layout/browser/layoutService.js';
|
|
5
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
6
|
+
import { Extensions } from '../../../common/contributions.js';
|
|
7
|
+
let ContextMenuContribution = class ContextMenuContribution {
|
|
8
|
+
constructor(layoutService, contextMenuService) {
|
|
9
|
+
this.disposables = ( new DisposableStore());
|
|
10
|
+
const update = (visible) => layoutService.activeContainer.classList.toggle('context-menu-visible', visible);
|
|
11
|
+
contextMenuService.onDidShowContextMenu(() => update(true), null, this.disposables);
|
|
12
|
+
contextMenuService.onDidHideContextMenu(() => update(false), null, this.disposables);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
ContextMenuContribution = ( __decorate([
|
|
16
|
+
( __param(0, ILayoutService)),
|
|
17
|
+
( __param(1, IContextMenuService))
|
|
18
|
+
], ContextMenuContribution));
|
|
19
|
+
( Registry.as(Extensions.Workbench))
|
|
20
|
+
.registerWorkbenchContribution(ContextMenuContribution, 4 );
|