@codingame/monaco-vscode-api 21.5.1 → 22.0.0
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 +0 -5
- package/missing-services.js +68 -78
- package/package.json +8 -8
- package/services.d.ts +4 -4
- package/services.js +5 -4
- package/vscode/product.json.js +1 -1
- package/vscode/src/vs/base/browser/dom.js +6 -3
- package/vscode/src/vs/base/browser/domSanitize.d.ts +8 -0
- package/vscode/src/vs/base/browser/domSanitize.js +49 -27
- package/vscode/src/vs/base/browser/domStylesheets.js +5 -1
- package/vscode/src/vs/base/browser/markdownRenderer.js +7 -5
- package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +2 -2
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +1 -1
- package/vscode/src/vs/base/browser/ui/menu/menu.js +1 -0
- package/vscode/src/vs/base/browser/ui/progressbar/progressbar.d.ts +1 -1
- package/vscode/src/vs/base/common/async.js +6 -0
- package/vscode/src/vs/base/common/cancellation.d.ts +21 -0
- package/vscode/src/vs/base/common/cancellation.js +42 -1
- package/vscode/src/vs/base/common/codicons.d.ts +3 -0
- package/vscode/src/vs/base/common/codiconsLibrary.d.ts +3 -0
- package/vscode/src/vs/base/common/codiconsLibrary.js +3 -0
- package/vscode/src/vs/base/common/decorators/cancelPreviousCalls.d.ts +84 -0
- package/vscode/src/vs/base/common/decorators.d.ts +1 -1
- package/vscode/src/vs/base/common/htmlContent.d.ts +2 -0
- package/vscode/src/vs/base/common/htmlContent.js +9 -6
- package/vscode/src/vs/base/common/lifecycle.js +21 -7
- package/vscode/src/vs/base/common/numbers.d.ts +0 -45
- package/vscode/src/vs/base/common/oauth.d.ts +33 -0
- package/vscode/src/vs/base/common/oauth.js +79 -3
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +4 -0
- package/vscode/src/vs/base/common/observableInternal/index.js +3 -0
- package/vscode/src/vs/base/common/observableInternal/logging/debugGetDependencyGraph.d.ts +4 -0
- package/vscode/src/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js +98 -0
- package/vscode/src/vs/base/common/observableInternal/observables/baseObservable.d.ts +4 -0
- package/vscode/src/vs/base/common/observableInternal/observables/baseObservable.js +8 -1
- package/vscode/src/vs/base/common/observableInternal/observables/derivedImpl.d.ts +1 -0
- package/vscode/src/vs/base/common/observableInternal/observables/derivedImpl.js +10 -0
- package/vscode/src/vs/base/common/observableInternal/observables/observableFromEvent.d.ts +4 -0
- package/vscode/src/vs/base/common/observableInternal/observables/observableFromEvent.js +3 -0
- package/vscode/src/vs/base/common/observableInternal/reactions/autorunImpl.d.ts +1 -0
- package/vscode/src/vs/base/common/observableInternal/reactions/autorunImpl.js +9 -0
- package/vscode/src/vs/base/common/product.d.ts +7 -1
- package/vscode/src/vs/base/common/strings.d.ts +0 -1
- package/vscode/src/vs/base/common/strings.js +9 -4
- package/vscode/src/vs/base/common/uriIpc.js +24 -1
- package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +26 -16
- package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderContentSimple.js +3 -3
- package/vscode/src/vs/editor/browser/services/hoverService/hover.css +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/commands.d.ts +3 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/commands.js +12 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +8 -8
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +4 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.d.ts +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +26 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +1 -1
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +93 -85
- package/vscode/src/vs/editor/common/config/editorOptions.js +386 -351
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +71 -71
- package/vscode/src/vs/editor/common/core/ranges/lineRange.d.ts +3 -3
- package/vscode/src/vs/editor/common/editorContextKeys.js +46 -46
- package/vscode/src/vs/editor/common/languages/modesRegistry.js +1 -1
- package/vscode/src/vs/editor/common/languages.d.ts +5 -1
- package/vscode/src/vs/editor/common/languages.js +56 -56
- package/vscode/src/vs/editor/common/model/editStack.js +1 -1
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.d.ts +86 -85
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +86 -85
- package/vscode/src/vs/editor/common/standaloneStrings.js +47 -47
- package/vscode/src/vs/editor/common/textModelEditSource.d.ts +1 -0
- package/vscode/src/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/vscode/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +9 -7
- package/vscode/src/vs/editor/common/viewModel/screenReaderSimpleModel.d.ts +1 -0
- package/vscode/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/vscode/src/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/vscode/src/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/vscode/src/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/vscode/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/vscode/src/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/vscode/src/vs/editor/contrib/find/browser/findController.js +16 -16
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/vscode/src/vs/editor/contrib/floatingMenu/browser/floatingMenu.contribution.d.ts +1 -0
- package/vscode/src/vs/editor/contrib/floatingMenu/browser/floatingMenu.contribution.js +8 -0
- package/vscode/src/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +44 -0
- package/vscode/src/vs/editor/contrib/floatingMenu/browser/floatingMenu.d.ts +10 -0
- package/vscode/src/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +81 -0
- package/vscode/src/vs/editor/contrib/folding/browser/folding.js +21 -20
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/vscode/src/vs/editor/contrib/format/browser/format.js +3 -0
- package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.d.ts +4 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +20 -11
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/vscode/src/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverController.js +2 -1
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +3 -3
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/vscode/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHints.js +2 -7
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +19 -19
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +18 -13
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.d.ts +3 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +14 -6
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.d.ts +7 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +154 -5
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.d.ts +1 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +3 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.d.ts +7 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +18 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/telemetry.d.ts +45 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/telemetry.js +7 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +16 -15
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +5 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +24 -21
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +13 -4
- package/vscode/src/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/vscode/src/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.d.ts +2 -1
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +36 -35
- package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/vscode/src/vs/editor/contrib/links/browser/links.js +11 -11
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/vscode/src/vs/editor/contrib/middleScroll/browser/middleScrollController.js +3 -3
- package/vscode/src/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/vscode/src/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/vscode/src/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +6 -6
- package/vscode/src/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.d.ts +3 -0
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +13 -4
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -19
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +10 -1
- package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +18 -18
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +26 -26
- package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/vscode/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +1 -1
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +0 -1
- package/vscode/src/vs/editor/standalone/browser/standaloneThemeService.js +1 -0
- package/vscode/src/vs/platform/accessibility/browser/accessibleView.d.ts +1 -1
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/vscode/src/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionList.js +9 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css +13 -14
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/vscode/src/vs/platform/actions/browser/toolbar.d.ts +1 -1
- package/vscode/src/vs/platform/actions/browser/toolbar.js +5 -5
- package/vscode/src/vs/platform/actions/common/actions.d.ts +2 -0
- package/vscode/src/vs/platform/actions/common/actions.js +2 -0
- package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
- package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
- package/vscode/src/vs/platform/assignment/common/assignment.d.ts +6 -1
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +2 -2
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.d.ts +2 -0
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +32 -3
- package/vscode/src/vs/platform/contextkey/common/contextkey.js +11 -11
- package/vscode/src/vs/platform/contextkey/common/contextkeys.d.ts +0 -1
- package/vscode/src/vs/platform/contextkey/common/contextkeys.js +10 -11
- package/vscode/src/vs/platform/contextkey/common/scanner.js +5 -5
- package/vscode/src/vs/platform/dataChannel/browser/forwardingTelemetryService.d.ts +32 -0
- package/vscode/src/vs/platform/dataChannel/browser/forwardingTelemetryService.js +86 -0
- package/vscode/src/vs/platform/dialogs/common/dialogs.service.d.ts +1 -1
- package/vscode/src/vs/platform/dnd/browser/dnd.js +1 -1
- package/vscode/src/vs/platform/environment/common/argv.d.ts +1 -0
- package/vscode/src/vs/platform/environment/common/environment.service.d.ts +0 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +19 -19
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +7 -7
- package/vscode/src/vs/platform/extensionManagement/common/implicitActivationEvents.d.ts +1 -3
- package/vscode/src/vs/platform/extensionManagement/common/implicitActivationEvents.js +1 -1
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +20 -20
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +2 -1
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.d.ts +4 -3
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +4 -3
- package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +2 -2
- package/vscode/src/vs/platform/files/common/files.js +6 -6
- package/vscode/src/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/vscode/src/vs/platform/list/browser/listService.js +27 -27
- package/vscode/src/vs/platform/log/common/log.js +6 -6
- package/vscode/src/vs/platform/markers/common/markerService.js +2 -2
- package/vscode/src/vs/platform/markers/common/markers.js +6 -6
- package/vscode/src/vs/platform/mcp/common/mcpGalleryManifest.d.ts +10 -2
- package/vscode/src/vs/platform/mcp/common/mcpGalleryManifest.js +10 -2
- package/vscode/src/vs/platform/mcp/common/mcpManagement.service.d.ts +3 -3
- package/vscode/src/vs/platform/notification/common/notification.js +3 -3
- package/vscode/src/vs/platform/product/common/product.js +3 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInput.d.ts +1 -0
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +23 -15
- package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +47 -13
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +10 -61
- package/vscode/src/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/tree/quickInputTreeController.d.ts +6 -0
- package/vscode/src/vs/platform/quickinput/browser/tree/quickInputTreeController.js +10 -0
- package/vscode/src/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +10 -5
- package/vscode/src/vs/platform/quickinput/browser/tree/quickTree.js +4 -1
- package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +10 -1
- package/vscode/src/vs/platform/request/common/request.js +34 -18
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -1
- package/vscode/src/vs/platform/terminal/common/terminal.d.ts +2 -3
- package/vscode/src/vs/platform/terminal/common/terminal.js +6 -7
- package/vscode/src/vs/platform/theme/common/colorUtils.js +2 -2
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +36 -36
- package/vscode/src/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +15 -15
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/vscode/src/vs/platform/theme/common/iconRegistry.js +6 -6
- package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
- package/vscode/src/vs/platform/workspace/common/workspace.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +11 -10
- package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +25 -24
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.d.ts +4 -4
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +10 -18
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.d.ts +5 -0
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +16 -4
- package/vscode/src/vs/workbench/api/common/extHostChatSessions.d.ts +1 -3
- package/vscode/src/vs/workbench/api/common/extHostChatSessions.js +9 -5
- package/vscode/src/vs/workbench/api/common/extHostCustomEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +0 -3
- package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +9 -4
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +7 -2
- package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostMcp.d.ts +97 -9
- package/vscode/src/vs/workbench/api/common/extHostMcp.js +66 -62
- package/vscode/src/vs/workbench/api/common/extHostNotebook.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSCM.d.ts +2 -0
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +22 -0
- package/vscode/src/vs/workbench/api/common/extHostSecrets.d.ts +0 -1
- package/vscode/src/vs/workbench/api/common/extHostSecrets.js +0 -3
- package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +8 -8
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +53 -3
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.d.ts +2 -0
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +5 -2
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.d.ts +6 -2
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +60 -9
- package/vscode/src/vs/workbench/api/common/extHostTypes.d.ts +18 -14
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +7 -7
- package/vscode/src/vs/workbench/api/common/extHostWebviewPanels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +1 -1
- package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +12 -12
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +262 -31
- package/vscode/src/vs/workbench/browser/actions/textInputActions.js +6 -6
- package/vscode/src/vs/workbench/browser/contextkeys.d.ts +5 -7
- package/vscode/src/vs/workbench/browser/contextkeys.js +15 -43
- package/vscode/src/vs/workbench/common/configuration.js +9 -9
- package/vscode/src/vs/workbench/common/contextkeys.js +73 -73
- package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +1 -1
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +1 -1
- package/vscode/src/vs/workbench/common/editor/textEditorModel.js +1 -1
- package/vscode/src/vs/workbench/common/editor.js +4 -4
- package/vscode/src/vs/workbench/common/theme.js +167 -167
- package/vscode/src/vs/workbench/common/views.js +4 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +175 -158
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.service.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContextPickService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.js +15 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +61 -66
- package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatLayoutService.service.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.d.ts +24 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.service.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionsService.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionsService.service.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatVariableEntries.d.ts +28 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatVariableEntries.js +35 -6
- package/vscode/src/vs/workbench/contrib/chat/common/constants.d.ts +16 -6
- package/vscode/src/vs/workbench/contrib/chat/common/constants.js +11 -8
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.service.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.d.ts +8 -4
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +50 -42
- package/vscode/src/vs/workbench/contrib/chat/common/modelPicker/modelPickerWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service.d.ts +23 -8
- package/vscode/src/vs/workbench/contrib/chat/common/tools/manageTodoListTool.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/common/tools/manageTodoListTool.js +29 -29
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.js +4 -3
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +7 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +5 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +11 -11
- package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +65 -65
- package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/commands.js +2 -2
- package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/configurationSchema.js +4 -4
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
- package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
- package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
- package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistryTypes.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.js +16 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocol.d.ts +217 -60
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/scm/common/history.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
- package/vscode/src/vs/workbench/contrib/tasks/common/constants.js +1 -1
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +7 -7
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.d.ts +16 -3
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +18 -6
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.d.ts +42 -8
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.js +2 -1
- package/vscode/src/vs/workbench/contrib/testing/common/constants.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +12 -11
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +3 -3
- package/vscode/src/vs/workbench/services/accounts/common/defaultAccount.js +2 -2
- package/vscode/src/vs/workbench/services/activity/common/activity.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +4 -4
- package/vscode/src/vs/workbench/services/authentication/common/authentication.js +2 -2
- package/vscode/src/vs/workbench/services/authentication/common/authentication.service.d.ts +6 -6
- package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.d.ts +286 -0
- package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.js +861 -0
- package/vscode/src/vs/workbench/{contrib → services}/chat/common/chatEntitlementService.service.d.ts +8 -2
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +16 -16
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +87 -87
- package/vscode/src/vs/workbench/services/language/common/languageService.js +30 -30
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycleService.d.ts +1 -0
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycleService.js +4 -1
- package/vscode/src/vs/workbench/services/log/common/logConstants.js +1 -1
- package/vscode/src/vs/workbench/services/preferences/common/preferences.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +8 -8
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +6 -6
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
- package/vscode/src/vs/workbench/services/textfile/common/encoding.js +1 -1
- package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +22 -22
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +13 -13
- package/vscode-dts/vscode.d.ts +92 -47
- package/vscode-dts/vscode.proposed.authenticationChallenges.d.ts +7 -80
- package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +14 -1
- package/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts +12 -0
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +19 -0
- package/vscode-dts/vscode.proposed.chatSessionsProvider.d.ts +19 -11
- package/vscode-dts/vscode.proposed.d.ts +1 -1
- package/vscode-dts/{vscode.proposed.secretStorageKeys.d.ts → vscode.proposed.devDeviceId.d.ts} +3 -4
- package/vscode-dts/vscode.proposed.languageModelCapabilities.d.ts +5 -0
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +2 -0
- package/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts +70 -16
- package/vscode/src/vs/workbench/contrib/chat/common/chatLayoutService.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/index.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/tokens.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/types.d.ts +0 -55
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/types.d.ts +0 -91
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +0 -125
- /package/vscode/src/vs/workbench/{contrib → services}/chat/common/chatEntitlementService.service.js +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { toDisposable, DisposableStore } from '../common/lifecycle.js';
|
|
3
2
|
import { Schemas } from '../common/network.js';
|
|
4
|
-
import {
|
|
3
|
+
import { reset } from './dom.js';
|
|
5
4
|
import dompurify from 'dompurify';
|
|
6
5
|
|
|
7
6
|
const basicMarkupHtmlTags = ( Object.freeze([
|
|
@@ -47,6 +46,7 @@ const basicMarkupHtmlTags = ( Object.freeze([
|
|
|
47
46
|
'rp',
|
|
48
47
|
'rt',
|
|
49
48
|
'ruby',
|
|
49
|
+
's',
|
|
50
50
|
'samp',
|
|
51
51
|
'small',
|
|
52
52
|
'small',
|
|
@@ -92,19 +92,28 @@ const defaultAllowedAttrs = ( Object.freeze([
|
|
|
92
92
|
'height',
|
|
93
93
|
'align',
|
|
94
94
|
]));
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (allowedProtocols
|
|
95
|
+
const fakeRelativeUrlProtocol = 'vscode-relative-path';
|
|
96
|
+
function validateLink(value, allowedProtocols) {
|
|
97
|
+
if (allowedProtocols.override === '*') {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
const url = ( new URL(value, fakeRelativeUrlProtocol + '://'));
|
|
102
|
+
if (allowedProtocols.override.includes(url.protocol.replace(/:$/, ''))) {
|
|
103
103
|
return true;
|
|
104
104
|
}
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
if (allowedProtocols.allowRelativePaths
|
|
106
|
+
&& url.protocol === fakeRelativeUrlProtocol + ':'
|
|
107
|
+
&& !value.trim().toLowerCase().startsWith(fakeRelativeUrlProtocol)) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
107
111
|
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function hookDomPurifyHrefAndSrcSanitizer(allowedLinkProtocols, allowedMediaProtocols) {
|
|
108
117
|
dompurify.addHook('afterSanitizeAttributes', (node) => {
|
|
109
118
|
for (const attr of ['href', 'src']) {
|
|
110
119
|
if (node.hasAttribute(attr)) {
|
|
@@ -122,18 +131,16 @@ function hookDomPurifyHrefAndSrcSanitizer(allowedLinkProtocols, allowedMediaProt
|
|
|
122
131
|
}
|
|
123
132
|
}
|
|
124
133
|
});
|
|
125
|
-
return toDisposable(() => dompurify.removeHook('afterSanitizeAttributes'));
|
|
126
134
|
}
|
|
127
135
|
const defaultDomPurifyConfig = ( Object.freeze({
|
|
128
136
|
ALLOWED_TAGS: [...basicMarkupHtmlTags],
|
|
129
137
|
ALLOWED_ATTR: [...defaultAllowedAttrs],
|
|
130
|
-
RETURN_DOM: false,
|
|
131
|
-
RETURN_DOM_FRAGMENT: false,
|
|
132
|
-
RETURN_TRUSTED_TYPE: true,
|
|
133
138
|
ALLOW_UNKNOWN_PROTOCOLS: true,
|
|
134
139
|
}));
|
|
135
140
|
function sanitizeHtml(untrusted, config) {
|
|
136
|
-
|
|
141
|
+
return doSanitizeHtml(untrusted, config, 'trusted');
|
|
142
|
+
}
|
|
143
|
+
function doSanitizeHtml(untrusted, config, outputType) {
|
|
137
144
|
try {
|
|
138
145
|
const resolvedConfig = { ...defaultDomPurifyConfig };
|
|
139
146
|
if (config?.allowedTags) {
|
|
@@ -173,12 +180,18 @@ function sanitizeHtml(untrusted, config) {
|
|
|
173
180
|
}
|
|
174
181
|
}
|
|
175
182
|
resolvedConfig.ALLOWED_ATTR = Array.from(allowedAttrNames);
|
|
176
|
-
|
|
183
|
+
hookDomPurifyHrefAndSrcSanitizer({
|
|
184
|
+
override: config?.allowedLinkProtocols?.override ?? [Schemas.http, Schemas.https],
|
|
185
|
+
allowRelativePaths: config?.allowRelativeLinkPaths ?? false
|
|
186
|
+
}, {
|
|
187
|
+
override: config?.allowedMediaProtocols?.override ?? [Schemas.http, Schemas.https],
|
|
188
|
+
allowRelativePaths: config?.allowRelativeMediaPaths ?? false
|
|
189
|
+
});
|
|
177
190
|
if (config?.replaceWithPlaintext) {
|
|
178
|
-
|
|
191
|
+
dompurify.addHook('uponSanitizeElement', replaceWithPlainTextHook);
|
|
179
192
|
}
|
|
180
193
|
if (allowedAttrPredicates.size) {
|
|
181
|
-
|
|
194
|
+
dompurify.addHook('uponSanitizeAttribute', (node, e) => {
|
|
182
195
|
const predicate = allowedAttrPredicates.get(e.attrName);
|
|
183
196
|
if (predicate) {
|
|
184
197
|
const result = predicate.shouldKeep(node, e);
|
|
@@ -193,15 +206,23 @@ function sanitizeHtml(untrusted, config) {
|
|
|
193
206
|
else {
|
|
194
207
|
e.keepAttr = ( allowedAttrNames.has(e.attrName));
|
|
195
208
|
}
|
|
196
|
-
})
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
if (outputType === 'dom') {
|
|
212
|
+
return dompurify.sanitize(untrusted, {
|
|
213
|
+
...resolvedConfig,
|
|
214
|
+
RETURN_DOM_FRAGMENT: true
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
return dompurify.sanitize(untrusted, {
|
|
219
|
+
...resolvedConfig,
|
|
220
|
+
RETURN_TRUSTED_TYPE: true
|
|
221
|
+
});
|
|
197
222
|
}
|
|
198
|
-
return dompurify.sanitize(untrusted, {
|
|
199
|
-
...resolvedConfig,
|
|
200
|
-
RETURN_TRUSTED_TYPE: true
|
|
201
|
-
});
|
|
202
223
|
}
|
|
203
224
|
finally {
|
|
204
|
-
|
|
225
|
+
dompurify.removeAllHooks();
|
|
205
226
|
}
|
|
206
227
|
}
|
|
207
228
|
const selfClosingTags = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
|
@@ -248,7 +269,8 @@ function convertTagToPlaintext(element) {
|
|
|
248
269
|
return fragment;
|
|
249
270
|
}
|
|
250
271
|
function safeSetInnerHtml(node, untrusted, config) {
|
|
251
|
-
|
|
272
|
+
const fragment = doSanitizeHtml(untrusted, config, 'dom');
|
|
273
|
+
reset(node, fragment);
|
|
252
274
|
}
|
|
253
275
|
|
|
254
276
|
export { basicMarkupHtmlTags, convertTagToPlaintext, defaultAllowedAttrs, safeSetInnerHtml, sanitizeHtml };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { toDisposable, DisposableStore } from '../common/lifecycle.js';
|
|
3
3
|
import '../common/observableInternal/index.js';
|
|
4
|
+
import { isFirefox } from './browser.js';
|
|
4
5
|
import { isShadowRoot, createElement, getWindows, sharedMutationObserver } from './dom.js';
|
|
5
6
|
import { mainWindow } from './window.js';
|
|
6
7
|
import { autorun } from '../common/observableInternal/reactions/autorun.js';
|
|
@@ -56,6 +57,9 @@ function createStyleSheet(container = mainWindow.document.head, beforeAppend, di
|
|
|
56
57
|
if (container === mainWindow.document.head) {
|
|
57
58
|
const globalStylesheetClones = ( new Set());
|
|
58
59
|
globalStylesheets.set(style, globalStylesheetClones);
|
|
60
|
+
if (disposableStore) {
|
|
61
|
+
disposableStore.add(toDisposable(() => globalStylesheets.delete(style)));
|
|
62
|
+
}
|
|
59
63
|
for (const { window: targetWindow, disposables } of getWindows()) {
|
|
60
64
|
if (targetWindow === mainWindow) {
|
|
61
65
|
continue;
|
|
@@ -85,7 +89,7 @@ function cloneGlobalStyleSheet(globalStylesheet, globalStylesheetClones, windowE
|
|
|
85
89
|
for (const rule of getDynamicStyleSheetRules(globalStylesheet)) {
|
|
86
90
|
clone.sheet?.insertRule(rule.cssText, clone.sheet?.cssRules.length);
|
|
87
91
|
}
|
|
88
|
-
disposables.add(sharedMutationObserver.observe(globalStylesheet, disposables, { childList: true, subtree:
|
|
92
|
+
disposables.add(sharedMutationObserver.observe(globalStylesheet, disposables, { childList: true, subtree: isFirefox, characterData: isFirefox })(() => {
|
|
89
93
|
clone.textContent = globalStylesheet.textContent;
|
|
90
94
|
}));
|
|
91
95
|
globalStylesheetClones.add(clone);
|
|
@@ -84,7 +84,7 @@ function renderMarkdown(markdown, options = {}, target) {
|
|
|
84
84
|
renderedMarkdown = ( elements.map(e => typeof e === 'string' ? e : e.outerHTML)).join('');
|
|
85
85
|
}
|
|
86
86
|
const renderedContent = createElement('div');
|
|
87
|
-
const sanitizerConfig = getDomSanitizerConfig(markdown
|
|
87
|
+
const sanitizerConfig = getDomSanitizerConfig(markdown, options.sanitizerConfig ?? {});
|
|
88
88
|
safeSetInnerHtml(renderedContent, renderedMarkdown, sanitizerConfig);
|
|
89
89
|
rewriteRenderedLinks(markdown, options, renderedContent);
|
|
90
90
|
let outElement;
|
|
@@ -337,8 +337,8 @@ function resolveWithBaseUri(baseUri, href) {
|
|
|
337
337
|
return ( resolvePath(dirname(baseUri), href).toString());
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
function sanitizeRenderedMarkdown(renderedMarkdown,
|
|
341
|
-
const sanitizerConfig = getDomSanitizerConfig(
|
|
340
|
+
function sanitizeRenderedMarkdown(renderedMarkdown, originalMdStrConfig, options = {}) {
|
|
341
|
+
const sanitizerConfig = getDomSanitizerConfig(originalMdStrConfig, options);
|
|
342
342
|
return sanitizeHtml(renderedMarkdown, sanitizerConfig);
|
|
343
343
|
}
|
|
344
344
|
const allowedMarkdownHtmlTags = ( Object.freeze([
|
|
@@ -393,7 +393,8 @@ const allowedMarkdownHtmlAttributes = ( Object.freeze([
|
|
|
393
393
|
},
|
|
394
394
|
},
|
|
395
395
|
]));
|
|
396
|
-
function getDomSanitizerConfig(
|
|
396
|
+
function getDomSanitizerConfig(mdStrConfig, options) {
|
|
397
|
+
const isTrusted = mdStrConfig.isTrusted ?? false;
|
|
397
398
|
const allowedLinkSchemes = [
|
|
398
399
|
Schemas.http,
|
|
399
400
|
Schemas.https,
|
|
@@ -420,6 +421,7 @@ function getDomSanitizerConfig(isTrusted, options) {
|
|
|
420
421
|
allowedLinkProtocols: {
|
|
421
422
|
override: allowedLinkSchemes,
|
|
422
423
|
},
|
|
424
|
+
allowRelativeLinkPaths: !!mdStrConfig.baseUri,
|
|
423
425
|
allowedMediaProtocols: {
|
|
424
426
|
override: [
|
|
425
427
|
Schemas.http,
|
|
@@ -443,7 +445,7 @@ function renderAsPlaintext(str, options) {
|
|
|
443
445
|
value = `${value.substr(0, 100_000)}…`;
|
|
444
446
|
}
|
|
445
447
|
const html = parse$1(value, { async: false, renderer: options?.includeCodeBlocksFences ? plainTextWithCodeBlocksRenderer.value : plainTextRenderer.value });
|
|
446
|
-
return ( sanitizeRenderedMarkdown(html,
|
|
448
|
+
return ( sanitizeRenderedMarkdown(html, { isTrusted: false }, {})
|
|
447
449
|
.toString())
|
|
448
450
|
.replace(/&(#\d+|[a-zA-Z]+);/g, m => unescapeInfo.get(m) ?? m)
|
|
449
451
|
.trim();
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
3
|
import { BrowserFeatures } from '../../canIUse.js';
|
|
4
|
-
import { $, hide, createElement, addStandardDisposableListener, clearNode, show, isHTMLElement, getDomNodePagePosition, getDomNodeZoomLevel, getTotalWidth, getTotalHeight, getActiveWindow, getWindow, isAncestor } from '../../dom.js';
|
|
4
|
+
import { $, hide, createElement, addStandardDisposableListener, clearNode, show, isHTMLElement, getDomNodePagePosition, getDomNodeZoomLevel, getTotalWidth, getTotalHeight, getActiveWindow, getActiveElement, getWindow, isAncestor } from '../../dom.js';
|
|
5
5
|
import { Disposable, toDisposable, DisposableStore } from '../../../common/lifecycle.js';
|
|
6
6
|
import { isIOS } from '../../../common/platform.js';
|
|
7
7
|
import { Range } from '../../../common/range.js';
|
|
@@ -243,7 +243,7 @@ class ContextView extends Disposable {
|
|
|
243
243
|
onDOMEvent(e, onCapture) {
|
|
244
244
|
if (this.delegate) {
|
|
245
245
|
if (this.delegate.onDOMEvent) {
|
|
246
|
-
this.delegate.onDOMEvent(e, getWindow(e).document
|
|
246
|
+
this.delegate.onDOMEvent(e, getActiveElement(getWindow(e).document));
|
|
247
247
|
}
|
|
248
248
|
else if (onCapture && !isAncestor(e.target, this.container)) {
|
|
249
249
|
this.hide();
|
|
@@ -31,7 +31,7 @@ class BaseDropdown extends ActionRunner {
|
|
|
31
31
|
}
|
|
32
32
|
for (const event of [EventType.MOUSE_DOWN, EventType$1.Tap]) {
|
|
33
33
|
this._register(addDisposableListener(this._label, event, e => {
|
|
34
|
-
if (isMouseEvent(e) &&
|
|
34
|
+
if (isMouseEvent(e) && e.button !== 0) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
if (this.visible) {
|
|
@@ -645,6 +645,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|
|
645
645
|
this.submenuContainer.style.position = 'fixed';
|
|
646
646
|
this.submenuContainer.style.top = '0';
|
|
647
647
|
this.submenuContainer.style.left = '0';
|
|
648
|
+
this.submenuContainer.style.zIndex = '1';
|
|
648
649
|
this.parentData.submenu = ( new Menu(
|
|
649
650
|
this.submenuContainer,
|
|
650
651
|
this.submenuActions.length ? this.submenuActions : [( new EmptySubmenuAction())],
|
|
@@ -57,7 +57,7 @@ export declare class ProgressBar extends Disposable {
|
|
|
57
57
|
*/
|
|
58
58
|
worked(value: number): ProgressBar;
|
|
59
59
|
/**
|
|
60
|
-
* Tells the progress bar the total amount of work that has been completed.
|
|
60
|
+
* Tells the progress bar the total amount of work (0 to 100) that has been completed.
|
|
61
61
|
*/
|
|
62
62
|
setWorked(value: number): ProgressBar;
|
|
63
63
|
private doSetWorked;
|
|
@@ -921,6 +921,9 @@ class DeferredPromise {
|
|
|
921
921
|
}));
|
|
922
922
|
}
|
|
923
923
|
complete(value) {
|
|
924
|
+
if (this.isSettled) {
|
|
925
|
+
return Promise.resolve();
|
|
926
|
+
}
|
|
924
927
|
return ( new Promise(resolve => {
|
|
925
928
|
this.completeCallback(value);
|
|
926
929
|
this.outcome = { outcome: DeferredOutcome.Resolved, value };
|
|
@@ -928,6 +931,9 @@ class DeferredPromise {
|
|
|
928
931
|
}));
|
|
929
932
|
}
|
|
930
933
|
error(err) {
|
|
934
|
+
if (this.isSettled) {
|
|
935
|
+
return Promise.resolve();
|
|
936
|
+
}
|
|
931
937
|
return ( new Promise(resolve => {
|
|
932
938
|
this.errorCallback(err);
|
|
933
939
|
this.outcome = { outcome: DeferredOutcome.Rejected, value: err };
|
|
@@ -28,3 +28,24 @@ export declare class CancellationTokenSource {
|
|
|
28
28
|
dispose(cancel?: boolean): void;
|
|
29
29
|
}
|
|
30
30
|
export declare function cancelOnDispose(store: DisposableStore): CancellationToken;
|
|
31
|
+
/**
|
|
32
|
+
* A pool that aggregates multiple cancellation tokens. The pool's own token
|
|
33
|
+
* (accessible via `pool.token`) is cancelled only after every token added
|
|
34
|
+
* to the pool has been cancelled. Adding tokens after the pool token has
|
|
35
|
+
* been cancelled has no effect.
|
|
36
|
+
*/
|
|
37
|
+
export declare class CancellationTokenPool {
|
|
38
|
+
private readonly _source;
|
|
39
|
+
private readonly _listeners;
|
|
40
|
+
private _total;
|
|
41
|
+
private _cancelled;
|
|
42
|
+
private _isDone;
|
|
43
|
+
get token(): CancellationToken;
|
|
44
|
+
/**
|
|
45
|
+
* Add a token to the pool. If the token is already cancelled it is counted
|
|
46
|
+
* immediately. Tokens added after the pool token has been cancelled are ignored.
|
|
47
|
+
*/
|
|
48
|
+
add(token: CancellationToken): void;
|
|
49
|
+
private _check;
|
|
50
|
+
dispose(): void;
|
|
51
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Event, Emitter } from './event.js';
|
|
3
|
+
import { DisposableStore } from './lifecycle.js';
|
|
3
4
|
|
|
4
5
|
const shortcutEvent = ( Object.freeze(function (callback, context) {
|
|
5
6
|
const handle = setTimeout(callback.bind(context), 0);
|
|
@@ -101,5 +102,45 @@ function cancelOnDispose(store) {
|
|
|
101
102
|
store.add({ dispose() { source.cancel(); } });
|
|
102
103
|
return source.token;
|
|
103
104
|
}
|
|
105
|
+
class CancellationTokenPool {
|
|
106
|
+
constructor() {
|
|
107
|
+
this._source = ( new CancellationTokenSource());
|
|
108
|
+
this._listeners = ( new DisposableStore());
|
|
109
|
+
this._total = 0;
|
|
110
|
+
this._cancelled = 0;
|
|
111
|
+
this._isDone = false;
|
|
112
|
+
}
|
|
113
|
+
get token() {
|
|
114
|
+
return this._source.token;
|
|
115
|
+
}
|
|
116
|
+
add(token) {
|
|
117
|
+
if (this._isDone) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this._total++;
|
|
121
|
+
if (token.isCancellationRequested) {
|
|
122
|
+
this._cancelled++;
|
|
123
|
+
this._check();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const d = token.onCancellationRequested(() => {
|
|
127
|
+
d.dispose();
|
|
128
|
+
this._cancelled++;
|
|
129
|
+
this._check();
|
|
130
|
+
});
|
|
131
|
+
this._listeners.add(d);
|
|
132
|
+
}
|
|
133
|
+
_check() {
|
|
134
|
+
if (!this._isDone && this._total > 0 && this._total === this._cancelled) {
|
|
135
|
+
this._isDone = true;
|
|
136
|
+
this._listeners.dispose();
|
|
137
|
+
this._source.cancel();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
dispose() {
|
|
141
|
+
this._listeners.dispose();
|
|
142
|
+
this._source.dispose();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
104
145
|
|
|
105
|
-
export { CancellationToken, CancellationTokenSource, cancelOnDispose };
|
|
146
|
+
export { CancellationToken, CancellationTokenPool, CancellationTokenSource, cancelOnDispose };
|
|
@@ -677,4 +677,7 @@ export declare const Codicon: {
|
|
|
677
677
|
readonly commentDiscussionSparkle: ThemeIcon;
|
|
678
678
|
readonly chatSparkleWarning: ThemeIcon;
|
|
679
679
|
readonly chatSparkleError: ThemeIcon;
|
|
680
|
+
readonly collection: ThemeIcon;
|
|
681
|
+
readonly newCollection: ThemeIcon;
|
|
682
|
+
readonly thinking: ThemeIcon;
|
|
680
683
|
};
|
|
@@ -603,4 +603,7 @@ export declare const codiconsLibrary: {
|
|
|
603
603
|
readonly commentDiscussionSparkle: import("./themables.js").ThemeIcon;
|
|
604
604
|
readonly chatSparkleWarning: import("./themables.js").ThemeIcon;
|
|
605
605
|
readonly chatSparkleError: import("./themables.js").ThemeIcon;
|
|
606
|
+
readonly collection: import("./themables.js").ThemeIcon;
|
|
607
|
+
readonly newCollection: import("./themables.js").ThemeIcon;
|
|
608
|
+
readonly thinking: import("./themables.js").ThemeIcon;
|
|
606
609
|
};
|
|
@@ -606,6 +606,9 @@ const codiconsLibrary = {
|
|
|
606
606
|
commentDiscussionSparkle: register('comment-discussion-sparkle', 0xec54),
|
|
607
607
|
chatSparkleWarning: register('chat-sparkle-warning', 0xec55),
|
|
608
608
|
chatSparkleError: register('chat-sparkle-error', 0xec56),
|
|
609
|
+
collection: register('collection', 0xec57),
|
|
610
|
+
newCollection: register('new-collection', 0xec58),
|
|
611
|
+
thinking: register('thinking', 0xec59),
|
|
609
612
|
};
|
|
610
613
|
|
|
611
614
|
export { codiconsLibrary };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Disposable } from "../lifecycle.js";
|
|
2
|
+
import { CancellationToken } from "../cancellation.js";
|
|
3
|
+
/**
|
|
4
|
+
* Helper type that represents a function that has an optional {@linkcode CancellationToken}
|
|
5
|
+
* argument argument at the end of the arguments list.
|
|
6
|
+
*
|
|
7
|
+
* @typeparam `TFunction` - Type of the function arguments list of which will be extended
|
|
8
|
+
* with an optional {@linkcode CancellationToken} argument.
|
|
9
|
+
*/
|
|
10
|
+
type TWithOptionalCancellationToken<TFunction extends Function> = TFunction extends (...args: infer TArgs) => infer TReturn ? (...args: [
|
|
11
|
+
...TArgs,
|
|
12
|
+
cancellatioNToken?: CancellationToken
|
|
13
|
+
]) => TReturn : never;
|
|
14
|
+
/**
|
|
15
|
+
* Decorator that provides a mechanism to cancel previous calls of the decorated method
|
|
16
|
+
* by providing a `cancellation token` as the last argument of the method, which gets
|
|
17
|
+
* cancelled immediately on subsequent call of the decorated method.
|
|
18
|
+
*
|
|
19
|
+
* Therefore to use this decorator, the two conditions must be met:
|
|
20
|
+
*
|
|
21
|
+
* - the decorated method must have an *optional* {@linkcode CancellationToken} argument at
|
|
22
|
+
* the end of the arguments list
|
|
23
|
+
* - the object that the decorated method belongs to must implement the {@linkcode Disposable};
|
|
24
|
+
* this requirement comes from the internal implementation of the decorator that
|
|
25
|
+
* creates new resources that need to be eventually disposed by someone
|
|
26
|
+
*
|
|
27
|
+
* @typeparam `TObject` - Object type that the decorated method belongs to.
|
|
28
|
+
* @typeparam `TArgs` - Argument list of the decorated method.
|
|
29
|
+
* @typeparam `TReturn` - Return value type of the decorated method.
|
|
30
|
+
*
|
|
31
|
+
* ### Examples
|
|
32
|
+
*
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // let's say we have a class that implements the `Disposable` interface that we want
|
|
35
|
+
* // to use the decorator on
|
|
36
|
+
* class Example extends Disposable {
|
|
37
|
+
* async doSomethingAsync(arg1: number, arg2: string): Promise<void> {
|
|
38
|
+
* // do something async..
|
|
39
|
+
* await new Promise(resolve => setTimeout(resolve, 1000));
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* ```typescript
|
|
45
|
+
* // to do that we need to add the `CancellationToken` argument to the end of args list
|
|
46
|
+
* class Example extends Disposable {
|
|
47
|
+
* @cancelPreviousCalls
|
|
48
|
+
* async doSomethingAsync(arg1: number, arg2: string, cancellationToken?: CancellationToken): Promise<void> {
|
|
49
|
+
* console.log(`call with args ${arg1} and ${arg2} initiated`);
|
|
50
|
+
*
|
|
51
|
+
* // the decorator will create the cancellation token automatically
|
|
52
|
+
* assertDefined(
|
|
53
|
+
* cancellationToken,
|
|
54
|
+
* `The method must now have the `CancellationToken` passed to it.`,
|
|
55
|
+
* );
|
|
56
|
+
*
|
|
57
|
+
* cancellationToken.onCancellationRequested(() => {
|
|
58
|
+
* console.log(`call with args ${arg1} and ${arg2} was cancelled`);
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* // do something async..
|
|
62
|
+
* await new Promise(resolve => setTimeout(resolve, 1000));
|
|
63
|
+
*
|
|
64
|
+
* // check cancellation token state after the async operations
|
|
65
|
+
* console.log(
|
|
66
|
+
* `call with args ${arg1} and ${arg2} completed, canceled?: ${cancellationToken.isCancellationRequested}`,
|
|
67
|
+
* );
|
|
68
|
+
* }
|
|
69
|
+
* }
|
|
70
|
+
*
|
|
71
|
+
* const example = new Example();
|
|
72
|
+
* // call the decorate method first time
|
|
73
|
+
* example.doSomethingAsync(1, 'foo');
|
|
74
|
+
* // wait for 500ms which is less than 1000ms of the async operation in the first call
|
|
75
|
+
* await new Promise(resolve => setTimeout(resolve, 500));
|
|
76
|
+
* // calling the decorate method second time cancels the token passed to the first call
|
|
77
|
+
* example.doSomethingAsync(2, 'bar');
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function cancelPreviousCalls<TObject extends Disposable, TArgs extends unknown[], TReturn extends unknown>(_proto: TObject, methodName: string, descriptor: TypedPropertyDescriptor<TWithOptionalCancellationToken<(...args: TArgs) => TReturn>>): TypedPropertyDescriptor<(...args: [
|
|
81
|
+
...TArgs,
|
|
82
|
+
cancellatioNToken?: CancellationToken | undefined
|
|
83
|
+
]) => TReturn>;
|
|
84
|
+
export {};
|
|
@@ -4,4 +4,4 @@ export interface IDebounceReducer<T> {
|
|
|
4
4
|
}
|
|
5
5
|
export declare function debounce<T>(delay: number, reducer?: IDebounceReducer<T>, initialValueProvider?: () => T): MethodDecorator;
|
|
6
6
|
export declare function throttle<T>(delay: number, reducer?: IDebounceReducer<T>, initialValueProvider?: () => T): MethodDecorator;
|
|
7
|
-
export { cancelPreviousCalls } from "
|
|
7
|
+
export { cancelPreviousCalls } from "./decorators/cancelPreviousCalls.js";
|
|
@@ -55,4 +55,6 @@ export declare function markdownCommandLink(command: {
|
|
|
55
55
|
title: string;
|
|
56
56
|
id: string;
|
|
57
57
|
arguments?: unknown[];
|
|
58
|
+
tooltip?: string;
|
|
58
59
|
}, escapeTokens?: boolean): string;
|
|
60
|
+
export declare function createCommandUri(commandId: string, ...commandArgs: unknown[]): URI;
|
|
@@ -153,12 +153,15 @@ function parseHrefAndDimensions(href) {
|
|
|
153
153
|
return { href, dimensions };
|
|
154
154
|
}
|
|
155
155
|
function markdownCommandLink(command, escapeTokens = true) {
|
|
156
|
-
const uri = ( (
|
|
156
|
+
const uri = ( createCommandUri(command.id, ...(command.arguments || [])).toString());
|
|
157
|
+
return `[${escapeTokens ? escapeMarkdownSyntaxTokens(command.title) : command.title}](${uri}${command.tooltip ? ` "${escapeMarkdownSyntaxTokens(command.tooltip)}"` : ''})`;
|
|
158
|
+
}
|
|
159
|
+
function createCommandUri(commandId, ...commandArgs) {
|
|
160
|
+
return ( URI.from({
|
|
157
161
|
scheme: Schemas.command,
|
|
158
|
-
path:
|
|
159
|
-
query:
|
|
160
|
-
}))
|
|
161
|
-
return `[${escapeTokens ? escapeMarkdownSyntaxTokens(command.title) : command.title}](${uri})`;
|
|
162
|
+
path: commandId,
|
|
163
|
+
query: commandArgs.length ? encodeURIComponent(JSON.stringify(commandArgs)) : undefined,
|
|
164
|
+
}));
|
|
162
165
|
}
|
|
163
166
|
|
|
164
|
-
export { MarkdownString, MarkdownStringTextNewlineStyle, appendEscapedMarkdownCodeBlockFence, escapeDoubleQuotes, escapeMarkdownSyntaxTokens, isEmptyMarkdownString, isMarkdownString, markdownCommandLink, markdownStringEqual, parseHrefAndDimensions, removeMarkdownEscapes };
|
|
167
|
+
export { MarkdownString, MarkdownStringTextNewlineStyle, appendEscapedMarkdownCodeBlockFence, createCommandUri, escapeDoubleQuotes, escapeMarkdownSyntaxTokens, isEmptyMarkdownString, isMarkdownString, markdownCommandLink, markdownStringEqual, parseHrefAndDimensions, removeMarkdownEscapes };
|
|
@@ -214,14 +214,28 @@ function combinedDisposable(...disposables) {
|
|
|
214
214
|
setParentOfDisposables(disposables, parent);
|
|
215
215
|
return parent;
|
|
216
216
|
}
|
|
217
|
+
class FunctionDisposable {
|
|
218
|
+
constructor(fn) {
|
|
219
|
+
this._isDisposed = false;
|
|
220
|
+
this._fn = fn;
|
|
221
|
+
trackDisposable(this);
|
|
222
|
+
}
|
|
223
|
+
dispose() {
|
|
224
|
+
if (this._isDisposed) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (!this._fn) {
|
|
228
|
+
throw ( new Error(
|
|
229
|
+
`Unbound disposable context: Need to use an arrow function to preserve the value of this`
|
|
230
|
+
));
|
|
231
|
+
}
|
|
232
|
+
this._isDisposed = true;
|
|
233
|
+
markAsDisposed(this);
|
|
234
|
+
this._fn();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
217
237
|
function toDisposable(fn) {
|
|
218
|
-
|
|
219
|
-
dispose: createSingleCallFunction(() => {
|
|
220
|
-
markAsDisposed(self);
|
|
221
|
-
fn();
|
|
222
|
-
})
|
|
223
|
-
});
|
|
224
|
-
return self;
|
|
238
|
+
return ( new FunctionDisposable(fn));
|
|
225
239
|
}
|
|
226
240
|
class DisposableStore {
|
|
227
241
|
static { this.DISABLE_DISPOSED_WARNING = false; }
|
|
@@ -22,49 +22,4 @@ export declare class SlidingWindowAverage {
|
|
|
22
22
|
}
|
|
23
23
|
/** Returns whether the point is within the triangle formed by the following 6 x/y point pairs */
|
|
24
24
|
export declare function isPointWithinTriangle(x: number, y: number, ax: number, ay: number, bx: number, by: number, cx: number, cy: number): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Function to get a (pseudo)random integer from a provided `max`...[`min`] range.
|
|
27
|
-
* Both `min` and `max` values are inclusive. The `min` value is optional (defaults to `0`).
|
|
28
|
-
*
|
|
29
|
-
* @throws in the next cases:
|
|
30
|
-
* - if provided `min` or `max` is not a number
|
|
31
|
-
* - if provided `min` or `max` is not finite
|
|
32
|
-
* - if provided `min` is larger than `max` value
|
|
33
|
-
*
|
|
34
|
-
* ## Examples
|
|
35
|
-
*
|
|
36
|
-
* Specifying a `max` value only uses `0` as the `min` value by default:
|
|
37
|
-
*
|
|
38
|
-
* ```typescript
|
|
39
|
-
* // get a random integer between 0 and 10
|
|
40
|
-
* const randomInt = randomInt(10);
|
|
41
|
-
*
|
|
42
|
-
* assert(
|
|
43
|
-
* randomInt >= 0,
|
|
44
|
-
* 'Should be greater than or equal to 0.',
|
|
45
|
-
* );
|
|
46
|
-
*
|
|
47
|
-
* assert(
|
|
48
|
-
* randomInt <= 10,
|
|
49
|
-
* 'Should be less than or equal to 10.',
|
|
50
|
-
* );
|
|
51
|
-
* ```
|
|
52
|
-
* * Specifying both `max` and `min` values:
|
|
53
|
-
*
|
|
54
|
-
* ```typescript
|
|
55
|
-
* // get a random integer between 5 and 8
|
|
56
|
-
* const randomInt = randomInt(8, 5);
|
|
57
|
-
*
|
|
58
|
-
* assert(
|
|
59
|
-
* randomInt >= 5,
|
|
60
|
-
* 'Should be greater than or equal to 5.',
|
|
61
|
-
* );
|
|
62
|
-
*
|
|
63
|
-
* assert(
|
|
64
|
-
* randomInt <= 8,
|
|
65
|
-
* 'Should be less than or equal to 8.',
|
|
66
|
-
* );
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export declare function randomInt(max: number, min?: number): number;
|
|
70
25
|
export declare function randomChance(p: number): boolean;
|
|
@@ -550,3 +550,36 @@ export declare function getClaimsFromJWT(token: string): IAuthorizationJWTClaims
|
|
|
550
550
|
* ```
|
|
551
551
|
*/
|
|
552
552
|
export declare function scopesMatch(scopes1: readonly string[], scopes2: readonly string[]): boolean;
|
|
553
|
+
interface CommonResponse {
|
|
554
|
+
status: number;
|
|
555
|
+
statusText: string;
|
|
556
|
+
json(): Promise<any>;
|
|
557
|
+
text(): Promise<string>;
|
|
558
|
+
}
|
|
559
|
+
interface IFetcher {
|
|
560
|
+
(input: string, init: {
|
|
561
|
+
method: string;
|
|
562
|
+
headers: Record<string, string>;
|
|
563
|
+
}): Promise<CommonResponse>;
|
|
564
|
+
}
|
|
565
|
+
export interface IFetchResourceMetadataOptions {
|
|
566
|
+
/**
|
|
567
|
+
* Headers to include only when the resource metadata URL has the same origin as the target resource
|
|
568
|
+
*/
|
|
569
|
+
sameOriginHeaders?: Record<string, string>;
|
|
570
|
+
/**
|
|
571
|
+
* Optional custom fetch implementation (defaults to global fetch)
|
|
572
|
+
*/
|
|
573
|
+
fetch?: IFetcher;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Fetches and validates OAuth 2.0 protected resource metadata from the given URL.
|
|
577
|
+
*
|
|
578
|
+
* @param targetResource The target resource URL to compare origins with (e.g., the MCP server URL)
|
|
579
|
+
* @param resourceMetadataUrl Optional URL to fetch the resource metadata from. If not provided, will try well-known URIs.
|
|
580
|
+
* @param options Configuration options for the fetch operation
|
|
581
|
+
* @returns Promise that resolves to the validated resource metadata
|
|
582
|
+
* @throws Error if the fetch fails, returns non-200 status, or the response is invalid
|
|
583
|
+
*/
|
|
584
|
+
export declare function fetchResourceMetadata(targetResource: string, resourceMetadataUrl: string | undefined, options?: IFetchResourceMetadataOptions): Promise<IAuthorizationProtectedResourceMetadata>;
|
|
585
|
+
export {};
|