@codingame/monaco-vscode-api 4.5.2 → 5.0.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/api.js +1 -1
- package/extensions.d.ts +2 -3
- package/lifecycle.js +6 -0
- package/localExtensionHost.d.ts +4 -1
- package/missing-services.js +41 -25
- package/package.json +8 -8
- package/service-override/tools/editor.js +31 -8
- package/service-override/tools/views.d.ts +1 -1
- package/service-override/tools/views.js +2 -3
- package/service-override/views.d.ts +0 -1
- package/services.d.ts +3 -3
- package/services.js +3 -3
- package/vscode/src/vs/base/browser/markdownRenderer.js +9 -3
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +2 -2
- package/vscode/src/vs/base/browser/ui/button/button.js +3 -3
- package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +1 -1
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +2 -2
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +2 -2
- package/vscode/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.js +2 -2
- package/vscode/src/vs/{platform/hover/browser → base/browser/ui/hover}/hover.d.ts +64 -4
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js +13 -0
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.js +30 -14
- package/vscode/src/vs/base/browser/ui/iconLabel/iconLabel.js +15 -2
- package/vscode/src/vs/base/browser/ui/iconLabel/simpleIconLabel.js +2 -2
- package/vscode/src/vs/base/browser/ui/icons/iconSelectBox.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/icons/iconSelectBox.js +239 -0
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +2 -2
- package/vscode/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +2 -2
- package/vscode/src/vs/base/browser/ui/list/listView.js +5 -3
- package/vscode/src/vs/base/browser/ui/list/listWidget.d.ts +33 -0
- package/vscode/src/vs/base/browser/ui/list/listWidget.js +4 -1
- package/vscode/src/vs/base/browser/ui/menu/menu.js +1 -0
- package/vscode/src/vs/base/browser/ui/menu/menubar.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/progressbar/progressAccessibilitySignal.js +13 -0
- package/vscode/src/vs/base/browser/ui/progressbar/progressbar.js +7 -1
- package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.js +2 -2
- package/vscode/src/vs/base/browser/ui/table/tableWidget.js +2 -2
- package/vscode/src/vs/base/browser/ui/toggle/toggle.js +8 -2
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +11 -4
- package/vscode/src/vs/base/browser/ui/tree/media/tree.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/objectTree.js +6 -4
- package/vscode/src/vs/base/common/arraysFind.js +7 -7
- package/vscode/src/vs/base/common/async.js +8 -3
- package/vscode/src/vs/base/common/cache.js +29 -10
- package/vscode/src/vs/base/common/cancellation.js +6 -1
- package/vscode/src/vs/base/common/codicons.d.ts +3 -0
- package/vscode/src/vs/base/common/codiconsLibrary.js +3 -0
- package/vscode/src/vs/base/common/controlFlow.js +48 -0
- package/vscode/src/vs/base/common/equals.js +44 -0
- package/vscode/src/vs/base/common/event.d.ts +11 -1
- package/vscode/src/vs/base/common/event.js +26 -1
- package/vscode/src/vs/base/common/jsonEdit.js +1 -1
- package/vscode/src/vs/base/common/lifecycle.js +1 -1
- package/vscode/src/vs/base/common/map.js +53 -4
- package/vscode/src/vs/base/common/network.js +2 -0
- package/vscode/src/vs/base/common/objects.js +3 -0
- package/vscode/src/vs/base/common/observableInternal/autorun.js +1 -10
- package/vscode/src/vs/base/common/observableInternal/base.js +22 -10
- package/vscode/src/vs/base/common/observableInternal/derived.js +8 -8
- package/vscode/src/vs/base/common/observableInternal/promise.js +19 -1
- package/vscode/src/vs/base/common/observableInternal/utils.js +30 -52
- package/vscode/src/vs/base/common/product.d.ts +1 -0
- package/vscode/src/vs/base/common/strings.js +1 -1
- package/vscode/src/vs/base/common/types.d.ts +5 -1
- package/vscode/src/vs/editor/browser/config/editorConfiguration.js +3 -2
- package/vscode/src/vs/editor/browser/observableUtilities.js +58 -0
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.js +121 -2
- package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +80 -0
- package/vscode/src/vs/editor/browser/stableEditorScroll.js +37 -1
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -3
- package/vscode/src/vs/editor/browser/widget/codeEditor/editor.css.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +7 -5
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorSash.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +3 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +3 -10
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +8 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +6 -6
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +1 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +3 -2
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.js +17 -8
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.js +1 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +27 -19
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/style.css.js +1 -1
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +4 -4
- package/vscode/src/vs/editor/common/core/lineRange.d.ts +12 -0
- package/vscode/src/vs/editor/common/core/lineRange.js +28 -0
- package/vscode/src/vs/editor/common/core/textEdit.d.ts +21 -0
- package/vscode/src/vs/editor/common/core/textEdit.js +13 -1
- package/vscode/src/vs/editor/common/core/textLength.d.ts +29 -0
- package/vscode/src/vs/editor/common/core/textLength.js +6 -0
- package/vscode/src/vs/editor/common/cursor/cursorCollection.js +3 -3
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +11 -1
- package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +11 -0
- package/vscode/src/vs/editor/common/diff/rangeMapping.js +34 -3
- package/vscode/src/vs/editor/common/languages.d.ts +50 -10
- package/vscode/src/vs/editor/common/languages.js +11 -1
- package/vscode/src/vs/editor/common/services/languageFeatureDebounce.js +1 -1
- package/vscode/src/vs/editor/common/services/languageFeatures.d.ts +2 -2
- package/vscode/src/vs/editor/common/services/languageFeaturesService.js +1 -1
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +11 -1
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +3 -0
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +22 -6
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +5 -0
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +1 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorContributions.js +1 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions.js +20 -3
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +2 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +4 -4
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +2 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +7 -0
- package/vscode/src/vs/editor/contrib/find/browser/findController.js +11 -6
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +10 -10
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverComputer.js +74 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverController.js +332 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.js +34 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverTypes.js +39 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidget.js +355 -0
- package/vscode/src/vs/editor/contrib/hover/browser/getHover.js +11 -14
- package/vscode/src/vs/editor/contrib/hover/browser/hover.css.js +1 -1
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +13 -0
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +354 -0
- package/vscode/src/vs/editor/contrib/hover/browser/hoverContribution.js +42 -0
- package/vscode/src/vs/editor/contrib/hover/browser/hoverController.js +320 -0
- package/vscode/src/vs/editor/contrib/hover/browser/marginHoverComputer.js +48 -0
- package/vscode/src/vs/editor/contrib/hover/browser/{marginHover.js → marginHoverWidget.js} +14 -48
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +250 -41
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +1 -0
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +44 -20
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +11 -7
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/commands.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +2 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +26 -13
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +5 -11
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +24 -22
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.js +39 -70
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.js +3 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/utils.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.js +4 -2
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.js +5 -3
- package/vscode/src/vs/editor/contrib/inlineProgress/browser/inlineProgressWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/rename/browser/rename.js +18 -6
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +165 -40
- package/vscode/src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +5 -0
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +3 -3
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +15 -8
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +13 -6
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +0 -2
- package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +9 -2
- package/vscode/src/vs/editor/standalone/browser/standaloneCodeEditor.js +23 -18
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +33 -11
- package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +1 -9
- package/vscode/src/vs/platform/accessibility/common/accessibility.js +2 -1
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.d.ts +15 -9
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +133 -132
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service.d.ts +12 -5
- package/vscode/src/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler.js +25 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +4 -4
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +10 -7
- package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +1 -1
- package/vscode/src/vs/platform/actions/browser/toolbar.d.ts +4 -1
- package/vscode/src/vs/platform/actions/browser/toolbar.js +53 -36
- package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -1
- package/vscode/src/vs/platform/actions/common/actions.js +14 -4
- package/vscode/src/vs/platform/actions/common/menuService.js +30 -8
- package/vscode/src/vs/platform/configuration/common/configuration.js +4 -0
- package/vscode/src/vs/platform/configuration/common/configurationModels.js +43 -32
- package/vscode/src/vs/platform/configuration/common/configurations.js +12 -10
- package/vscode/src/vs/platform/contextview/browser/contextView.d.ts +4 -1
- package/vscode/src/vs/platform/contextview/browser/contextView.service.d.ts +2 -3
- package/vscode/src/vs/platform/contextview/browser/contextViewService.js +10 -8
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +0 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +1 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +1 -0
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +5 -0
- package/vscode/src/vs/platform/files/common/files.d.ts +14 -1
- package/vscode/src/vs/platform/hover/browser/hover.service.d.ts +2 -31
- package/vscode/src/vs/platform/instantiation/common/instantiation.d.ts +9 -0
- package/vscode/src/vs/platform/instantiation/common/instantiationService.js +42 -8
- package/vscode/src/vs/platform/log/common/log.js +3 -1
- package/vscode/src/vs/platform/markers/common/markerService.js +7 -3
- package/vscode/src/vs/platform/opener/browser/link.js +6 -4
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +2 -2
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +15 -7
- package/vscode/src/vs/platform/telemetry/common/gdprTypings.d.ts +0 -1
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +5 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.d.ts +30 -0
- package/vscode/src/vs/platform/theme/browser/defaultStyles.js +6 -0
- package/vscode/src/vs/platform/theme/browser/iconsStyleSheet.js +13 -11
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +28 -28
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -6
- package/vscode/src/vs/workbench/api/common/extHostBulkEdits.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +104 -96
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostConfiguration.js +9 -3
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostDocumentSaveParticipant.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostFileSystemEventService.js +19 -1
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +87 -17
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +39 -2
- package/vscode/src/vs/workbench/api/common/extHostNotebookDocumentSaveParticipant.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostTerminalShellIntegration.js +52 -36
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +10 -28
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +132 -136
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +72 -18
- package/vscode/src/vs/workbench/api/common/extHostWindow.js +3 -5
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +86 -76
- package/vscode/src/vs/workbench/browser/actions/media/actions.css.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/widgetNavigationCommands.js +30 -6
- package/vscode/src/vs/workbench/browser/labels.js +4 -1
- package/vscode/src/vs/workbench/browser/parts/compositePart.d.ts +3 -1
- package/vscode/src/vs/workbench/browser/parts/editor/diffEditorCommands.js +19 -7
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +16 -3
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorquickaccess.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +14 -33
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +33 -13
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +7 -5
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +4 -3
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.d.ts +2 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +3 -1
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +182 -63
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +14 -3
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +61 -34
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +16 -10
- package/vscode/src/vs/workbench/common/theme.js +144 -98
- package/vscode/src/vs/workbench/common/views.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +190 -138
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +876 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +59 -7
- package/vscode/src/vs/workbench/contrib/accessibility/browser/{accessibilityContributions.js → accessibleViewContributions.js} +160 -6
- package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +66 -150
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +21 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +30 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +201 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +42 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +13 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +366 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +35 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/annotations.js +4 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +95 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.service.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +94 -79
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatParticipantContribTypes.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +7 -9
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +1 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +30 -26
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +30 -29
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +4 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +5 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +13 -13
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +26 -16
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +107 -26
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +23 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +2 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +39 -11
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +53 -33
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +967 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +101 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +4 -1
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +82 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +10 -9
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +79 -45
- package/vscode/src/vs/workbench/contrib/files/browser/{fileCommands.save.js → fileCommands._save.js} +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/{files.configuration.contribution.js → files.contribution._configuration.js} +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/{files.editorPane.contribution.js → files.contribution._editorPane.js} +18 -18
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +5 -3
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +19 -14
- package/vscode/src/vs/workbench/contrib/files/browser/views/media/openeditors.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +8 -8
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +15 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +29 -112
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.js +10 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +99 -91
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +9 -31
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +345 -104
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +62 -69
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +63 -46
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +18 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatContentWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +1 -31
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +7 -3
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +5 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +2 -48
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +28 -23
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +5 -9
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +112 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +18 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +7 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +4 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +8 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +36 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +17 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +5 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +2 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +22 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +34 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +15 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProviderFactory.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +17 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +52 -16
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +25 -12
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +6 -4
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +0 -2
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +6 -4
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +24 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +38 -8
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +0 -1
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +1 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +7 -14
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.d.ts +24 -6
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.js +2 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +8 -9
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +2 -20
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +1 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testItemCollection.js +10 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +15 -3
- package/vscode/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.service.d.ts +9 -0
- package/vscode/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.service.js +3 -0
- package/vscode/src/vs/workbench/services/editor/common/customEditorLabelService.js +30 -16
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +15 -4
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.service.d.ts +20 -1
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +0 -1
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +4 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManagers.d.ts +4 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocation.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +8 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +2 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensions.service.d.ts +4 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +3 -3
- package/vscode/src/vs/workbench/services/language/common/languageService.js +23 -18
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +6 -4
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +50 -9
- package/vscode/src/vs/workbench/services/themes/common/workbenchThemeService.js +1 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/iconSelectBox.js +97 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopy.d.ts +7 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +2 -2
- package/vscode-dts/vscode.proposed.chatParticipant.d.ts +23 -45
- package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +65 -91
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +9 -0
- package/vscode-dts/vscode.proposed.chatTab.d.ts +1 -5
- package/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts +15 -0
- package/vscode-dts/vscode.proposed.debugFocus.d.ts +4 -4
- package/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts +2 -2
- package/vscode-dts/vscode.proposed.documentPaste.d.ts +144 -43
- package/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts +76 -0
- package/vscode-dts/vscode.proposed.interactive.d.ts +1 -17
- package/vscode-dts/vscode.proposed.languageModels.d.ts +56 -11
- package/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts +12 -1
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +4 -4
- package/vscode-dts/vscode.proposed.speech.d.ts +2 -1
- package/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts +144 -38
- package/vscode-dts/vscode.proposed.testPreserveFocus.d.ts +28 -0
- package/vscode/src/vs/base/browser/ui/hover/updatableHoverWidget.d.ts +0 -21
- package/vscode/src/vs/base/browser/ui/hover/updatableHoverWidget.js +0 -214
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.d.ts +0 -32
- package/vscode/src/vs/editor/contrib/hover/browser/contentHover.js +0 -838
- package/vscode/src/vs/editor/contrib/hover/browser/hover.js +0 -621
- package/vscode/src/vs/platform/accessibility/common/accessibility.service.d.ts +0 -19
- package/vscode/src/vs/workbench/api/common/extHostChat.js +0 -54
- package/vscode/src/vs/workbench/api/common/extHostIssueReporter.js +0 -70
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.contribution.js +0 -237
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignalDebuggerContribution.js +0 -49
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignalLineFeatureContribution.js +0 -178
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/commands.js +0 -141
- package/vscode/src/vs/workbench/contrib/chat/common/chatContributionService.service.js +0 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatFileCreationWidget.js +0 -212
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +0 -95
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +0 -110
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +0 -224
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.d.ts +0 -48
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEvents.js +0 -47
- package/vscode-dts/vscode.proposed.dropMetadata.d.ts +0 -65
- package/vscode-dts/vscode.proposed.handleIssueUri.d.ts +0 -57
- package/vscode-dts/vscode.proposed.windowActivity.d.ts +0 -17
- /package/vscode/src/vs/workbench/browser/parts/editor/{editor.autosave.contribution.js → editor.contribution._autosave.js} +0 -0
- /package/vscode/src/vs/workbench/contrib/files/browser/{files.fileEditorFactory.contribution.js → files.contribution._fileEditorFactory.js} +0 -0
|
@@ -0,0 +1,876 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { addDisposableListener, EventType, isActiveElement, getActiveWindow } from '../../../../base/browser/dom.js';
|
|
3
|
+
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
|
4
|
+
import { alert } from '../../../../base/browser/ui/aria/aria.js';
|
|
5
|
+
import { Codicon } from '../../../../base/common/codicons.js';
|
|
6
|
+
import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
7
|
+
import marked_1 from '../../../../../../../external/vscode-marked/lib/marked.esm.js';
|
|
8
|
+
import { isWindows, isMacintosh } from '../../../../base/common/platform.js';
|
|
9
|
+
import { ThemeIcon } from '../../../../base/common/themables.js';
|
|
10
|
+
import { URI } from '../../../../base/common/uri.js';
|
|
11
|
+
import { EditorExtensionsRegistry } from '../../../../editor/browser/editorExtensions.js';
|
|
12
|
+
import { CodeEditorWidget } from '../../../../editor/browser/widget/codeEditor/codeEditorWidget.js';
|
|
13
|
+
import { Position } from '../../../../editor/common/core/position.js';
|
|
14
|
+
import { IModelService } from '../../../../editor/common/services/model.js';
|
|
15
|
+
import { AccessibilityHelpNLS } from '../../../../editor/common/standaloneStrings.js';
|
|
16
|
+
import { CodeActionController } from '../../../../editor/contrib/codeAction/browser/codeActionController.js';
|
|
17
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
18
|
+
import { ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX } from '../../../../platform/accessibility/common/accessibility.js';
|
|
19
|
+
import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.service.js';
|
|
20
|
+
import { createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';
|
|
21
|
+
import { WorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js';
|
|
22
|
+
import { MenuId } from '../../../../platform/actions/common/actions.js';
|
|
23
|
+
import { IMenuService } from '../../../../platform/actions/common/actions.service.js';
|
|
24
|
+
import { ICommandService } from '../../../../platform/commands/common/commands.service.js';
|
|
25
|
+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
26
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.service.js';
|
|
27
|
+
import { IContextViewService } from '../../../../platform/contextview/browser/contextView.service.js';
|
|
28
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
29
|
+
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.service.js';
|
|
30
|
+
import { ILayoutService } from '../../../../platform/layout/browser/layoutService.service.js';
|
|
31
|
+
import { IOpenerService } from '../../../../platform/opener/common/opener.service.js';
|
|
32
|
+
import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.service.js';
|
|
33
|
+
import { IStorageService } from '../../../../platform/storage/common/storage.service.js';
|
|
34
|
+
import { accessibilityHelpIsShown, accessibleViewIsShown, accessibleViewSupportsNavigation, accessibleViewVerbosityEnabled, accessibleViewGoToSymbolSupported, accessibleViewCurrentProviderId, accessibleViewInCodeBlock, accessibleViewContainsCodeBlocks, accessibleViewOnLastLine } from './accessibilityConfiguration.js';
|
|
35
|
+
import { IChatCodeBlockContextProviderService } from '../../chat/browser/chat.service.js';
|
|
36
|
+
import { getSimpleEditorOptions } from '../../codeEditor/browser/simpleEditorOptions.js';
|
|
37
|
+
const _moduleId = "vs/workbench/contrib/accessibility/browser/accessibleView";
|
|
38
|
+
class AdvancedContentProvider {
|
|
39
|
+
constructor(id, options, provideContent, onClose, verbositySettingKey, actions, next, previous, onKeyDown, getSymbols, onDidRequestClearLastProvider) {
|
|
40
|
+
this.id = id;
|
|
41
|
+
this.options = options;
|
|
42
|
+
this.provideContent = provideContent;
|
|
43
|
+
this.onClose = onClose;
|
|
44
|
+
this.verbositySettingKey = verbositySettingKey;
|
|
45
|
+
this.actions = actions;
|
|
46
|
+
this.next = next;
|
|
47
|
+
this.previous = previous;
|
|
48
|
+
this.onKeyDown = onKeyDown;
|
|
49
|
+
this.getSymbols = getSymbols;
|
|
50
|
+
this.onDidRequestClearLastProvider = onDidRequestClearLastProvider;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
class ExtensionContentProvider {
|
|
54
|
+
constructor(id, options, provideContent, onClose, next, previous, actions) {
|
|
55
|
+
this.id = id;
|
|
56
|
+
this.options = options;
|
|
57
|
+
this.provideContent = provideContent;
|
|
58
|
+
this.onClose = onClose;
|
|
59
|
+
this.next = next;
|
|
60
|
+
this.previous = previous;
|
|
61
|
+
this.actions = actions;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
let AccessibleView = class AccessibleView extends Disposable {
|
|
65
|
+
get editorWidget() { return this._editorWidget; }
|
|
66
|
+
constructor(_openerService, _instantiationService, _configurationService, _modelService, _contextViewService, _contextKeyService, _accessibilityService, _keybindingService, _layoutService, _menuService, _commandService, _codeBlockContextProviderService, _storageService) {
|
|
67
|
+
super();
|
|
68
|
+
this._openerService = _openerService;
|
|
69
|
+
this._instantiationService = _instantiationService;
|
|
70
|
+
this._configurationService = _configurationService;
|
|
71
|
+
this._modelService = _modelService;
|
|
72
|
+
this._contextViewService = _contextViewService;
|
|
73
|
+
this._contextKeyService = _contextKeyService;
|
|
74
|
+
this._accessibilityService = _accessibilityService;
|
|
75
|
+
this._keybindingService = _keybindingService;
|
|
76
|
+
this._layoutService = _layoutService;
|
|
77
|
+
this._menuService = _menuService;
|
|
78
|
+
this._commandService = _commandService;
|
|
79
|
+
this._codeBlockContextProviderService = _codeBlockContextProviderService;
|
|
80
|
+
this._storageService = _storageService;
|
|
81
|
+
this._accessiblityHelpIsShown = accessibilityHelpIsShown.bindTo(this._contextKeyService);
|
|
82
|
+
this._accessibleViewIsShown = accessibleViewIsShown.bindTo(this._contextKeyService);
|
|
83
|
+
this._accessibleViewSupportsNavigation = accessibleViewSupportsNavigation.bindTo(this._contextKeyService);
|
|
84
|
+
this._accessibleViewVerbosityEnabled = accessibleViewVerbosityEnabled.bindTo(this._contextKeyService);
|
|
85
|
+
this._accessibleViewGoToSymbolSupported = accessibleViewGoToSymbolSupported.bindTo(this._contextKeyService);
|
|
86
|
+
this._accessibleViewCurrentProviderId = accessibleViewCurrentProviderId.bindTo(this._contextKeyService);
|
|
87
|
+
this._accessibleViewInCodeBlock = accessibleViewInCodeBlock.bindTo(this._contextKeyService);
|
|
88
|
+
this._accessibleViewContainsCodeBlocks = accessibleViewContainsCodeBlocks.bindTo(this._contextKeyService);
|
|
89
|
+
this._onLastLine = accessibleViewOnLastLine.bindTo(this._contextKeyService);
|
|
90
|
+
this._container = document.createElement('div');
|
|
91
|
+
this._container.classList.add('accessible-view');
|
|
92
|
+
if (this._configurationService.getValue("accessibility.hideAccessibleView" )) {
|
|
93
|
+
this._container.classList.add('hide');
|
|
94
|
+
}
|
|
95
|
+
const codeEditorWidgetOptions = {
|
|
96
|
+
contributions: EditorExtensionsRegistry.getEditorContributions().filter(c => c.id !== CodeActionController.ID)
|
|
97
|
+
};
|
|
98
|
+
const titleBar = document.createElement('div');
|
|
99
|
+
titleBar.classList.add('accessible-view-title-bar');
|
|
100
|
+
this._title = document.createElement('div');
|
|
101
|
+
this._title.classList.add('accessible-view-title');
|
|
102
|
+
titleBar.appendChild(this._title);
|
|
103
|
+
const actionBar = document.createElement('div');
|
|
104
|
+
actionBar.classList.add('accessible-view-action-bar');
|
|
105
|
+
titleBar.appendChild(actionBar);
|
|
106
|
+
this._container.appendChild(titleBar);
|
|
107
|
+
this._toolbar = this._register(_instantiationService.createInstance(WorkbenchToolBar, actionBar, { orientation: 0 }));
|
|
108
|
+
this._toolbar.context = { viewId: 'accessibleView' };
|
|
109
|
+
const toolbarElt = this._toolbar.getElement();
|
|
110
|
+
toolbarElt.tabIndex = 0;
|
|
111
|
+
const editorOptions = {
|
|
112
|
+
...getSimpleEditorOptions(this._configurationService),
|
|
113
|
+
lineDecorationsWidth: 6,
|
|
114
|
+
dragAndDrop: false,
|
|
115
|
+
cursorWidth: 1,
|
|
116
|
+
wrappingStrategy: 'advanced',
|
|
117
|
+
wrappingIndent: 'none',
|
|
118
|
+
padding: { top: 2, bottom: 2 },
|
|
119
|
+
quickSuggestions: false,
|
|
120
|
+
renderWhitespace: 'none',
|
|
121
|
+
dropIntoEditor: { enabled: false },
|
|
122
|
+
readOnly: true,
|
|
123
|
+
fontFamily: 'var(--monaco-monospace-font)'
|
|
124
|
+
};
|
|
125
|
+
this._editorWidget = this._register(this._instantiationService.createInstance(CodeEditorWidget, this._container, editorOptions, codeEditorWidgetOptions));
|
|
126
|
+
this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(() => {
|
|
127
|
+
if (this._currentProvider && this._accessiblityHelpIsShown.get()) {
|
|
128
|
+
this.show(this._currentProvider);
|
|
129
|
+
}
|
|
130
|
+
}));
|
|
131
|
+
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
132
|
+
if (this._currentProvider instanceof AdvancedContentProvider && e.affectsConfiguration(this._currentProvider.verbositySettingKey)) {
|
|
133
|
+
if (this._accessiblityHelpIsShown.get()) {
|
|
134
|
+
this.show(this._currentProvider);
|
|
135
|
+
}
|
|
136
|
+
this._accessibleViewVerbosityEnabled.set(this._configurationService.getValue(this._currentProvider.verbositySettingKey));
|
|
137
|
+
this._updateToolbar(this._currentProvider.actions, this._currentProvider.options.type);
|
|
138
|
+
}
|
|
139
|
+
if (e.affectsConfiguration("accessibility.hideAccessibleView" )) {
|
|
140
|
+
this._container.classList.toggle('hide', this._configurationService.getValue("accessibility.hideAccessibleView" ));
|
|
141
|
+
}
|
|
142
|
+
}));
|
|
143
|
+
this._register(this._editorWidget.onDidDispose(() => this._resetContextKeys()));
|
|
144
|
+
this._register(this._editorWidget.onDidChangeCursorPosition(() => {
|
|
145
|
+
this._onLastLine.set(this._editorWidget.getPosition()?.lineNumber === this._editorWidget.getModel()?.getLineCount());
|
|
146
|
+
}));
|
|
147
|
+
this._register(this._editorWidget.onDidChangeCursorPosition(() => {
|
|
148
|
+
const cursorPosition = this._editorWidget.getPosition()?.lineNumber;
|
|
149
|
+
if (this._codeBlocks && cursorPosition !== undefined) {
|
|
150
|
+
const inCodeBlock = this._codeBlocks.find(c => c.startLine <= cursorPosition && c.endLine >= cursorPosition) !== undefined;
|
|
151
|
+
this._accessibleViewInCodeBlock.set(inCodeBlock);
|
|
152
|
+
}
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
_resetContextKeys() {
|
|
156
|
+
this._accessiblityHelpIsShown.reset();
|
|
157
|
+
this._accessibleViewIsShown.reset();
|
|
158
|
+
this._accessibleViewSupportsNavigation.reset();
|
|
159
|
+
this._accessibleViewVerbosityEnabled.reset();
|
|
160
|
+
this._accessibleViewGoToSymbolSupported.reset();
|
|
161
|
+
this._accessibleViewCurrentProviderId.reset();
|
|
162
|
+
}
|
|
163
|
+
getPosition(id) {
|
|
164
|
+
if (!id || !this._lastProvider || this._lastProvider.id !== id) {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
return this._editorWidget.getPosition() || undefined;
|
|
168
|
+
}
|
|
169
|
+
setPosition(position, reveal) {
|
|
170
|
+
this._editorWidget.setPosition(position);
|
|
171
|
+
if (reveal) {
|
|
172
|
+
this._editorWidget.revealPosition(position);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
getCodeBlockContext() {
|
|
176
|
+
const position = this._editorWidget.getPosition();
|
|
177
|
+
if (!this._codeBlocks?.length || !position) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const codeBlockIndex = this._codeBlocks?.findIndex(c => c.startLine <= position?.lineNumber && c.endLine >= position?.lineNumber);
|
|
181
|
+
const codeBlock = codeBlockIndex !== undefined && codeBlockIndex > -1 ? this._codeBlocks[codeBlockIndex] : undefined;
|
|
182
|
+
if (!codeBlock || codeBlockIndex === undefined) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
return { code: codeBlock.code, languageId: codeBlock.languageId, codeBlockIndex, element: undefined };
|
|
186
|
+
}
|
|
187
|
+
navigateToCodeBlock(type) {
|
|
188
|
+
const position = this._editorWidget.getPosition();
|
|
189
|
+
if (!this._codeBlocks?.length || !position) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
let codeBlock;
|
|
193
|
+
const codeBlocks = this._codeBlocks.slice();
|
|
194
|
+
if (type === 'previous') {
|
|
195
|
+
codeBlock = codeBlocks.reverse().find(c => c.endLine < position.lineNumber);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
codeBlock = codeBlocks.find(c => c.startLine > position.lineNumber);
|
|
199
|
+
}
|
|
200
|
+
if (!codeBlock) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.setPosition(( (new Position(codeBlock.startLine, 1))), true);
|
|
204
|
+
}
|
|
205
|
+
showLastProvider(id) {
|
|
206
|
+
if (!this._lastProvider || this._lastProvider.options.id !== id) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
this.show(this._lastProvider);
|
|
210
|
+
}
|
|
211
|
+
show(provider, symbol, showAccessibleViewHelp, position) {
|
|
212
|
+
provider = provider ?? this._currentProvider;
|
|
213
|
+
if (!provider) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
const delegate = {
|
|
217
|
+
getAnchor: () => { return { x: (getActiveWindow().innerWidth / 2) - ((Math.min(this._layoutService.activeContainerDimension.width * 0.62 , 600 )) / 2), y: this._layoutService.activeContainerOffset.quickPickTop }; },
|
|
218
|
+
render: (container) => {
|
|
219
|
+
container.classList.add('accessible-view-container');
|
|
220
|
+
return this._render(provider, container, showAccessibleViewHelp);
|
|
221
|
+
},
|
|
222
|
+
onHide: () => {
|
|
223
|
+
if (!showAccessibleViewHelp) {
|
|
224
|
+
this._updateLastProvider();
|
|
225
|
+
this._currentProvider = undefined;
|
|
226
|
+
this._resetContextKeys();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
this._contextViewService.showContextView(delegate);
|
|
231
|
+
if (position) {
|
|
232
|
+
queueMicrotask(() => {
|
|
233
|
+
this._editorWidget.revealLine(position.lineNumber);
|
|
234
|
+
this._editorWidget.setSelection({ startLineNumber: position.lineNumber, startColumn: position.column, endLineNumber: position.lineNumber, endColumn: position.column });
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (symbol && this._currentProvider) {
|
|
238
|
+
this.showSymbol(this._currentProvider, symbol);
|
|
239
|
+
}
|
|
240
|
+
if (provider instanceof AdvancedContentProvider && provider.onDidRequestClearLastProvider) {
|
|
241
|
+
this._register(provider.onDidRequestClearLastProvider((id) => {
|
|
242
|
+
if (this._lastProvider?.options.id === id) {
|
|
243
|
+
this._lastProvider = undefined;
|
|
244
|
+
}
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
247
|
+
if (provider.options.id) {
|
|
248
|
+
this._lastProvider = provider;
|
|
249
|
+
}
|
|
250
|
+
if (provider.id === "panelChat" ) {
|
|
251
|
+
this._register(this._codeBlockContextProviderService.registerProvider({ getCodeBlockContext: () => this.getCodeBlockContext() }, 'accessibleView'));
|
|
252
|
+
}
|
|
253
|
+
if (provider instanceof ExtensionContentProvider) {
|
|
254
|
+
this._storageService.store(`${ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX}${provider.id}`, true, -1 , 0 );
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
previous() {
|
|
258
|
+
this._currentProvider?.previous?.();
|
|
259
|
+
}
|
|
260
|
+
next() {
|
|
261
|
+
this._currentProvider?.next?.();
|
|
262
|
+
}
|
|
263
|
+
_verbosityEnabled() {
|
|
264
|
+
if (!this._currentProvider) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
return this._currentProvider instanceof AdvancedContentProvider ? this._configurationService.getValue(this._currentProvider.verbositySettingKey) === true : this._storageService.getBoolean(`${ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX}${this._currentProvider.id}`, -1 , false);
|
|
268
|
+
}
|
|
269
|
+
goToSymbol() {
|
|
270
|
+
if (!this._currentProvider) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
this._instantiationService.createInstance(AccessibleViewSymbolQuickPick, this).show(this._currentProvider);
|
|
274
|
+
}
|
|
275
|
+
calculateCodeBlocks(markdown) {
|
|
276
|
+
if (this._currentProvider?.id !== "panelChat" ) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (this._currentProvider.options.language && this._currentProvider.options.language !== 'markdown') {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const lines = markdown.split('\n');
|
|
283
|
+
this._codeBlocks = [];
|
|
284
|
+
let inBlock = false;
|
|
285
|
+
let startLine = 0;
|
|
286
|
+
let languageId;
|
|
287
|
+
lines.forEach((line, i) => {
|
|
288
|
+
if (!inBlock && line.startsWith('```')) {
|
|
289
|
+
inBlock = true;
|
|
290
|
+
startLine = i + 1;
|
|
291
|
+
languageId = line.substring(3).trim();
|
|
292
|
+
}
|
|
293
|
+
else if (inBlock && line.startsWith('```')) {
|
|
294
|
+
inBlock = false;
|
|
295
|
+
const endLine = i;
|
|
296
|
+
const code = lines.slice(startLine, endLine).join('\n');
|
|
297
|
+
this._codeBlocks?.push({ startLine, endLine, code, languageId });
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
this._accessibleViewContainsCodeBlocks.set(this._codeBlocks.length > 0);
|
|
301
|
+
}
|
|
302
|
+
getSymbols() {
|
|
303
|
+
const provider = this._currentProvider instanceof AdvancedContentProvider ? this._currentProvider : undefined;
|
|
304
|
+
if (!this._currentContent || !provider) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const symbols = provider.getSymbols?.() || [];
|
|
308
|
+
if (symbols?.length) {
|
|
309
|
+
return symbols;
|
|
310
|
+
}
|
|
311
|
+
if (provider.options.language && provider.options.language !== 'markdown') {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const markdownTokens = marked_1.lexer(this._currentContent);
|
|
315
|
+
if (!markdownTokens) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
this._convertTokensToSymbols(markdownTokens, symbols);
|
|
319
|
+
return symbols.length ? symbols : undefined;
|
|
320
|
+
}
|
|
321
|
+
_convertTokensToSymbols(tokens, symbols) {
|
|
322
|
+
let firstListItem;
|
|
323
|
+
for (const token of tokens) {
|
|
324
|
+
let label = undefined;
|
|
325
|
+
if ('type' in token) {
|
|
326
|
+
switch (token.type) {
|
|
327
|
+
case 'heading':
|
|
328
|
+
case 'paragraph':
|
|
329
|
+
case 'code':
|
|
330
|
+
label = token.text;
|
|
331
|
+
break;
|
|
332
|
+
case 'list': {
|
|
333
|
+
const firstItem = token.items?.[0];
|
|
334
|
+
if (!firstItem) {
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
firstListItem = `- ${firstItem.text}`;
|
|
338
|
+
label = token.items?.map(i => i.text).join(', ');
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (label) {
|
|
344
|
+
symbols.push({ markdownToParse: label, label: ( localizeWithPath(_moduleId, 0, "({0}) {1}", token.type, label)), ariaLabel: ( localizeWithPath(_moduleId, 1, "({0}) {1}", token.type, label)), firstListItem });
|
|
345
|
+
firstListItem = undefined;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
showSymbol(provider, symbol) {
|
|
350
|
+
if (!this._currentContent) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
let lineNumber = symbol.lineNumber;
|
|
354
|
+
const markdownToParse = symbol.markdownToParse;
|
|
355
|
+
if (lineNumber === undefined && markdownToParse === undefined) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
if (lineNumber === undefined && markdownToParse) {
|
|
359
|
+
const index = this._currentContent.split('\n').findIndex(line => line.includes(markdownToParse.split('\n')[0]) || (symbol.firstListItem && line.includes(symbol.firstListItem))) ?? -1;
|
|
360
|
+
if (index >= 0) {
|
|
361
|
+
lineNumber = index + 1;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (lineNumber === undefined) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
this.show(provider, undefined, undefined, { lineNumber, column: 1 });
|
|
368
|
+
this._updateContextKeys(provider, true);
|
|
369
|
+
}
|
|
370
|
+
disableHint() {
|
|
371
|
+
if (!(this._currentProvider instanceof AdvancedContentProvider)) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
this._configurationService.updateValue(this._currentProvider?.verbositySettingKey, false);
|
|
375
|
+
alert(( localizeWithPath(
|
|
376
|
+
_moduleId,
|
|
377
|
+
2,
|
|
378
|
+
'{0} accessibility verbosity is now disabled',
|
|
379
|
+
this._currentProvider.verbositySettingKey
|
|
380
|
+
)));
|
|
381
|
+
}
|
|
382
|
+
_updateContextKeys(provider, shown) {
|
|
383
|
+
if (provider.options.type === "help" ) {
|
|
384
|
+
this._accessiblityHelpIsShown.set(shown);
|
|
385
|
+
this._accessibleViewIsShown.reset();
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
this._accessibleViewIsShown.set(shown);
|
|
389
|
+
this._accessiblityHelpIsShown.reset();
|
|
390
|
+
}
|
|
391
|
+
this._accessibleViewSupportsNavigation.set(provider.next !== undefined || provider.previous !== undefined);
|
|
392
|
+
this._accessibleViewVerbosityEnabled.set(this._verbosityEnabled());
|
|
393
|
+
this._accessibleViewGoToSymbolSupported.set(this._goToSymbolsSupported() ? this.getSymbols()?.length > 0 : false);
|
|
394
|
+
}
|
|
395
|
+
_render(provider, container, showAccessibleViewHelp) {
|
|
396
|
+
this._currentProvider = provider;
|
|
397
|
+
this._accessibleViewCurrentProviderId.set(provider.id);
|
|
398
|
+
const verbose = this._verbosityEnabled();
|
|
399
|
+
const readMoreLink = provider.options.readMoreUrl ? ( localizeWithPath(
|
|
400
|
+
_moduleId,
|
|
401
|
+
3,
|
|
402
|
+
"\n\nOpen a browser window with more information related to accessibility (H)."
|
|
403
|
+
)) : '';
|
|
404
|
+
let disableHelpHint = '';
|
|
405
|
+
if (provider instanceof AdvancedContentProvider && provider.options.type === "help" && verbose) {
|
|
406
|
+
disableHelpHint = this._getDisableVerbosityHint(provider.verbositySettingKey);
|
|
407
|
+
}
|
|
408
|
+
const accessibilitySupport = this._accessibilityService.isScreenReaderOptimized();
|
|
409
|
+
let message = '';
|
|
410
|
+
if (provider.options.type === "help" ) {
|
|
411
|
+
const turnOnMessage = (isMacintosh
|
|
412
|
+
? AccessibilityHelpNLS.changeConfigToOnMac
|
|
413
|
+
: AccessibilityHelpNLS.changeConfigToOnWinLinux);
|
|
414
|
+
if (accessibilitySupport && provider instanceof AdvancedContentProvider && provider.verbositySettingKey === "accessibility.verbosity.editor" ) {
|
|
415
|
+
message = AccessibilityHelpNLS.auto_on;
|
|
416
|
+
message += '\n';
|
|
417
|
+
}
|
|
418
|
+
else if (!accessibilitySupport) {
|
|
419
|
+
message = AccessibilityHelpNLS.auto_off + '\n' + turnOnMessage;
|
|
420
|
+
message += '\n';
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
const exitThisDialogHint = verbose && !provider.options.position ? ( localizeWithPath(_moduleId, 4, '\n\nExit this dialog (Escape).')) : '';
|
|
424
|
+
const newContent = message + provider.provideContent() + readMoreLink + disableHelpHint + exitThisDialogHint;
|
|
425
|
+
this.calculateCodeBlocks(newContent);
|
|
426
|
+
this._currentContent = newContent;
|
|
427
|
+
this._updateContextKeys(provider, true);
|
|
428
|
+
const widgetIsFocused = this._editorWidget.hasTextFocus() || this._editorWidget.hasWidgetFocus();
|
|
429
|
+
this._getTextModel(( (URI.from(
|
|
430
|
+
{ path: `accessible-view-${provider.id}`, scheme: 'accessible-view', fragment: this._currentContent }
|
|
431
|
+
)))).then((model) => {
|
|
432
|
+
if (!model) {
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
this._editorWidget.setModel(model);
|
|
436
|
+
const domNode = this._editorWidget.getDomNode();
|
|
437
|
+
if (!domNode) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
model.setLanguage(provider.options.language ?? 'markdown');
|
|
441
|
+
container.appendChild(this._container);
|
|
442
|
+
let actionsHint = '';
|
|
443
|
+
const hasActions = this._accessibleViewSupportsNavigation.get() || this._accessibleViewVerbosityEnabled.get() || this._accessibleViewGoToSymbolSupported.get() || provider.actions?.length;
|
|
444
|
+
if (verbose && !showAccessibleViewHelp && hasActions) {
|
|
445
|
+
actionsHint = provider.options.position ? ( localizeWithPath(
|
|
446
|
+
_moduleId,
|
|
447
|
+
5,
|
|
448
|
+
'Explore actions such as disabling this hint (Shift+Tab), use Escape to exit this dialog.'
|
|
449
|
+
)) : ( localizeWithPath(_moduleId, 6, 'Explore actions such as disabling this hint (Shift+Tab).'));
|
|
450
|
+
}
|
|
451
|
+
let ariaLabel = provider.options.type === "help" ? ( localizeWithPath(_moduleId, 7, "Accessibility Help")) : ( localizeWithPath(_moduleId, 8, "Accessible View"));
|
|
452
|
+
this._title.textContent = ariaLabel;
|
|
453
|
+
if (actionsHint && provider.options.type === "view" ) {
|
|
454
|
+
ariaLabel = ( localizeWithPath(_moduleId, 9, "Accessible View, {0}", actionsHint));
|
|
455
|
+
}
|
|
456
|
+
else if (actionsHint) {
|
|
457
|
+
ariaLabel = ( localizeWithPath(_moduleId, 10, "Accessibility Help, {0}", actionsHint));
|
|
458
|
+
}
|
|
459
|
+
if (isWindows && widgetIsFocused) {
|
|
460
|
+
ariaLabel = '';
|
|
461
|
+
}
|
|
462
|
+
this._editorWidget.updateOptions({ ariaLabel });
|
|
463
|
+
this._editorWidget.focus();
|
|
464
|
+
if (this._currentProvider?.options.position) {
|
|
465
|
+
const position = this._editorWidget.getPosition();
|
|
466
|
+
const isDefaultPosition = position?.lineNumber === 1 && position.column === 1;
|
|
467
|
+
if (this._currentProvider.options.position === 'bottom' || this._currentProvider.options.position === 'initial-bottom' && isDefaultPosition) {
|
|
468
|
+
const lastLine = this.editorWidget.getModel()?.getLineCount();
|
|
469
|
+
const position = lastLine !== undefined && lastLine > 0 ? ( (new Position(lastLine, 1))) : undefined;
|
|
470
|
+
if (position) {
|
|
471
|
+
this._editorWidget.setPosition(position);
|
|
472
|
+
this._editorWidget.revealLine(position.lineNumber);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
this._updateToolbar(this._currentProvider.actions, provider.options.type);
|
|
478
|
+
const hide = (e) => {
|
|
479
|
+
provider.onClose();
|
|
480
|
+
e.stopPropagation();
|
|
481
|
+
this._contextViewService.hideContextView();
|
|
482
|
+
this._updateContextKeys(provider, false);
|
|
483
|
+
this._lastProvider = undefined;
|
|
484
|
+
this._currentContent = undefined;
|
|
485
|
+
};
|
|
486
|
+
const disposableStore = ( (new DisposableStore()));
|
|
487
|
+
disposableStore.add(this._editorWidget.onKeyDown((e) => {
|
|
488
|
+
if (e.keyCode === 3 ) {
|
|
489
|
+
this._commandService.executeCommand('editor.action.openLink');
|
|
490
|
+
}
|
|
491
|
+
else if (e.keyCode === 9 || shouldHide(e.browserEvent, this._keybindingService, this._configurationService)) {
|
|
492
|
+
hide(e);
|
|
493
|
+
}
|
|
494
|
+
else if (e.keyCode === 38 && provider.options.readMoreUrl) {
|
|
495
|
+
const url = provider.options.readMoreUrl;
|
|
496
|
+
alert(AccessibilityHelpNLS.openingDocs);
|
|
497
|
+
this._openerService.open(( (URI.parse(url))));
|
|
498
|
+
e.preventDefault();
|
|
499
|
+
e.stopPropagation();
|
|
500
|
+
}
|
|
501
|
+
if (provider instanceof AdvancedContentProvider) {
|
|
502
|
+
provider.onKeyDown?.(e);
|
|
503
|
+
}
|
|
504
|
+
}));
|
|
505
|
+
disposableStore.add(addDisposableListener(this._toolbar.getElement(), EventType.KEY_DOWN, (e) => {
|
|
506
|
+
const keyboardEvent = ( (new StandardKeyboardEvent(e)));
|
|
507
|
+
if (keyboardEvent.equals(9 )) {
|
|
508
|
+
hide(e);
|
|
509
|
+
}
|
|
510
|
+
}));
|
|
511
|
+
disposableStore.add(this._editorWidget.onDidBlurEditorWidget(() => {
|
|
512
|
+
if (!isActiveElement(this._toolbar.getElement())) {
|
|
513
|
+
this._contextViewService.hideContextView();
|
|
514
|
+
}
|
|
515
|
+
}));
|
|
516
|
+
disposableStore.add(this._editorWidget.onDidContentSizeChange(() => this._layout()));
|
|
517
|
+
disposableStore.add(this._layoutService.onDidLayoutActiveContainer(() => this._layout()));
|
|
518
|
+
return disposableStore;
|
|
519
|
+
}
|
|
520
|
+
_updateToolbar(providedActions, type) {
|
|
521
|
+
this._toolbar.setAriaLabel(type === "help" ? ( localizeWithPath(_moduleId, 11, 'Accessibility Help')) : ( localizeWithPath(_moduleId, 12, "Accessible View")));
|
|
522
|
+
const menuActions = [];
|
|
523
|
+
const toolbarMenu = this._register(this._menuService.createMenu(MenuId.AccessibleView, this._contextKeyService));
|
|
524
|
+
createAndFillInActionBarActions(toolbarMenu, {}, menuActions);
|
|
525
|
+
if (providedActions) {
|
|
526
|
+
for (const providedAction of providedActions) {
|
|
527
|
+
providedAction.class = providedAction.class || ThemeIcon.asClassName(Codicon.primitiveSquare);
|
|
528
|
+
providedAction.checked = undefined;
|
|
529
|
+
}
|
|
530
|
+
this._toolbar.setActions([...providedActions, ...menuActions]);
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
this._toolbar.setActions(menuActions);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
_layout() {
|
|
537
|
+
const dimension = this._layoutService.activeContainerDimension;
|
|
538
|
+
const maxHeight = dimension.height && dimension.height * .4;
|
|
539
|
+
const height = Math.min(maxHeight, this._editorWidget.getContentHeight());
|
|
540
|
+
const width = Math.min(dimension.width * 0.62 , 600 );
|
|
541
|
+
this._editorWidget.layout({ width, height });
|
|
542
|
+
}
|
|
543
|
+
async _getTextModel(resource) {
|
|
544
|
+
const existing = this._modelService.getModel(resource);
|
|
545
|
+
if (existing && !existing.isDisposed()) {
|
|
546
|
+
return existing;
|
|
547
|
+
}
|
|
548
|
+
return this._modelService.createModel(resource.fragment, null, resource, false);
|
|
549
|
+
}
|
|
550
|
+
_goToSymbolsSupported() {
|
|
551
|
+
if (!this._currentProvider) {
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
return this._currentProvider.options.type === "help" || this._currentProvider.options.language === 'markdown' || this._currentProvider.options.language === undefined || (this._currentProvider instanceof AdvancedContentProvider && !!this._currentProvider.getSymbols?.());
|
|
555
|
+
}
|
|
556
|
+
_updateLastProvider() {
|
|
557
|
+
const provider = this._currentProvider;
|
|
558
|
+
if (!provider) {
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
const lastProvider = provider instanceof AdvancedContentProvider ? ( (new AdvancedContentProvider(
|
|
562
|
+
provider.id,
|
|
563
|
+
provider.options,
|
|
564
|
+
provider.provideContent.bind(provider),
|
|
565
|
+
provider.onClose,
|
|
566
|
+
provider.verbositySettingKey,
|
|
567
|
+
provider.actions,
|
|
568
|
+
provider.next,
|
|
569
|
+
provider.previous,
|
|
570
|
+
provider.onKeyDown,
|
|
571
|
+
provider.getSymbols
|
|
572
|
+
))) : ( (new ExtensionContentProvider(
|
|
573
|
+
provider.id,
|
|
574
|
+
provider.options,
|
|
575
|
+
provider.provideContent.bind(provider),
|
|
576
|
+
provider.onClose,
|
|
577
|
+
provider.next,
|
|
578
|
+
provider.previous,
|
|
579
|
+
provider.actions
|
|
580
|
+
)));
|
|
581
|
+
return lastProvider;
|
|
582
|
+
}
|
|
583
|
+
showAccessibleViewHelp() {
|
|
584
|
+
const lastProvider = this._updateLastProvider();
|
|
585
|
+
if (!lastProvider) {
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
const accessibleViewHelpProvider = {
|
|
589
|
+
id: lastProvider.id,
|
|
590
|
+
provideContent: () => lastProvider.options.customHelp ? lastProvider?.options.customHelp() : this._getAccessibleViewHelpDialogContent(this._goToSymbolsSupported()),
|
|
591
|
+
onClose: () => {
|
|
592
|
+
this._contextViewService.hideContextView();
|
|
593
|
+
queueMicrotask(() => this.show(lastProvider));
|
|
594
|
+
},
|
|
595
|
+
options: { type: "help" },
|
|
596
|
+
verbositySettingKey: lastProvider instanceof AdvancedContentProvider ? lastProvider.verbositySettingKey : undefined
|
|
597
|
+
};
|
|
598
|
+
this._contextViewService.hideContextView();
|
|
599
|
+
queueMicrotask(() => this.show(accessibleViewHelpProvider, undefined, true));
|
|
600
|
+
}
|
|
601
|
+
_getAccessibleViewHelpDialogContent(providerHasSymbols) {
|
|
602
|
+
const navigationHint = this._getNavigationHint();
|
|
603
|
+
const goToSymbolHint = this._getGoToSymbolHint(providerHasSymbols);
|
|
604
|
+
const toolbarHint = ( localizeWithPath(_moduleId, 13, "Navigate to the toolbar (Shift+Tab)."));
|
|
605
|
+
const chatHints = this._getChatHints();
|
|
606
|
+
let hint = ( localizeWithPath(_moduleId, 14, "In the accessible view, you can:\n"));
|
|
607
|
+
if (navigationHint) {
|
|
608
|
+
hint += ' - ' + navigationHint + '\n';
|
|
609
|
+
}
|
|
610
|
+
if (goToSymbolHint) {
|
|
611
|
+
hint += ' - ' + goToSymbolHint + '\n';
|
|
612
|
+
}
|
|
613
|
+
if (toolbarHint) {
|
|
614
|
+
hint += ' - ' + toolbarHint + '\n';
|
|
615
|
+
}
|
|
616
|
+
if (chatHints) {
|
|
617
|
+
hint += chatHints;
|
|
618
|
+
}
|
|
619
|
+
return hint;
|
|
620
|
+
}
|
|
621
|
+
_getChatHints() {
|
|
622
|
+
if (this._currentProvider?.id !== "panelChat" ) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
let hint = '';
|
|
626
|
+
const insertAtCursorKb = this._keybindingService.lookupKeybinding('workbench.action.chat.insertCodeBlock')?.getAriaLabel();
|
|
627
|
+
const insertIntoNewFileKb = this._keybindingService.lookupKeybinding('workbench.action.chat.insertIntoNewFile')?.getAriaLabel();
|
|
628
|
+
const runInTerminalKb = this._keybindingService.lookupKeybinding('workbench.action.chat.runInTerminal')?.getAriaLabel();
|
|
629
|
+
if (insertAtCursorKb) {
|
|
630
|
+
hint += ( localizeWithPath(
|
|
631
|
+
_moduleId,
|
|
632
|
+
15,
|
|
633
|
+
" - Insert the code block at the cursor ({0}).\n",
|
|
634
|
+
insertAtCursorKb
|
|
635
|
+
));
|
|
636
|
+
}
|
|
637
|
+
else {
|
|
638
|
+
hint += ( localizeWithPath(
|
|
639
|
+
_moduleId,
|
|
640
|
+
16,
|
|
641
|
+
" - Insert the code block at the cursor by configuring a keybinding for the Chat: Insert Code Block command.\n"
|
|
642
|
+
));
|
|
643
|
+
}
|
|
644
|
+
if (insertIntoNewFileKb) {
|
|
645
|
+
hint += ( localizeWithPath(
|
|
646
|
+
_moduleId,
|
|
647
|
+
17,
|
|
648
|
+
" - Insert the code block into a new file ({0}).\n",
|
|
649
|
+
insertIntoNewFileKb
|
|
650
|
+
));
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
hint += ( localizeWithPath(
|
|
654
|
+
_moduleId,
|
|
655
|
+
18,
|
|
656
|
+
" - Insert the code block into a new file by configuring a keybinding for the Chat: Insert into New File command.\n"
|
|
657
|
+
));
|
|
658
|
+
}
|
|
659
|
+
if (runInTerminalKb) {
|
|
660
|
+
hint += ( localizeWithPath(
|
|
661
|
+
_moduleId,
|
|
662
|
+
19,
|
|
663
|
+
" - Run the code block in the terminal ({0}).\n",
|
|
664
|
+
runInTerminalKb
|
|
665
|
+
));
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
hint += ( localizeWithPath(
|
|
669
|
+
_moduleId,
|
|
670
|
+
20,
|
|
671
|
+
" - Run the coe block in the terminal by configuring a keybinding for the Chat: Insert into Terminal command.\n"
|
|
672
|
+
));
|
|
673
|
+
}
|
|
674
|
+
return hint;
|
|
675
|
+
}
|
|
676
|
+
_getNavigationHint() {
|
|
677
|
+
let hint = '';
|
|
678
|
+
const nextKeybinding = this._keybindingService.lookupKeybinding("editor.action.accessibleViewNext" )?.getAriaLabel();
|
|
679
|
+
const previousKeybinding = this._keybindingService.lookupKeybinding("editor.action.accessibleViewPrevious" )?.getAriaLabel();
|
|
680
|
+
if (nextKeybinding && previousKeybinding) {
|
|
681
|
+
hint = ( localizeWithPath(
|
|
682
|
+
_moduleId,
|
|
683
|
+
21,
|
|
684
|
+
"Show the next ({0}) or previous ({1}) item.",
|
|
685
|
+
nextKeybinding,
|
|
686
|
+
previousKeybinding
|
|
687
|
+
));
|
|
688
|
+
}
|
|
689
|
+
else {
|
|
690
|
+
hint = ( localizeWithPath(
|
|
691
|
+
_moduleId,
|
|
692
|
+
22,
|
|
693
|
+
"Show the next or previous item by configuring keybindings for the Show Next & Previous in Accessible View commands."
|
|
694
|
+
));
|
|
695
|
+
}
|
|
696
|
+
return hint;
|
|
697
|
+
}
|
|
698
|
+
_getDisableVerbosityHint(verbositySettingKey) {
|
|
699
|
+
if (!this._configurationService.getValue(verbositySettingKey)) {
|
|
700
|
+
return '';
|
|
701
|
+
}
|
|
702
|
+
let hint = '';
|
|
703
|
+
const disableKeybinding = this._keybindingService.lookupKeybinding("editor.action.accessibleViewDisableHint" , this._contextKeyService)?.getAriaLabel();
|
|
704
|
+
if (disableKeybinding) {
|
|
705
|
+
hint = ( localizeWithPath(
|
|
706
|
+
_moduleId,
|
|
707
|
+
23,
|
|
708
|
+
"\n\nDisable accessibility verbosity for this feature ({0}).",
|
|
709
|
+
disableKeybinding
|
|
710
|
+
));
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
hint = ( localizeWithPath(
|
|
714
|
+
_moduleId,
|
|
715
|
+
24,
|
|
716
|
+
"\n\nAdd a keybinding for the command Disable Accessible View Hint, which disables accessibility verbosity for this feature.s"
|
|
717
|
+
));
|
|
718
|
+
}
|
|
719
|
+
return hint;
|
|
720
|
+
}
|
|
721
|
+
_getGoToSymbolHint(providerHasSymbols) {
|
|
722
|
+
const goToSymbolKb = this._keybindingService.lookupKeybinding("editor.action.accessibleViewGoToSymbol" )?.getAriaLabel();
|
|
723
|
+
let goToSymbolHint = '';
|
|
724
|
+
if (providerHasSymbols) {
|
|
725
|
+
if (goToSymbolKb) {
|
|
726
|
+
goToSymbolHint = ( localizeWithPath(_moduleId, 25, 'Go to a symbol ({0}).', goToSymbolKb));
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
goToSymbolHint = ( localizeWithPath(
|
|
730
|
+
_moduleId,
|
|
731
|
+
26,
|
|
732
|
+
'To go to a symbol, configure a keybinding for the command Go To Symbol in Accessible View'
|
|
733
|
+
));
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return goToSymbolHint;
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
AccessibleView = ( (__decorate([
|
|
740
|
+
( (__param(0, IOpenerService))),
|
|
741
|
+
( (__param(1, IInstantiationService))),
|
|
742
|
+
( (__param(2, IConfigurationService))),
|
|
743
|
+
( (__param(3, IModelService))),
|
|
744
|
+
( (__param(4, IContextViewService))),
|
|
745
|
+
( (__param(5, IContextKeyService))),
|
|
746
|
+
( (__param(6, IAccessibilityService))),
|
|
747
|
+
( (__param(7, IKeybindingService))),
|
|
748
|
+
( (__param(8, ILayoutService))),
|
|
749
|
+
( (__param(9, IMenuService))),
|
|
750
|
+
( (__param(10, ICommandService))),
|
|
751
|
+
( (__param(11, IChatCodeBlockContextProviderService))),
|
|
752
|
+
( (__param(12, IStorageService)))
|
|
753
|
+
], AccessibleView)));
|
|
754
|
+
let AccessibleViewService = class AccessibleViewService extends Disposable {
|
|
755
|
+
constructor(_instantiationService, _configurationService, _keybindingService) {
|
|
756
|
+
super();
|
|
757
|
+
this._instantiationService = _instantiationService;
|
|
758
|
+
this._configurationService = _configurationService;
|
|
759
|
+
this._keybindingService = _keybindingService;
|
|
760
|
+
}
|
|
761
|
+
show(provider, position) {
|
|
762
|
+
if (!this._accessibleView) {
|
|
763
|
+
this._accessibleView = this._register(this._instantiationService.createInstance(AccessibleView));
|
|
764
|
+
}
|
|
765
|
+
this._accessibleView.show(provider, undefined, undefined, position);
|
|
766
|
+
}
|
|
767
|
+
showLastProvider(id) {
|
|
768
|
+
this._accessibleView?.showLastProvider(id);
|
|
769
|
+
}
|
|
770
|
+
next() {
|
|
771
|
+
this._accessibleView?.next();
|
|
772
|
+
}
|
|
773
|
+
previous() {
|
|
774
|
+
this._accessibleView?.previous();
|
|
775
|
+
}
|
|
776
|
+
goToSymbol() {
|
|
777
|
+
this._accessibleView?.goToSymbol();
|
|
778
|
+
}
|
|
779
|
+
getOpenAriaHint(verbositySettingKey) {
|
|
780
|
+
if (!this._configurationService.getValue(verbositySettingKey)) {
|
|
781
|
+
return null;
|
|
782
|
+
}
|
|
783
|
+
const keybinding = this._keybindingService.lookupKeybinding("editor.action.accessibleView" )?.getAriaLabel();
|
|
784
|
+
let hint = null;
|
|
785
|
+
if (keybinding) {
|
|
786
|
+
hint = ( localizeWithPath(_moduleId, 27, "Inspect this in the accessible view with {0}", keybinding));
|
|
787
|
+
}
|
|
788
|
+
else {
|
|
789
|
+
hint = ( localizeWithPath(
|
|
790
|
+
_moduleId,
|
|
791
|
+
28,
|
|
792
|
+
"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."
|
|
793
|
+
));
|
|
794
|
+
}
|
|
795
|
+
return hint;
|
|
796
|
+
}
|
|
797
|
+
disableHint() {
|
|
798
|
+
this._accessibleView?.disableHint();
|
|
799
|
+
}
|
|
800
|
+
showAccessibleViewHelp() {
|
|
801
|
+
this._accessibleView?.showAccessibleViewHelp();
|
|
802
|
+
}
|
|
803
|
+
getPosition(id) {
|
|
804
|
+
return this._accessibleView?.getPosition(id) ?? undefined;
|
|
805
|
+
}
|
|
806
|
+
getLastPosition() {
|
|
807
|
+
const lastLine = this._accessibleView?.editorWidget.getModel()?.getLineCount();
|
|
808
|
+
return lastLine !== undefined && lastLine > 0 ? ( (new Position(lastLine, 1))) : undefined;
|
|
809
|
+
}
|
|
810
|
+
setPosition(position, reveal) {
|
|
811
|
+
const editorWidget = this._accessibleView?.editorWidget;
|
|
812
|
+
editorWidget?.setPosition(position);
|
|
813
|
+
if (reveal) {
|
|
814
|
+
editorWidget?.revealLine(position.lineNumber);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
getCodeBlockContext() {
|
|
818
|
+
return this._accessibleView?.getCodeBlockContext();
|
|
819
|
+
}
|
|
820
|
+
navigateToCodeBlock(type) {
|
|
821
|
+
this._accessibleView?.navigateToCodeBlock(type);
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
AccessibleViewService = ( (__decorate([
|
|
825
|
+
( (__param(0, IInstantiationService))),
|
|
826
|
+
( (__param(1, IConfigurationService))),
|
|
827
|
+
( (__param(2, IKeybindingService)))
|
|
828
|
+
], AccessibleViewService)));
|
|
829
|
+
let AccessibleViewSymbolQuickPick = class AccessibleViewSymbolQuickPick {
|
|
830
|
+
constructor(_accessibleView, _quickInputService) {
|
|
831
|
+
this._accessibleView = _accessibleView;
|
|
832
|
+
this._quickInputService = _quickInputService;
|
|
833
|
+
}
|
|
834
|
+
show(provider) {
|
|
835
|
+
const quickPick = this._quickInputService.createQuickPick();
|
|
836
|
+
quickPick.placeholder = ( localizeWithPath(_moduleId, 29, "Type to search symbols"));
|
|
837
|
+
quickPick.title = ( localizeWithPath(_moduleId, 30, "Go to Symbol Accessible View"));
|
|
838
|
+
const symbols = this._accessibleView.getSymbols();
|
|
839
|
+
if (!symbols) {
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
for (const symbol of symbols) {
|
|
843
|
+
}
|
|
844
|
+
quickPick.canSelectMany = false;
|
|
845
|
+
quickPick.items = symbols;
|
|
846
|
+
quickPick.show();
|
|
847
|
+
quickPick.onDidAccept(() => {
|
|
848
|
+
this._accessibleView.showSymbol(provider, quickPick.selectedItems[0]);
|
|
849
|
+
quickPick.hide();
|
|
850
|
+
});
|
|
851
|
+
quickPick.onDidHide(() => {
|
|
852
|
+
if (quickPick.selectedItems.length === 0) {
|
|
853
|
+
this._accessibleView.show(provider);
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
AccessibleViewSymbolQuickPick = ( (__decorate([
|
|
859
|
+
( (__param(1, IQuickInputService)))
|
|
860
|
+
], AccessibleViewSymbolQuickPick)));
|
|
861
|
+
function shouldHide(event, keybindingService, configurationService) {
|
|
862
|
+
if (!configurationService.getValue("accessibility.accessibleView.closeOnKeyPress" )) {
|
|
863
|
+
return false;
|
|
864
|
+
}
|
|
865
|
+
const standardKeyboardEvent = ( (new StandardKeyboardEvent(event)));
|
|
866
|
+
const resolveResult = keybindingService.softDispatch(standardKeyboardEvent, standardKeyboardEvent.target);
|
|
867
|
+
const isValidChord = resolveResult.kind === 1 ;
|
|
868
|
+
if (keybindingService.inChordMode || isValidChord) {
|
|
869
|
+
return false;
|
|
870
|
+
}
|
|
871
|
+
return shouldHandleKey(event) && !event.ctrlKey && !event.altKey && !event.metaKey && !event.shiftKey;
|
|
872
|
+
}
|
|
873
|
+
function shouldHandleKey(event) {
|
|
874
|
+
return !!event.code.match(/^(Key[A-Z]|Digit[0-9]|Equal|Comma|Period|Slash|Quote|Backquote|Backslash|Minus|Semicolon|Space|Enter)$/);
|
|
875
|
+
}
|
|
876
|
+
export { AccessibleView, AccessibleViewService, AdvancedContentProvider, ExtensionContentProvider };
|