monaco-editor-core 0.56.0-dev-20251125 → 0.56.0-dev-20251217
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/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +30 -4
- package/esm/vs/base/browser/dom.js +1 -4
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +25 -11
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.js +15 -8
- package/esm/vs/base/browser/ui/button/button.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/list/list.css +1 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +11 -2
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +6 -0
- package/esm/vs/base/common/defaultAccount.js.map +1 -0
- package/esm/vs/base/common/equals.js +73 -24
- package/esm/vs/base/common/equals.js.map +1 -1
- package/esm/vs/base/common/event.js +14 -4
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/iterator.js.map +1 -1
- package/esm/vs/base/common/keybindings.js +0 -8
- package/esm/vs/base/common/keybindings.js.map +1 -1
- package/esm/vs/base/common/lifecycle.js +2 -2
- package/esm/vs/base/common/lifecycle.js.map +1 -1
- package/esm/vs/base/common/marshallingIds.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +1 -1
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
- package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
- package/esm/vs/base/common/product.js.map +1 -1
- package/esm/vs/base/common/strings.js +3 -1
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
- package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/view.js +11 -2
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
- package/esm/vs/editor/common/config/fontInfo.js +1 -1
- package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
- package/esm/vs/editor/common/core/edits/edit.js +19 -0
- package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
- package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/textEdit.js +0 -3
- package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
- package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
- package/esm/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorWordOperations.js +6 -3
- package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
- package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
- package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
- package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
- package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
- package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
- package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
- package/esm/vs/editor/common/languages.js +2 -1
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/decorationProvider.js +21 -1
- package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +49 -30
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
- package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
- package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
- package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
- package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
- package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/textModelEditSource.js +2 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/textModelEvents.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +54 -36
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +14 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
- package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +33 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -70
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +59 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +152 -95
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +113 -54
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +317 -75
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +29 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +78 -46
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +48 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +18 -15
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +11 -11
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +19 -15
- package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +3 -2
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetParser.js +33 -0
- package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
- package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +34 -3
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchLexer.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -8
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +11 -5
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
- package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/log/common/log.js +1 -1
- package/esm/vs/platform/log/common/log.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +6 -6
- package/esm/vs/platform/markers/common/markerService.js.map +1 -1
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +7 -3
- package/esm/vs/platform/quickinput/browser/quickInput.js +19 -11
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
- package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
- package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +21 -21
- package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
- package/esm/vs/platform/window/common/window.js +1 -1
- package/esm/vs/platform/window/common/window.js.map +1 -1
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +34 -3
- package/package.json +2 -2
- package/version.txt +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
- package/esm/vs/platform/product/common/productService.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/clipboard/browser/clipboard.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,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H,eAAe,GAAG,CAAC,OAAO,QAAQ,CAAC,eAAe,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;4BACtG,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;wBACtB,CAAC;wBACD,UAAU,CAAC,KAAK,CAAC,kDAAkD,EAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;wBACxH,aAAa,CAAC,OAAO,CAAC,UAAU,+BAAiB;4BAChD,IAAI,EAAE,aAAa;4BACnB,cAAc;4BACd,eAAe;4BACf,IAAI;yBACJ,CAAC,CAAC;oBACJ,CAAC;gBACF,CAAC,CAAC,EAAE,CAAC;YACN,CAAC;YACD,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,gEAAgE;IAChE,WAAW,CAAC,iBAAiB,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,QAA0B,EAAE,IAAa,EAAE,EAAE;QAC7F,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7C,UAAU,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACxF,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC,cAAc,CAAC,CAAC;QACpG,OAAO,YAAY,IAAI,KAAK,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,IAAI,YAAY,EAAE,CAAC;IAClB,oBAAoB,CAAC,2CAA2C,CAAC,CAAC;AACnE,CAAC","file":"clipboard.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as browser from '../../../../base/browser/browser.js';\nimport { getActiveDocument, getActiveWindow } from '../../../../base/browser/dom.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport * as nls from '../../../../nls.js';\nimport { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nimport { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';\nimport { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { IProductService } from '../../../../platform/product/common/productService.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { CopyOptions, InMemoryClipboardMetadataManager } from '../../../browser/controller/editContext/clipboardUtils.js';\nimport { NativeEditContextRegistry } from '../../../browser/controller/editContext/native/nativeEditContextRegistry.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Command, EditorAction, MultiCommand, registerEditorAction } from '../../../browser/editorExtensions.js';\nimport { ICodeEditorService } from '../../../browser/services/codeEditorService.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Handler } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { CopyPasteController } from '../../dropOrPasteInto/browser/copyPasteController.js';\n\nconst CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';\n\nconst supportsCut = (platform.isNative || document.queryCommandSupported('cut'));\nconst supportsCopy = (platform.isNative || document.queryCommandSupported('copy'));\n// Firefox only supports navigator.clipboard.readText() in browser extensions.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#Browser_compatibility\n// When loading over http, navigator.clipboard can be undefined. See https://github.com/microsoft/monaco-editor/issues/2313\nconst supportsPaste = (typeof navigator.clipboard === 'undefined' || browser.isFirefox) ? document.queryCommandSupported('paste') : true;\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport const CutAction = supportsCut ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCutAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind cut keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyX,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyX, secondary: [KeyMod.Shift | KeyCode.Delete] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCut', comment: ['&& denotes a mnemonic'] }, \"Cu&&t\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}]\n})) : undefined;\n\nexport const CopyAction = supportsCopy ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCopyAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind copy keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyC,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCopy', comment: ['&& denotes a mnemonic'] }, \"&&Copy\"),\n\t\torder: 2\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}]\n})) : undefined;\n\nMenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2('copy as', \"Copy As\"), group: '2_ccp', order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2('copy as', \"Copy As\"), group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1, when: ContextKeyExpr.and(ContextKeyExpr.notEquals('resourceScheme', 'output'), EditorContextKeys.editorTextFocus) });\nMenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1 });\n\nexport const PasteAction = supportsPaste ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardPasteAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind paste keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyV,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, \"&&Paste\"),\n\t\torder: 4\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}]\n})) : undefined;\n\nclass ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',\n\t\t\tlabel: nls.localize2('actions.clipboard.copyWithSyntaxHighlightingLabel', \"Copy with Syntax Highlighting\"),\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction#run');\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptySelectionClipboard = editor.getOption(EditorOption.emptySelectionClipboard);\n\n\t\tif (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = true;\n\t\teditor.focus();\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)');\n\t\teditor.getContainerDomNode().ownerDocument.execCommand('copy');\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)');\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = false;\n\t}\n}\n\nfunction registerExecCommandImpl(target: MultiCommand | undefined, browserCommand: 'cut' | 'copy'): void {\n\tif (!target) {\n\t\treturn;\n\t}\n\n\t// 1. handle case when focus is in editor.\n\ttarget.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation code-editor for : ', browserCommand, ')');\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasTextFocus()) {\n\t\t\t// Do not execute if there is no selection and empty selection clipboard is off\n\t\t\tconst emptySelectionClipboard = focusedEditor.getOption(EditorOption.emptySelectionClipboard);\n\t\t\tconst selection = focusedEditor.getSelection();\n\t\t\tif (selection && selection.isEmpty() && !emptySelectionClipboard) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// TODO this is very ugly. The entire copy/paste/cut system needs a complete refactoring.\n\t\t\tif (focusedEditor.getOption(EditorOption.effectiveEditContext) && browserCommand === 'cut') {\n\t\t\t\tlogCopyCommand(focusedEditor);\n\t\t\t\t// execCommand(copy) works for edit context, but not execCommand(cut).\n\t\t\t\tlogService.trace('registerExecCommandImpl (before execCommand copy)');\n\t\t\t\tfocusedEditor.getContainerDomNode().ownerDocument.execCommand('copy');\n\t\t\t\tfocusedEditor.trigger(undefined, Handler.Cut, undefined);\n\t\t\t\tlogService.trace('registerExecCommandImpl (after execCommand copy)');\n\t\t\t} else {\n\t\t\t\tlogCopyCommand(focusedEditor);\n\t\t\t\tlogService.trace('registerExecCommandImpl (before execCommand ' + browserCommand + ')');\n\t\t\t\tfocusedEditor.getContainerDomNode().ownerDocument.execCommand(browserCommand);\n\t\t\t\tlogService.trace('registerExecCommandImpl (after execCommand ' + browserCommand + ')');\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. (default) handle case when focus is somewhere else.\n\ttarget.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation generic-dom for : ', browserCommand, ')');\n\t\tlogService.trace('registerExecCommandImpl (before execCommand ' + browserCommand + ')');\n\t\tgetActiveDocument().execCommand(browserCommand);\n\t\tlogService.trace('registerExecCommandImpl (after execCommand ' + browserCommand + ')');\n\t\treturn true;\n\t});\n}\n\nfunction logCopyCommand(editor: ICodeEditor) {\n\tconst editContextEnabled = editor.getOption(EditorOption.effectiveEditContext);\n\tif (editContextEnabled) {\n\t\tconst nativeEditContext = NativeEditContextRegistry.get(editor.getId());\n\t\tif (nativeEditContext) {\n\t\t\tnativeEditContext.onWillCopy();\n\t\t}\n\t}\n}\n\nregisterExecCommandImpl(CutAction, 'cut');\nregisterExecCommandImpl(CopyAction, 'copy');\n\nif (PasteAction) {\n\t// 1. Paste: handle case when focus is in editor.\n\tPasteAction.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation code-editor for : paste)');\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\t\tconst telemetryService = accessor.get(ITelemetryService);\n\t\tconst productService = accessor.get(IProductService);\n\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = codeEditorService.getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasModel() && focusedEditor.hasTextFocus()) {\n\t\t\t// execCommand(paste) does not work with edit context\n\t\t\tconst editContextEnabled = focusedEditor.getOption(EditorOption.effectiveEditContext);\n\t\t\tif (editContextEnabled) {\n\t\t\t\tconst nativeEditContext = NativeEditContextRegistry.get(focusedEditor.getId());\n\t\t\t\tif (nativeEditContext) {\n\t\t\t\t\tnativeEditContext.onWillPaste();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst sw = StopWatch.create(true);\n\t\t\tlogService.trace('registerExecCommandImpl (before triggerPaste)');\n\t\t\tconst triggerPaste = clipboardService.triggerPaste(getActiveWindow().vscodeWindowId);\n\t\t\tif (triggerPaste) {\n\t\t\t\tlogService.trace('registerExecCommandImpl (triggerPaste defined)');\n\t\t\t\treturn triggerPaste.then(async () => {\n\t\t\t\t\tlogService.trace('registerExecCommandImpl (after triggerPaste)');\n\t\t\t\t\tif (productService.quality !== 'stable') {\n\t\t\t\t\t\tconst duration = sw.elapsed();\n\t\t\t\t\t\ttype EditorAsyncPasteClassification = {\n\t\t\t\t\t\t\tduration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration of the paste operation.' };\n\t\t\t\t\t\t\towner: 'aiday-mar';\n\t\t\t\t\t\t\tcomment: 'Provides insight into the delay introduced by pasting async via keybindings.';\n\t\t\t\t\t\t};\n\t\t\t\t\t\ttype EditorAsyncPasteEvent = {\n\t\t\t\t\t\t\tduration: number;\n\t\t\t\t\t\t};\n\t\t\t\t\t\ttelemetryService.publicLog2<EditorAsyncPasteEvent, EditorAsyncPasteClassification>(\n\t\t\t\t\t\t\t'editorAsyncPaste',\n\t\t\t\t\t\t\t{ duration }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlogService.trace('registerExecCommandImpl (triggerPaste undefined)');\n\t\t\t}\n\t\t\tif (platform.isWeb) {\n\t\t\t\tlogService.trace('registerExecCommandImpl (Paste handling on web)');\n\t\t\t\t// Use the clipboard service if document.execCommand('paste') was not successful\n\t\t\t\treturn (async () => {\n\t\t\t\t\tconst clipboardText = await clipboardService.readText();\n\t\t\t\t\tif (clipboardText !== '') {\n\t\t\t\t\t\tconst metadata = InMemoryClipboardMetadataManager.INSTANCE.get(clipboardText);\n\t\t\t\t\t\tlet pasteOnNewLine = false;\n\t\t\t\t\t\tlet multicursorText: string[] | null = null;\n\t\t\t\t\t\tlet mode: string | null = null;\n\t\t\t\t\t\tif (metadata) {\n\t\t\t\t\t\t\tpasteOnNewLine = (focusedEditor.getOption(EditorOption.emptySelectionClipboard) && !!metadata.isFromEmptySelection);\n\t\t\t\t\t\t\tmulticursorText = (typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null);\n\t\t\t\t\t\t\tmode = metadata.mode;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogService.trace('registerExecCommandImpl (clipboardText.length : ', clipboardText.length, ' id : ', metadata?.id, ')');\n\t\t\t\t\t\tfocusedEditor.trigger('keyboard', Handler.Paste, {\n\t\t\t\t\t\t\ttext: clipboardText,\n\t\t\t\t\t\t\tpasteOnNewLine,\n\t\t\t\t\t\t\tmulticursorText,\n\t\t\t\t\t\t\tmode\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. Paste: (default) handle case when focus is somewhere else.\n\tPasteAction.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation generic-dom for : paste)');\n\t\tconst triggerPaste = accessor.get(IClipboardService).triggerPaste(getActiveWindow().vscodeWindowId);\n\t\treturn triggerPaste ?? false;\n\t});\n}\n\nif (supportsCopy) {\n\tregisterEditorAction(ExecCommandCopyWithSyntaxHighlightingAction);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/clipboard/browser/clipboard.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAErF,OAAO,KAAK,QAAQ,MAAM,qCAAqC,CAAC;AAChE,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE,gCAAgC,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AAC5K,OAAO,EAAE,yBAAyB,EAAE,MAAM,6EAA6E,CAAC;AAExH,OAAO,EAAW,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACjH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD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CAAC,8CAA8C,CAAC,CAAC;oBACjE,OAAO,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,aAAa,EAAE,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACrF,CAAC,CAAC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACP,UAAU,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACtE,CAAC;YACD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACpB,UAAU,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACpE,gFAAgF;gBAChF,OAAO,qBAAqB,CAAC,aAAa,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;YAC3E,CAAC;YACD,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,gEAAgE;IAChE,WAAW,CAAC,iBAAiB,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,QAA0B,EAAE,IAAa,EAAE,EAAE;QAC7F,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7C,UAAU,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACxF,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC,cAAc,CAAC,CAAC;QACpG,OAAO,YAAY,IAAI,KAAK,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,IAAI,YAAY,EAAE,CAAC;IAClB,oBAAoB,CAAC,2CAA2C,CAAC,CAAC;AACnE,CAAC","file":"clipboard.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as browser from '../../../../base/browser/browser.js';\nimport { getActiveDocument, getActiveWindow } from '../../../../base/browser/dom.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport * as nls from '../../../../nls.js';\nimport { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nimport { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';\nimport { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { CopyOptions, generateDataToCopyAndStoreInMemory, InMemoryClipboardMetadataManager, PasteOptions } from '../../../browser/controller/editContext/clipboardUtils.js';\nimport { NativeEditContextRegistry } from '../../../browser/controller/editContext/native/nativeEditContextRegistry.js';\nimport { IActiveCodeEditor, ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Command, EditorAction, MultiCommand, registerEditorAction } from '../../../browser/editorExtensions.js';\nimport { ICodeEditorService } from '../../../browser/services/codeEditorService.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Handler } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { CopyPasteController } from '../../dropOrPasteInto/browser/copyPasteController.js';\n\nconst CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';\n\nconst supportsCut = (platform.isNative || document.queryCommandSupported('cut'));\nconst supportsCopy = (platform.isNative || document.queryCommandSupported('copy'));\n// Firefox only supports navigator.clipboard.readText() in browser extensions.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#Browser_compatibility\n// When loading over http, navigator.clipboard can be undefined. See https://github.com/microsoft/monaco-editor/issues/2313\nconst supportsPaste = (typeof navigator.clipboard === 'undefined' || browser.isFirefox) ? document.queryCommandSupported('paste') : true;\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport const CutAction = supportsCut ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCutAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind cut keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyX,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyX, secondary: [KeyMod.Shift | KeyCode.Delete] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCut', comment: ['&& denotes a mnemonic'] }, \"Cu&&t\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}]\n})) : undefined;\n\nexport const CopyAction = supportsCopy ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCopyAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind copy keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyC,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCopy', comment: ['&& denotes a mnemonic'] }, \"&&Copy\"),\n\t\torder: 2\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}]\n})) : undefined;\n\nMenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2('copy as', \"Copy As\"), group: '2_ccp', order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2('copy as', \"Copy As\"), group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1, when: ContextKeyExpr.and(ContextKeyExpr.notEquals('resourceScheme', 'output'), EditorContextKeys.editorTextFocus) });\nMenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1 });\n\nexport const PasteAction = supportsPaste ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardPasteAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind paste keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyV,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, \"&&Paste\"),\n\t\torder: 4\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}]\n})) : undefined;\n\nclass ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',\n\t\t\tlabel: nls.localize2('actions.clipboard.copyWithSyntaxHighlightingLabel', \"Copy with Syntax Highlighting\"),\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst logService = accessor.get(ILogService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction#run');\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptySelectionClipboard = editor.getOption(EditorOption.emptySelectionClipboard);\n\n\t\tif (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = true;\n\t\teditor.focus();\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)');\n\t\texecuteClipboardCopyWithWorkaround(editor, clipboardService);\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)');\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = false;\n\t}\n}\n\nfunction executeClipboardCopyWithWorkaround(editor: IActiveCodeEditor, clipboardService: IClipboardService) {\n\t// !!!!!\n\t// This is a workaround for what we think is an Electron bug where\n\t// execCommand('copy') does not always work (it does not fire a clipboard event)\n\t// We will use this as a signal that we have executed a copy command\n\t// !!!!!\n\tCopyOptions.electronBugWorkaroundCopyEventHasFired = false;\n\teditor.getContainerDomNode().ownerDocument.execCommand('copy');\n\tif (platform.isNative && CopyOptions.electronBugWorkaroundCopyEventHasFired === false) {\n\t\t// We have encountered the Electron bug!\n\t\t// As a workaround, we will write (only the plaintext data) to the clipboard in a different way\n\t\t// We will use the clipboard service (which in the native case will go to electron's clipboard API)\n\t\tconst { dataToCopy } = generateDataToCopyAndStoreInMemory(editor._getViewModel(), editor.getOptions(), undefined, browser.isFirefox);\n\t\tclipboardService.writeText(dataToCopy.text);\n\t}\n}\n\nasync function pasteWithNavigatorAPI(editor: IActiveCodeEditor, clipboardService: IClipboardService, logService: ILogService): Promise<void> {\n\tconst clipboardText = await clipboardService.readText();\n\tif (clipboardText !== '') {\n\t\tconst metadata = InMemoryClipboardMetadataManager.INSTANCE.get(clipboardText);\n\t\tlet pasteOnNewLine = false;\n\t\tlet multicursorText: string[] | null = null;\n\t\tlet mode: string | null = null;\n\t\tif (metadata) {\n\t\t\tpasteOnNewLine = (editor.getOption(EditorOption.emptySelectionClipboard) && !!metadata.isFromEmptySelection);\n\t\t\tmulticursorText = (typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null);\n\t\t\tmode = metadata.mode;\n\t\t}\n\t\tlogService.trace('pasteWithNavigatorAPI with id : ', metadata?.id, ', clipboardText.length : ', clipboardText.length);\n\t\teditor.trigger('keyboard', Handler.Paste, {\n\t\t\ttext: clipboardText,\n\t\t\tpasteOnNewLine,\n\t\t\tmulticursorText,\n\t\t\tmode\n\t\t});\n\t}\n}\n\nfunction registerExecCommandImpl(target: MultiCommand | undefined, browserCommand: 'cut' | 'copy'): void {\n\tif (!target) {\n\t\treturn;\n\t}\n\n\t// 1. handle case when focus is in editor.\n\ttarget.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation code-editor for : ', browserCommand, ')');\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasTextFocus() && focusedEditor.hasModel()) {\n\t\t\t// Do not execute if there is no selection and empty selection clipboard is off\n\t\t\tconst emptySelectionClipboard = focusedEditor.getOption(EditorOption.emptySelectionClipboard);\n\t\t\tconst selection = focusedEditor.getSelection();\n\t\t\tif (selection && selection.isEmpty() && !emptySelectionClipboard) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// TODO this is very ugly. The entire copy/paste/cut system needs a complete refactoring.\n\t\t\tif (focusedEditor.getOption(EditorOption.effectiveEditContext) && browserCommand === 'cut') {\n\t\t\t\tlogCopyCommand(focusedEditor);\n\t\t\t\t// execCommand(copy) works for edit context, but not execCommand(cut).\n\t\t\t\tlogService.trace('registerExecCommandImpl (before execCommand copy)');\n\t\t\t\texecuteClipboardCopyWithWorkaround(focusedEditor, clipboardService);\n\t\t\t\tfocusedEditor.trigger(undefined, Handler.Cut, undefined);\n\t\t\t\tlogService.trace('registerExecCommandImpl (after execCommand copy)');\n\t\t\t} else {\n\t\t\t\tlogCopyCommand(focusedEditor);\n\t\t\t\tlogService.trace('registerExecCommandImpl (before execCommand ' + browserCommand + ')');\n\t\t\t\tif (browserCommand === 'copy') {\n\t\t\t\t\texecuteClipboardCopyWithWorkaround(focusedEditor, clipboardService);\n\t\t\t\t} else {\n\t\t\t\t\tfocusedEditor.getContainerDomNode().ownerDocument.execCommand(browserCommand);\n\t\t\t\t}\n\t\t\t\tlogService.trace('registerExecCommandImpl (after execCommand ' + browserCommand + ')');\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. (default) handle case when focus is somewhere else.\n\ttarget.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation generic-dom for : ', browserCommand, ')');\n\t\tlogService.trace('registerExecCommandImpl (before execCommand ' + browserCommand + ')');\n\t\tgetActiveDocument().execCommand(browserCommand);\n\t\tlogService.trace('registerExecCommandImpl (after execCommand ' + browserCommand + ')');\n\t\treturn true;\n\t});\n}\n\nfunction logCopyCommand(editor: ICodeEditor) {\n\tconst editContextEnabled = editor.getOption(EditorOption.effectiveEditContext);\n\tif (editContextEnabled) {\n\t\tconst nativeEditContext = NativeEditContextRegistry.get(editor.getId());\n\t\tif (nativeEditContext) {\n\t\t\tnativeEditContext.onWillCopy();\n\t\t}\n\t}\n}\n\nregisterExecCommandImpl(CutAction, 'cut');\nregisterExecCommandImpl(CopyAction, 'copy');\n\nif (PasteAction) {\n\t// 1. Paste: handle case when focus is in editor.\n\tPasteAction.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation code-editor for : paste)');\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = codeEditorService.getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasModel() && focusedEditor.hasTextFocus()) {\n\t\t\t// execCommand(paste) does not work with edit context\n\t\t\tconst editContextEnabled = focusedEditor.getOption(EditorOption.effectiveEditContext);\n\t\t\tif (editContextEnabled) {\n\t\t\t\tconst nativeEditContext = NativeEditContextRegistry.get(focusedEditor.getId());\n\t\t\t\tif (nativeEditContext) {\n\t\t\t\t\tnativeEditContext.onWillPaste();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlogService.trace('registerExecCommandImpl (before triggerPaste)');\n\t\t\tPasteOptions.electronBugWorkaroundPasteEventHasFired = false;\n\t\t\tconst triggerPaste = clipboardService.triggerPaste(getActiveWindow().vscodeWindowId);\n\t\t\tif (triggerPaste) {\n\t\t\t\tlogService.trace('registerExecCommandImpl (triggerPaste defined)');\n\t\t\t\treturn triggerPaste.then(async () => {\n\t\t\t\t\tif (PasteOptions.electronBugWorkaroundPasteEventHasFired === false) {\n\t\t\t\t\t\treturn pasteWithNavigatorAPI(focusedEditor, clipboardService, logService);\n\t\t\t\t\t}\n\t\t\t\t\tlogService.trace('registerExecCommandImpl (after triggerPaste)');\n\t\t\t\t\treturn CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlogService.trace('registerExecCommandImpl (triggerPaste undefined)');\n\t\t\t}\n\t\t\tif (platform.isWeb) {\n\t\t\t\tlogService.trace('registerExecCommandImpl (Paste handling on web)');\n\t\t\t\t// Use the clipboard service if document.execCommand('paste') was not successful\n\t\t\t\treturn pasteWithNavigatorAPI(focusedEditor, clipboardService, logService);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. Paste: (default) handle case when focus is somewhere else.\n\tPasteAction.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation generic-dom for : paste)');\n\t\tconst triggerPaste = accessor.get(IClipboardService).triggerPaste(getActiveWindow().vscodeWindowId);\n\t\treturn triggerPaste ?? false;\n\t});\n}\n\nif (supportsCopy) {\n\tregisterEditorAction(ExecCommandCopyWithSyntaxHighlightingAction);\n}\n"]}
|
|
@@ -33,7 +33,7 @@ import { IInstantiationService } from '../../../../platform/instantiation/common
|
|
|
33
33
|
import { ILogService } from '../../../../platform/log/common/log.js';
|
|
34
34
|
import { IProgressService } from '../../../../platform/progress/common/progress.js';
|
|
35
35
|
import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js';
|
|
36
|
-
import { ClipboardEventUtils, InMemoryClipboardMetadataManager } from '../../../browser/controller/editContext/clipboardUtils.js';
|
|
36
|
+
import { ClipboardEventUtils, CopyOptions, InMemoryClipboardMetadataManager, PasteOptions } from '../../../browser/controller/editContext/clipboardUtils.js';
|
|
37
37
|
import { toExternalVSDataTransfer, toVSDataTransfer } from '../../../browser/dataTransfer.js';
|
|
38
38
|
import { IBulkEditService } from '../../../browser/services/bulkEditService.js';
|
|
39
39
|
import { Range } from '../../../common/core/range.js';
|
|
@@ -98,6 +98,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
98
98
|
await this._currentPasteOperation;
|
|
99
99
|
}
|
|
100
100
|
handleCopy(e) {
|
|
101
|
+
CopyOptions.electronBugWorkaroundCopyEventHasFired = true;
|
|
101
102
|
let id = null;
|
|
102
103
|
if (e.clipboardData) {
|
|
103
104
|
const [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);
|
|
@@ -109,6 +110,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
109
110
|
this._logService.trace('CopyPasteController#handleCopy');
|
|
110
111
|
}
|
|
111
112
|
if (!this._editor.hasTextFocus()) {
|
|
113
|
+
this._logService.trace('CopyPasteController#handleCopy/earlyReturn1');
|
|
112
114
|
return;
|
|
113
115
|
}
|
|
114
116
|
// Explicitly clear the clipboard internal state.
|
|
@@ -116,11 +118,13 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
116
118
|
// This means the resources clipboard is not properly updated when copying from the editor.
|
|
117
119
|
this._clipboardService.clearInternalState?.();
|
|
118
120
|
if (!e.clipboardData || !this.isPasteAsEnabled()) {
|
|
121
|
+
this._logService.trace('CopyPasteController#handleCopy/earlyReturn2');
|
|
119
122
|
return;
|
|
120
123
|
}
|
|
121
124
|
const model = this._editor.getModel();
|
|
122
125
|
const selections = this._editor.getSelections();
|
|
123
126
|
if (!model || !selections?.length) {
|
|
127
|
+
this._logService.trace('CopyPasteController#handleCopy/earlyReturn3');
|
|
124
128
|
return;
|
|
125
129
|
}
|
|
126
130
|
const enableEmptySelectionClipboard = this._editor.getOption(45 /* EditorOption.emptySelectionClipboard */);
|
|
@@ -128,6 +132,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
128
132
|
const wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty();
|
|
129
133
|
if (wasFromEmptySelection) {
|
|
130
134
|
if (!enableEmptySelectionClipboard) {
|
|
135
|
+
this._logService.trace('CopyPasteController#handleCopy/earlyReturn4');
|
|
131
136
|
return;
|
|
132
137
|
}
|
|
133
138
|
ranges = [new Range(ranges[0].startLineNumber, 1, ranges[0].startLineNumber, 1 + model.getLineLength(ranges[0].startLineNumber))];
|
|
@@ -144,6 +149,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
144
149
|
.filter(x => !!x.prepareDocumentPaste);
|
|
145
150
|
if (!providers.length) {
|
|
146
151
|
this.setCopyMetadata(e.clipboardData, { defaultPastePayload });
|
|
152
|
+
this._logService.trace('CopyPasteController#handleCopy/earlyReturn5');
|
|
147
153
|
return;
|
|
148
154
|
}
|
|
149
155
|
const dataTransfer = toVSDataTransfer(e.clipboardData);
|
|
@@ -167,8 +173,10 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
167
173
|
});
|
|
168
174
|
CopyPasteController_1._currentCopyOperation?.operations.forEach(entry => entry.operation.cancel());
|
|
169
175
|
CopyPasteController_1._currentCopyOperation = { handle, operations };
|
|
176
|
+
this._logService.trace('CopyPasteController#handleCopy/end');
|
|
170
177
|
}
|
|
171
178
|
async handlePaste(e) {
|
|
179
|
+
PasteOptions.electronBugWorkaroundPasteEventHasFired = true;
|
|
172
180
|
if (e.clipboardData) {
|
|
173
181
|
const [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);
|
|
174
182
|
const metadataComputed = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);
|
|
@@ -178,6 +186,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
178
186
|
this._logService.trace('CopyPasteController#handlePaste');
|
|
179
187
|
}
|
|
180
188
|
if (!e.clipboardData || !this._editor.hasTextFocus()) {
|
|
189
|
+
this._logService.trace('CopyPasteController#handlePaste/earlyReturn1');
|
|
181
190
|
return;
|
|
182
191
|
}
|
|
183
192
|
MessageController.get(this._editor)?.closeMessage();
|
|
@@ -186,11 +195,13 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
186
195
|
const model = this._editor.getModel();
|
|
187
196
|
const selections = this._editor.getSelections();
|
|
188
197
|
if (!selections?.length || !model) {
|
|
198
|
+
this._logService.trace('CopyPasteController#handlePaste/earlyReturn2');
|
|
189
199
|
return;
|
|
190
200
|
}
|
|
191
201
|
if (this._editor.getOption(104 /* EditorOption.readOnly */) // Never enabled if editor is readonly.
|
|
192
202
|
|| (!this.isPasteAsEnabled() && !this._pasteAsActionContext) // Or feature disabled (but still enable if paste was explicitly requested)
|
|
193
203
|
) {
|
|
204
|
+
this._logService.trace('CopyPasteController#handlePaste/earlyReturn3');
|
|
194
205
|
return;
|
|
195
206
|
}
|
|
196
207
|
const metadata = this.fetchCopyMetadata(e);
|
|
@@ -227,6 +238,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
227
238
|
e.preventDefault();
|
|
228
239
|
e.stopImmediatePropagation();
|
|
229
240
|
}
|
|
241
|
+
this._logService.trace('CopyPasteController#handlePaste/earlyReturn4');
|
|
230
242
|
return;
|
|
231
243
|
}
|
|
232
244
|
// Prevent the editor's default paste handler from running.
|
|
@@ -240,6 +252,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
240
252
|
else {
|
|
241
253
|
this.doPasteInline(allProviders, selections, dataTransfer, metadata, e);
|
|
242
254
|
}
|
|
255
|
+
this._logService.trace('CopyPasteController#handlePaste/end');
|
|
243
256
|
}
|
|
244
257
|
showPasteAsNoEditMessage(selections, preference) {
|
|
245
258
|
const kindLabel = 'only' in preference
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAqB,uBAAuB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACjI,OAAO,EAAqB,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AACrG,OAAO,EAAE,4BAA4B,EAA2B,eAAe,EAAE,OAAO,EAAkB,MAAM,yCAAyC,CAAC;AAC1J,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE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,MAAM,CAAC,CAAC;YACjD,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3E,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;gBACpB,OAAO,SAAS,CAAC;YAClB,CAAC;QACF,CAAC;QAED,OAAO,CAAC,CAAC;IACV,CAAC;;AAjnBW,mBAAmB;IAgC7B,WAAA,qBAAqB,CAAA;IACrB,WAAA,WAAW,CAAA;IACX,WAAA,gBAAgB,CAAA;IAChB,WAAA,iBAAiB,CAAA;IACjB,WAAA,eAAe,CAAA;IACf,WAAA,qBAAqB,CAAA;IACrB,WAAA,wBAAwB,CAAA;IACxB,WAAA,kBAAkB,CAAA;IAClB,WAAA,gBAAgB,CAAA;GAxCN,mBAAmB,CAknB/B","file":"copyPasteController.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { addDisposableListener } from '../../../../base/browser/dom.js';\nimport { IAction } from '../../../../base/common/actions.js';\nimport { coalesce } from '../../../../base/common/arrays.js';\nimport { CancelablePromise, createCancelablePromise, DeferredPromise, raceCancellation } from '../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { createStringDataTransferItem, IReadonlyVSDataTransfer, matchesMimeType, UriList, VSDataTransfer } from '../../../../base/common/dataTransfer.js';\nimport { isCancellationError } from '../../../../base/common/errors.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { Mimes } from '../../../../base/common/mime.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport { upcast } from '../../../../base/common/types.js';\nimport { generateUuid } from '../../../../base/common/uuid.js';\nimport { localize } from '../../../../nls.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { IProgressService, ProgressLocation } from '../../../../platform/progress/common/progress.js';\nimport { IQuickInputService, IQuickPickItem, IQuickPickSeparator } from '../../../../platform/quickinput/common/quickInput.js';\nimport { ClipboardEventUtils, InMemoryClipboardMetadataManager } from '../../../browser/controller/editContext/clipboardUtils.js';\nimport { toExternalVSDataTransfer, toVSDataTransfer } from '../../../browser/dataTransfer.js';\nimport { ICodeEditor, PastePayload } from '../../../browser/editorBrowser.js';\nimport { IBulkEditService } from '../../../browser/services/bulkEditService.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IRange, Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { Handler, IEditorContribution } from '../../../common/editorCommon.js';\nimport { DocumentPasteContext, DocumentPasteEdit, DocumentPasteEditProvider, DocumentPasteTriggerKind } from '../../../common/languages.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { CodeEditorStateFlag, EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js';\nimport { InlineProgressManager } from '../../inlineProgress/browser/inlineProgress.js';\nimport { MessageController } from '../../message/browser/messageController.js';\nimport { PreferredPasteConfiguration } from './copyPasteContribution.js';\nimport { DefaultTextPasteOrDropEditProvider } from './defaultProviders.js';\nimport { createCombinedWorkspaceEdit, sortEditsByYieldTo } from './edit.js';\nimport { PostEditWidgetManager } from './postEditWidget.js';\n\nexport const changePasteTypeCommandId = 'editor.changePasteType';\n\nexport const pasteAsPreferenceConfig = 'editor.pasteAs.preferences';\n\nexport const pasteWidgetVisibleCtx = new RawContextKey<boolean>('pasteWidgetVisible', false, localize('pasteWidgetVisible', \"Whether the paste widget is showing\"));\n\nconst vscodeClipboardMime = 'application/vnd.code.copymetadata';\n\ninterface CopyMetadata {\n\treadonly id?: string;\n\treadonly providerCopyMimeTypes?: readonly string[];\n\n\treadonly defaultPastePayload: Omit<PastePayload, 'text'>;\n}\n\ntype PasteEditWithProvider = DocumentPasteEdit & {\n\tprovider: DocumentPasteEditProvider;\n};\n\n\ninterface DocumentPasteWithProviderEditsSession {\n\tedits: readonly PasteEditWithProvider[];\n\tdispose(): void;\n}\n\nexport type PastePreference =\n\t| { readonly only: HierarchicalKind }\n\t| { readonly preferences: readonly HierarchicalKind[] }\n\t| { readonly providerId: string } // Only used internally\n\t;\n\ninterface CopyOperation {\n\treadonly providerMimeTypes: readonly string[];\n\treadonly operation: CancelablePromise<IReadonlyVSDataTransfer | undefined>;\n}\n\nexport class CopyPasteController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.copyPasteActionController';\n\n\tpublic static get(editor: ICodeEditor): CopyPasteController | null {\n\t\treturn editor.getContribution<CopyPasteController>(CopyPasteController.ID);\n\t}\n\n\tprivate static _configureDefaultAction?: IAction;\n\n\t/**\n\t * Global tracking the last copy operation.\n\t *\n\t * This is shared across all editors so that you can copy and paste between groups.\n\t *\n\t * TODO: figure out how to make this work with multiple windows\n\t */\n\tprivate static _currentCopyOperation?: {\n\t\treadonly handle: string;\n\t\treadonly operations: ReadonlyArray<CopyOperation>;\n\t};\n\n\tprivate readonly _editor: ICodeEditor;\n\n\tprivate _currentPasteOperation?: CancelablePromise<void>;\n\tprivate _pasteAsActionContext?: { readonly preferred?: PastePreference };\n\n\tprivate readonly _pasteProgressManager: InlineProgressManager;\n\tprivate readonly _postPasteWidgetManager: PostEditWidgetManager<PasteEditWithProvider>;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IBulkEditService private readonly _bulkEditService: IBulkEditService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IConfigurationService private readonly _configService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IQuickInputService private readonly _quickInputService: IQuickInputService,\n\t\t@IProgressService private readonly _progressService: IProgressService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\n\t\tconst container = editor.getContainerDomNode();\n\t\tthis._register(addDisposableListener(container, 'copy', e => this.handleCopy(e)));\n\t\tthis._register(addDisposableListener(container, 'cut', e => this.handleCopy(e)));\n\t\tthis._register(addDisposableListener(container, 'paste', e => this.handlePaste(e), true));\n\n\t\tthis._pasteProgressManager = this._register(new InlineProgressManager('pasteIntoEditor', editor, instantiationService));\n\n\t\tthis._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'pasteIntoEditor', editor, pasteWidgetVisibleCtx,\n\t\t\t{ id: changePasteTypeCommandId, label: localize('postPasteWidgetTitle', \"Show paste options...\") },\n\t\t\t() => CopyPasteController._configureDefaultAction ? [CopyPasteController._configureDefaultAction] : []\n\t\t));\n\t}\n\n\tpublic changePasteType() {\n\t\tthis._postPasteWidgetManager.tryShowSelector();\n\t}\n\n\tpublic async pasteAs(preferred?: PastePreference) {\n\t\tthis._logService.trace('CopyPasteController.pasteAs');\n\t\tthis._editor.focus();\n\t\ttry {\n\t\t\tthis._logService.trace('Before calling editor.action.clipboardPasteAction');\n\t\t\tthis._pasteAsActionContext = { preferred };\n\t\t\tawait this._commandService.executeCommand('editor.action.clipboardPasteAction');\n\t\t} finally {\n\t\t\tthis._pasteAsActionContext = undefined;\n\t\t}\n\t}\n\n\tpublic clearWidgets() {\n\t\tthis._postPasteWidgetManager.clear();\n\t}\n\n\tprivate isPasteAsEnabled(): boolean {\n\t\treturn this._editor.getOption(EditorOption.pasteAs).enabled;\n\t}\n\n\tpublic async finishedPaste(): Promise<void> {\n\t\tawait this._currentPasteOperation;\n\t}\n\n\tprivate handleCopy(e: ClipboardEvent) {\n\t\tlet id: string | null = null;\n\t\tif (e.clipboardData) {\n\t\t\tconst [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\t\t\tconst storedMetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\t\t\tid = storedMetadata?.id || null;\n\t\t\tthis._logService.trace('CopyPasteController#handleCopy for id : ', id, ' with text.length : ', text.length);\n\t\t} else {\n\t\t\tthis._logService.trace('CopyPasteController#handleCopy');\n\t\t}\n\t\tif (!this._editor.hasTextFocus()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Explicitly clear the clipboard internal state.\n\t\t// This is needed because on web, the browser clipboard is faked out using an in-memory store.\n\t\t// This means the resources clipboard is not properly updated when copying from the editor.\n\t\tthis._clipboardService.clearInternalState?.();\n\n\t\tif (!e.clipboardData || !this.isPasteAsEnabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst selections = this._editor.getSelections();\n\t\tif (!model || !selections?.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst enableEmptySelectionClipboard = this._editor.getOption(EditorOption.emptySelectionClipboard);\n\n\t\tlet ranges: readonly IRange[] = selections;\n\t\tconst wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty();\n\t\tif (wasFromEmptySelection) {\n\t\t\tif (!enableEmptySelectionClipboard) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tranges = [new Range(ranges[0].startLineNumber, 1, ranges[0].startLineNumber, 1 + model.getLineLength(ranges[0].startLineNumber))];\n\t\t}\n\n\t\tconst toCopy = this._editor._getViewModel()?.getPlainTextToCopy(selections, enableEmptySelectionClipboard, platform.isWindows);\n\t\tconst multicursorText = Array.isArray(toCopy) ? toCopy : null;\n\n\t\tconst defaultPastePayload = {\n\t\t\tmulticursorText,\n\t\t\tpasteOnNewLine: wasFromEmptySelection,\n\t\t\tmode: null\n\t\t};\n\n\t\tconst providers = this._languageFeaturesService.documentPasteEditProvider\n\t\t\t.ordered(model)\n\t\t\t.filter(x => !!x.prepareDocumentPaste);\n\t\tif (!providers.length) {\n\t\t\tthis.setCopyMetadata(e.clipboardData, { defaultPastePayload });\n\t\t\treturn;\n\t\t}\n\n\t\tconst dataTransfer = toVSDataTransfer(e.clipboardData);\n\t\tconst providerCopyMimeTypes = providers.flatMap(x => x.copyMimeTypes ?? []);\n\n\t\t// Save off a handle pointing to data that VS Code maintains.\n\t\tconst handle = id ?? generateUuid();\n\t\tthis.setCopyMetadata(e.clipboardData, {\n\t\t\tid: handle,\n\t\t\tproviderCopyMimeTypes,\n\t\t\tdefaultPastePayload\n\t\t});\n\n\t\tconst operations = providers.map((provider): CopyOperation => {\n\t\t\treturn {\n\t\t\t\tproviderMimeTypes: provider.copyMimeTypes,\n\t\t\t\toperation: createCancelablePromise(token =>\n\t\t\t\t\tprovider.prepareDocumentPaste!(model, ranges, dataTransfer, token)\n\t\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t}))\n\t\t\t};\n\t\t});\n\n\t\tCopyPasteController._currentCopyOperation?.operations.forEach(entry => entry.operation.cancel());\n\t\tCopyPasteController._currentCopyOperation = { handle, operations };\n\t}\n\n\tprivate async handlePaste(e: ClipboardEvent) {\n\t\tif (e.clipboardData) {\n\t\t\tconst [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\t\t\tconst metadataComputed = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\t\t\tthis._logService.trace('CopyPasteController#handlePaste for id : ', metadataComputed?.id);\n\t\t} else {\n\t\t\tthis._logService.trace('CopyPasteController#handlePaste');\n\t\t}\n\t\tif (!e.clipboardData || !this._editor.hasTextFocus()) {\n\t\t\treturn;\n\t\t}\n\n\t\tMessageController.get(this._editor)?.closeMessage();\n\t\tthis._currentPasteOperation?.cancel();\n\t\tthis._currentPasteOperation = undefined;\n\n\t\tconst model = this._editor.getModel();\n\t\tconst selections = this._editor.getSelections();\n\t\tif (!selections?.length || !model) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tthis._editor.getOption(EditorOption.readOnly) // Never enabled if editor is readonly.\n\t\t\t|| (!this.isPasteAsEnabled() && !this._pasteAsActionContext) // Or feature disabled (but still enable if paste was explicitly requested)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst metadata = this.fetchCopyMetadata(e);\n\t\tthis._logService.trace('CopyPasteController#handlePaste with metadata : ', metadata?.id, ' and text.length : ', e.clipboardData.getData('text/plain').length);\n\t\tconst dataTransfer = toExternalVSDataTransfer(e.clipboardData);\n\t\tdataTransfer.delete(vscodeClipboardMime);\n\n\t\tconst fileTypes = Array.from(e.clipboardData.files).map(file => file.type);\n\n\t\tconst allPotentialMimeTypes = [\n\t\t\t...e.clipboardData.types,\n\t\t\t...fileTypes,\n\t\t\t...metadata?.providerCopyMimeTypes ?? [],\n\t\t\t// TODO: always adds `uri-list` because this get set if there are resources in the system clipboard.\n\t\t\t// However we can only check the system clipboard async. For this early check, just add it in.\n\t\t\t// We filter providers again once we have the final dataTransfer we will use.\n\t\t\tMimes.uriList,\n\t\t];\n\n\t\tconst allProviders = this._languageFeaturesService.documentPasteEditProvider\n\t\t\t.ordered(model)\n\t\t\t.filter(provider => {\n\t\t\t\t// Filter out providers that don't match the requested paste types\n\t\t\t\tconst preference = this._pasteAsActionContext?.preferred;\n\t\t\t\tif (preference) {\n\t\t\t\t\tif (!this.providerMatchesPreference(provider, preference)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// And providers that don't handle any of mime types in the clipboard\n\t\t\t\treturn provider.pasteMimeTypes?.some(type => matchesMimeType(type, allPotentialMimeTypes));\n\t\t\t});\n\t\tif (!allProviders.length) {\n\t\t\tif (this._pasteAsActionContext?.preferred) {\n\t\t\t\tthis.showPasteAsNoEditMessage(selections, this._pasteAsActionContext.preferred);\n\n\t\t\t\t// Also prevent default paste from applying\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent the editor's default paste handler from running.\n\t\t// Note that after this point, we are fully responsible for handling paste.\n\t\t// If we can't provider a paste for any reason, we need to explicitly delegate pasting back to the editor.\n\t\te.preventDefault();\n\t\te.stopImmediatePropagation();\n\n\t\tif (this._pasteAsActionContext) {\n\t\t\tthis.showPasteAsPick(this._pasteAsActionContext.preferred, allProviders, selections, dataTransfer, metadata);\n\t\t} else {\n\t\t\tthis.doPasteInline(allProviders, selections, dataTransfer, metadata, e);\n\t\t}\n\t}\n\n\tprivate showPasteAsNoEditMessage(selections: readonly Selection[], preference: PastePreference) {\n\t\tconst kindLabel = 'only' in preference\n\t\t\t? preference.only.value\n\t\t\t: 'preferences' in preference\n\t\t\t\t? (preference.preferences.length ? preference.preferences.map(preference => preference.value).join(', ') : localize('noPreferences', \"empty\"))\n\t\t\t\t: preference.providerId;\n\n\t\tMessageController.get(this._editor)?.showMessage(localize('pasteAsError', \"No paste edits for '{0}' found\", kindLabel), selections[0].getStartPosition());\n\t}\n\n\tprivate doPasteInline(allProviders: readonly DocumentPasteEditProvider[], selections: readonly Selection[], dataTransfer: VSDataTransfer, metadata: CopyMetadata | undefined, clipboardEvent: ClipboardEvent): void {\n\t\tthis._logService.trace('CopyPasteController#doPasteInline');\n\t\tconst editor = this._editor;\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editorStateCts = new EditorStateCancellationTokenSource(editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection, undefined);\n\n\t\tconst p = createCancelablePromise(async (pToken) => {\n\t\t\tconst editor = this._editor;\n\t\t\tif (!editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = editor.getModel();\n\n\t\t\tconst disposables = new DisposableStore();\n\t\t\tconst cts = disposables.add(new CancellationTokenSource(pToken));\n\t\t\tdisposables.add(editorStateCts.token.onCancellationRequested(() => cts.cancel()));\n\n\t\t\tconst token = cts.token;\n\t\t\ttry {\n\t\t\t\tawait this.mergeInDataFromCopy(allProviders, dataTransfer, metadata, token);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst supportedProviders = allProviders.filter(provider => this.isSupportedPasteProvider(provider, dataTransfer));\n\t\t\t\tif (!supportedProviders.length\n\t\t\t\t\t|| (supportedProviders.length === 1 && supportedProviders[0] instanceof DefaultTextPasteOrDropEditProvider) // Only our default text provider is active\n\t\t\t\t) {\n\t\t\t\t\treturn this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent);\n\t\t\t\t}\n\n\t\t\t\tconst context: DocumentPasteContext = {\n\t\t\t\t\ttriggerKind: DocumentPasteTriggerKind.Automatic,\n\t\t\t\t};\n\n\t\t\t\tconst editSession = await this.getPasteEdits(supportedProviders, dataTransfer, model, selections, context, token);\n\t\t\t\tdisposables.add(editSession);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If the only edit returned is our default text edit, use the default paste handler\n\t\t\t\tif (editSession.edits.length === 1 && editSession.edits[0].provider instanceof DefaultTextPasteOrDropEditProvider) {\n\t\t\t\t\treturn this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent);\n\t\t\t\t}\n\n\t\t\t\tif (editSession.edits.length) {\n\t\t\t\t\tconst canShowWidget = editor.getOption(EditorOption.pasteAs).showPasteSelector === 'afterPaste';\n\t\t\t\t\treturn this._postPasteWidgetManager.applyEditAndShowIfNeeded(selections, { activeEditIndex: this.getInitialActiveEditIndex(model, editSession.edits), allEdits: editSession.edits }, canShowWidget, async (edit, resolveToken) => {\n\t\t\t\t\t\tif (!edit.provider.resolveDocumentPasteEdit) {\n\t\t\t\t\t\t\treturn edit;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst resolveP = edit.provider.resolveDocumentPasteEdit(edit, resolveToken);\n\t\t\t\t\t\tconst showP = new DeferredPromise<void>();\n\t\t\t\t\t\tconst resolved = await this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize('resolveProcess', \"Resolving paste edit for '{0}'. Click to cancel\", edit.title), raceCancellation(Promise.race([showP.p, resolveP]), resolveToken), {\n\t\t\t\t\t\t\tcancel: () => showP.cancel()\n\t\t\t\t\t\t}, 0);\n\n\t\t\t\t\t\tif (resolved) {\n\t\t\t\t\t\t\tedit.insertText = resolved.insertText;\n\t\t\t\t\t\t\tedit.additionalEdit = resolved.additionalEdit;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn edit;\n\t\t\t\t\t}, token);\n\t\t\t\t}\n\n\t\t\t\tawait this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent);\n\t\t\t} finally {\n\t\t\t\tdisposables.dispose();\n\t\t\t\tif (this._currentPasteOperation === p) {\n\t\t\t\t\tthis._currentPasteOperation = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize('pasteIntoEditorProgress', \"Running paste handlers. Click to cancel and do basic paste\"), p, {\n\t\t\tcancel: async () => {\n\t\t\t\tp.cancel();\n\t\t\t\tif (editorStateCts.token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tawait this.applyDefaultPasteHandler(dataTransfer, metadata, editorStateCts.token, clipboardEvent);\n\t\t\t}\n\t\t}).finally(() => {\n\t\t\teditorStateCts.dispose();\n\t\t});\n\t\tthis._currentPasteOperation = p;\n\t}\n\n\tprivate showPasteAsPick(preference: PastePreference | undefined, allProviders: readonly DocumentPasteEditProvider[], selections: readonly Selection[], dataTransfer: VSDataTransfer, metadata: CopyMetadata | undefined): void {\n\t\tthis._logService.trace('CopyPasteController#showPasteAsPick');\n\t\tconst p = createCancelablePromise(async (token) => {\n\t\t\tconst editor = this._editor;\n\t\t\tif (!editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = editor.getModel();\n\n\t\t\tconst disposables = new DisposableStore();\n\t\t\tconst tokenSource = disposables.add(new EditorStateCancellationTokenSource(editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection, undefined, token));\n\t\t\ttry {\n\t\t\t\tawait this.mergeInDataFromCopy(allProviders, dataTransfer, metadata, tokenSource.token);\n\t\t\t\tif (tokenSource.token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Filter out any providers the don't match the full data transfer we will send them.\n\t\t\t\tlet supportedProviders = allProviders.filter(provider => this.isSupportedPasteProvider(provider, dataTransfer, preference));\n\t\t\t\tif (preference) {\n\t\t\t\t\t// We are looking for a specific edit\n\t\t\t\t\tsupportedProviders = supportedProviders.filter(provider => this.providerMatchesPreference(provider, preference));\n\t\t\t\t}\n\n\t\t\t\tconst context: DocumentPasteContext = {\n\t\t\t\t\ttriggerKind: DocumentPasteTriggerKind.PasteAs,\n\t\t\t\t\tonly: preference && 'only' in preference ? preference.only : undefined,\n\t\t\t\t};\n\t\t\t\tlet editSession = disposables.add(await this.getPasteEdits(supportedProviders, dataTransfer, model, selections, context, tokenSource.token));\n\t\t\t\tif (tokenSource.token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Filter out any edits that don't match the requested kind\n\t\t\t\tif (preference) {\n\t\t\t\t\teditSession = {\n\t\t\t\t\t\tedits: editSession.edits.filter(edit => {\n\t\t\t\t\t\t\tif ('only' in preference) {\n\t\t\t\t\t\t\t\treturn preference.only.contains(edit.kind);\n\t\t\t\t\t\t\t} else if ('preferences' in preference) {\n\t\t\t\t\t\t\t\treturn preference.preferences.some(preference => preference.contains(edit.kind));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn preference.providerId === edit.provider.id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdispose: editSession.dispose\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (!editSession.edits.length) {\n\t\t\t\t\tif (preference) {\n\t\t\t\t\t\tthis.showPasteAsNoEditMessage(selections, preference);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet pickedEdit: DocumentPasteEdit | undefined;\n\t\t\t\tif (preference) {\n\t\t\t\t\tpickedEdit = editSession.edits.at(0);\n\t\t\t\t} else {\n\t\t\t\t\ttype ItemWithEdit = IQuickPickItem & { edit?: DocumentPasteEdit };\n\t\t\t\t\tconst configureDefaultItem: ItemWithEdit = {\n\t\t\t\t\t\tid: 'editor.pasteAs.default',\n\t\t\t\t\t\tlabel: localize('pasteAsDefault', \"Configure default paste action\"),\n\t\t\t\t\t\tedit: undefined,\n\t\t\t\t\t};\n\n\t\t\t\t\tconst selected = await this._quickInputService.pick<ItemWithEdit>(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...editSession.edits.map((edit): ItemWithEdit => ({\n\t\t\t\t\t\t\t\tlabel: edit.title,\n\t\t\t\t\t\t\t\tdescription: edit.kind?.value,\n\t\t\t\t\t\t\t\tedit,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t...(CopyPasteController._configureDefaultAction ? [\n\t\t\t\t\t\t\t\tupcast<IQuickPickSeparator>({ type: 'separator' }),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: CopyPasteController._configureDefaultAction.label,\n\t\t\t\t\t\t\t\t\tedit: undefined,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t] : [])\n\t\t\t\t\t\t], {\n\t\t\t\t\t\tplaceHolder: localize('pasteAsPickerPlaceholder', \"Select Paste Action\"),\n\t\t\t\t\t});\n\n\t\t\t\t\tif (selected === configureDefaultItem) {\n\t\t\t\t\t\tCopyPasteController._configureDefaultAction?.run();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tpickedEdit = selected?.edit;\n\t\t\t\t}\n\n\t\t\t\tif (!pickedEdit) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, selections, pickedEdit);\n\t\t\t\tawait this._bulkEditService.apply(combinedWorkspaceEdit, { editor: this._editor });\n\t\t\t} finally {\n\t\t\t\tdisposables.dispose();\n\t\t\t\tif (this._currentPasteOperation === p) {\n\t\t\t\t\tthis._currentPasteOperation = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis._progressService.withProgress({\n\t\t\tlocation: ProgressLocation.Window,\n\t\t\ttitle: localize('pasteAsProgress', \"Running paste handlers\"),\n\t\t}, () => p);\n\t}\n\n\tprivate setCopyMetadata(dataTransfer: DataTransfer, metadata: CopyMetadata) {\n\t\tthis._logService.trace('CopyPasteController#setCopyMetadata new id : ', metadata.id);\n\t\tdataTransfer.setData(vscodeClipboardMime, JSON.stringify(metadata));\n\t}\n\n\tprivate fetchCopyMetadata(e: ClipboardEvent): CopyMetadata | undefined {\n\t\tthis._logService.trace('CopyPasteController#fetchCopyMetadata');\n\t\tif (!e.clipboardData) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prefer using the clipboard data we saved off\n\t\tconst rawMetadata = e.clipboardData.getData(vscodeClipboardMime);\n\t\tif (rawMetadata) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(rawMetadata);\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Otherwise try to extract the generic text editor metadata\n\t\tconst [_, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\t\tif (metadata) {\n\t\t\treturn {\n\t\t\t\tdefaultPastePayload: {\n\t\t\t\t\tmode: metadata.mode,\n\t\t\t\t\tmulticursorText: metadata.multicursorText ?? null,\n\t\t\t\t\tpasteOnNewLine: !!metadata.isFromEmptySelection,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate async mergeInDataFromCopy(allProviders: readonly DocumentPasteEditProvider[], dataTransfer: VSDataTransfer, metadata: CopyMetadata | undefined, token: CancellationToken): Promise<void> {\n\t\tthis._logService.trace('CopyPasteController#mergeInDataFromCopy with metadata : ', metadata?.id);\n\t\tif (metadata?.id && CopyPasteController._currentCopyOperation?.handle === metadata.id) {\n\t\t\t// Only resolve providers that have data we may care about\n\t\t\tconst toResolve = CopyPasteController._currentCopyOperation.operations\n\t\t\t\t.filter(op => allProviders.some(provider => provider.pasteMimeTypes.some(type => matchesMimeType(type, op.providerMimeTypes))))\n\t\t\t\t.map(op => op.operation);\n\n\t\t\tconst toMergeResults = await Promise.all(toResolve);\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Values from higher priority providers should overwrite values from lower priority ones.\n\t\t\t// Reverse the array to so that the calls to `DataTransfer.replace` later will do this\n\t\t\tfor (const toMergeData of toMergeResults.reverse()) {\n\t\t\t\tif (toMergeData) {\n\t\t\t\t\tfor (const [key, value] of toMergeData) {\n\t\t\t\t\t\tdataTransfer.replace(key, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!dataTransfer.has(Mimes.uriList)) {\n\t\t\tconst resources = await this._clipboardService.readResources();\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resources.length) {\n\t\t\t\tdataTransfer.append(Mimes.uriList, createStringDataTransferItem(UriList.create(resources)));\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async getPasteEdits(providers: readonly DocumentPasteEditProvider[], dataTransfer: VSDataTransfer, model: ITextModel, selections: readonly Selection[], context: DocumentPasteContext, token: CancellationToken): Promise<DocumentPasteWithProviderEditsSession> {\n\t\tconst disposables = new DisposableStore();\n\n\t\tconst results = await raceCancellation(\n\t\t\tPromise.all(providers.map(async provider => {\n\t\t\t\ttry {\n\t\t\t\t\tconst edits = await provider.provideDocumentPasteEdits?.(model, selections, dataTransfer, context, token);\n\t\t\t\t\tif (edits) {\n\t\t\t\t\t\tdisposables.add(edits);\n\t\t\t\t\t}\n\t\t\t\t\treturn edits?.edits?.map(edit => ({ ...edit, provider }));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!isCancellationError(err)) {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t}\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t})),\n\t\t\ttoken);\n\t\tconst edits = coalesce(results ?? []).flat().filter(edit => {\n\t\t\treturn !context.only || context.only.contains(edit.kind);\n\t\t});\n\t\treturn {\n\t\t\tedits: sortEditsByYieldTo(edits),\n\t\t\tdispose: () => disposables.dispose()\n\t\t};\n\t}\n\n\tprivate async applyDefaultPasteHandler(dataTransfer: VSDataTransfer, metadata: CopyMetadata | undefined, token: CancellationToken, clipboardEvent: ClipboardEvent) {\n\t\tconst textDataTransfer = dataTransfer.get(Mimes.text) ?? dataTransfer.get('text');\n\t\tconst text = (await textDataTransfer?.asString()) ?? '';\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst payload: PastePayload = {\n\t\t\tclipboardEvent,\n\t\t\ttext,\n\t\t\tpasteOnNewLine: metadata?.defaultPastePayload.pasteOnNewLine ?? false,\n\t\t\tmulticursorText: metadata?.defaultPastePayload.multicursorText ?? null,\n\t\t\tmode: null,\n\t\t};\n\t\tthis._logService.trace('CopyPasteController#applyDefaultPasteHandler for id : ', metadata?.id);\n\t\tthis._editor.trigger('keyboard', Handler.Paste, payload);\n\t}\n\n\t/**\n\t * Filter out providers if they:\n\t * - Don't handle any of the data transfer types we have\n\t * - Don't match the preferred paste kind\n\t */\n\tprivate isSupportedPasteProvider(provider: DocumentPasteEditProvider, dataTransfer: VSDataTransfer, preference?: PastePreference): boolean {\n\t\tif (!provider.pasteMimeTypes?.some(type => dataTransfer.matches(type))) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !preference || this.providerMatchesPreference(provider, preference);\n\t}\n\n\tprivate providerMatchesPreference(provider: DocumentPasteEditProvider, preference: PastePreference): boolean {\n\t\tif ('only' in preference) {\n\t\t\treturn provider.providedPasteEditKinds.some(providedKind => preference.only.contains(providedKind));\n\t\t} else if ('preferences' in preference) {\n\t\t\treturn preference.preferences.some(providedKind => preference.preferences.some(preferredKind => preferredKind.contains(providedKind)));\n\t\t} else {\n\t\t\treturn provider.id === preference.providerId;\n\t\t}\n\t}\n\n\tprivate getInitialActiveEditIndex(model: ITextModel, edits: readonly DocumentPasteEdit[]): number {\n\t\tconst preferredProviders = this._configService.getValue<PreferredPasteConfiguration[]>(pasteAsPreferenceConfig, { resource: model.uri });\n\t\tfor (const config of Array.isArray(preferredProviders) ? preferredProviders : []) {\n\t\t\tconst desiredKind = new HierarchicalKind(config);\n\t\t\tconst editIndex = edits.findIndex(edit => desiredKind.contains(edit.kind));\n\t\t\tif (editIndex >= 0) {\n\t\t\t\treturn editIndex;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAqB,uBAAuB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACjI,OAAO,EAAqB,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AACrG,OAAO,EAAE,4BAA4B,EAA2B,eAAe,EAAE,OAAO,EAAkB,MAAM,yCAAyC,CAA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,WAAW,CAAA;IACX,WAAA,gBAAgB,CAAA;IAChB,WAAA,iBAAiB,CAAA;IACjB,WAAA,eAAe,CAAA;IACf,WAAA,qBAAqB,CAAA;IACrB,WAAA,wBAAwB,CAAA;IACxB,WAAA,kBAAkB,CAAA;IAClB,WAAA,gBAAgB,CAAA;GAxCN,mBAAmB,CA+nB/B","file":"copyPasteController.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { addDisposableListener } from '../../../../base/browser/dom.js';\nimport { IAction } from '../../../../base/common/actions.js';\nimport { coalesce } from '../../../../base/common/arrays.js';\nimport { CancelablePromise, createCancelablePromise, DeferredPromise, raceCancellation } from '../../../../base/common/async.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { createStringDataTransferItem, IReadonlyVSDataTransfer, matchesMimeType, UriList, VSDataTransfer } from '../../../../base/common/dataTransfer.js';\nimport { isCancellationError } from '../../../../base/common/errors.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { Mimes } from '../../../../base/common/mime.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport { upcast } from '../../../../base/common/types.js';\nimport { generateUuid } from '../../../../base/common/uuid.js';\nimport { localize } from '../../../../nls.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { IProgressService, ProgressLocation } from '../../../../platform/progress/common/progress.js';\nimport { IQuickInputService, IQuickPickItem, IQuickPickSeparator } from '../../../../platform/quickinput/common/quickInput.js';\nimport { ClipboardEventUtils, CopyOptions, InMemoryClipboardMetadataManager, PasteOptions } from '../../../browser/controller/editContext/clipboardUtils.js';\nimport { toExternalVSDataTransfer, toVSDataTransfer } from '../../../browser/dataTransfer.js';\nimport { ICodeEditor, PastePayload } from '../../../browser/editorBrowser.js';\nimport { IBulkEditService } from '../../../browser/services/bulkEditService.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IRange, Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { Handler, IEditorContribution } from '../../../common/editorCommon.js';\nimport { DocumentPasteContext, DocumentPasteEdit, DocumentPasteEditProvider, DocumentPasteTriggerKind } from '../../../common/languages.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { CodeEditorStateFlag, EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js';\nimport { InlineProgressManager } from '../../inlineProgress/browser/inlineProgress.js';\nimport { MessageController } from '../../message/browser/messageController.js';\nimport { PreferredPasteConfiguration } from './copyPasteContribution.js';\nimport { DefaultTextPasteOrDropEditProvider } from './defaultProviders.js';\nimport { createCombinedWorkspaceEdit, sortEditsByYieldTo } from './edit.js';\nimport { PostEditWidgetManager } from './postEditWidget.js';\n\nexport const changePasteTypeCommandId = 'editor.changePasteType';\n\nexport const pasteAsPreferenceConfig = 'editor.pasteAs.preferences';\n\nexport const pasteWidgetVisibleCtx = new RawContextKey<boolean>('pasteWidgetVisible', false, localize('pasteWidgetVisible', \"Whether the paste widget is showing\"));\n\nconst vscodeClipboardMime = 'application/vnd.code.copymetadata';\n\ninterface CopyMetadata {\n\treadonly id?: string;\n\treadonly providerCopyMimeTypes?: readonly string[];\n\n\treadonly defaultPastePayload: Omit<PastePayload, 'text'>;\n}\n\ntype PasteEditWithProvider = DocumentPasteEdit & {\n\tprovider: DocumentPasteEditProvider;\n};\n\n\ninterface DocumentPasteWithProviderEditsSession {\n\tedits: readonly PasteEditWithProvider[];\n\tdispose(): void;\n}\n\nexport type PastePreference =\n\t| { readonly only: HierarchicalKind }\n\t| { readonly preferences: readonly HierarchicalKind[] }\n\t| { readonly providerId: string } // Only used internally\n\t;\n\ninterface CopyOperation {\n\treadonly providerMimeTypes: readonly string[];\n\treadonly operation: CancelablePromise<IReadonlyVSDataTransfer | undefined>;\n}\n\nexport class CopyPasteController extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID = 'editor.contrib.copyPasteActionController';\n\n\tpublic static get(editor: ICodeEditor): CopyPasteController | null {\n\t\treturn editor.getContribution<CopyPasteController>(CopyPasteController.ID);\n\t}\n\n\tprivate static _configureDefaultAction?: IAction;\n\n\t/**\n\t * Global tracking the last copy operation.\n\t *\n\t * This is shared across all editors so that you can copy and paste between groups.\n\t *\n\t * TODO: figure out how to make this work with multiple windows\n\t */\n\tprivate static _currentCopyOperation?: {\n\t\treadonly handle: string;\n\t\treadonly operations: ReadonlyArray<CopyOperation>;\n\t};\n\n\tprivate readonly _editor: ICodeEditor;\n\n\tprivate _currentPasteOperation?: CancelablePromise<void>;\n\tprivate _pasteAsActionContext?: { readonly preferred?: PastePreference };\n\n\tprivate readonly _pasteProgressManager: InlineProgressManager;\n\tprivate readonly _postPasteWidgetManager: PostEditWidgetManager<PasteEditWithProvider>;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IBulkEditService private readonly _bulkEditService: IBulkEditService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IConfigurationService private readonly _configService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IQuickInputService private readonly _quickInputService: IQuickInputService,\n\t\t@IProgressService private readonly _progressService: IProgressService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\n\t\tconst container = editor.getContainerDomNode();\n\t\tthis._register(addDisposableListener(container, 'copy', e => this.handleCopy(e)));\n\t\tthis._register(addDisposableListener(container, 'cut', e => this.handleCopy(e)));\n\t\tthis._register(addDisposableListener(container, 'paste', e => this.handlePaste(e), true));\n\n\t\tthis._pasteProgressManager = this._register(new InlineProgressManager('pasteIntoEditor', editor, instantiationService));\n\n\t\tthis._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'pasteIntoEditor', editor, pasteWidgetVisibleCtx,\n\t\t\t{ id: changePasteTypeCommandId, label: localize('postPasteWidgetTitle', \"Show paste options...\") },\n\t\t\t() => CopyPasteController._configureDefaultAction ? [CopyPasteController._configureDefaultAction] : []\n\t\t));\n\t}\n\n\tpublic changePasteType() {\n\t\tthis._postPasteWidgetManager.tryShowSelector();\n\t}\n\n\tpublic async pasteAs(preferred?: PastePreference) {\n\t\tthis._logService.trace('CopyPasteController.pasteAs');\n\t\tthis._editor.focus();\n\t\ttry {\n\t\t\tthis._logService.trace('Before calling editor.action.clipboardPasteAction');\n\t\t\tthis._pasteAsActionContext = { preferred };\n\t\t\tawait this._commandService.executeCommand('editor.action.clipboardPasteAction');\n\t\t} finally {\n\t\t\tthis._pasteAsActionContext = undefined;\n\t\t}\n\t}\n\n\tpublic clearWidgets() {\n\t\tthis._postPasteWidgetManager.clear();\n\t}\n\n\tprivate isPasteAsEnabled(): boolean {\n\t\treturn this._editor.getOption(EditorOption.pasteAs).enabled;\n\t}\n\n\tpublic async finishedPaste(): Promise<void> {\n\t\tawait this._currentPasteOperation;\n\t}\n\n\tprivate handleCopy(e: ClipboardEvent) {\n\t\tCopyOptions.electronBugWorkaroundCopyEventHasFired = true;\n\t\tlet id: string | null = null;\n\t\tif (e.clipboardData) {\n\t\t\tconst [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\t\t\tconst storedMetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\t\t\tid = storedMetadata?.id || null;\n\t\t\tthis._logService.trace('CopyPasteController#handleCopy for id : ', id, ' with text.length : ', text.length);\n\t\t} else {\n\t\t\tthis._logService.trace('CopyPasteController#handleCopy');\n\t\t}\n\t\tif (!this._editor.hasTextFocus()) {\n\t\t\tthis._logService.trace('CopyPasteController#handleCopy/earlyReturn1');\n\t\t\treturn;\n\t\t}\n\n\t\t// Explicitly clear the clipboard internal state.\n\t\t// This is needed because on web, the browser clipboard is faked out using an in-memory store.\n\t\t// This means the resources clipboard is not properly updated when copying from the editor.\n\t\tthis._clipboardService.clearInternalState?.();\n\n\t\tif (!e.clipboardData || !this.isPasteAsEnabled()) {\n\t\t\tthis._logService.trace('CopyPasteController#handleCopy/earlyReturn2');\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst selections = this._editor.getSelections();\n\t\tif (!model || !selections?.length) {\n\t\t\tthis._logService.trace('CopyPasteController#handleCopy/earlyReturn3');\n\t\t\treturn;\n\t\t}\n\n\t\tconst enableEmptySelectionClipboard = this._editor.getOption(EditorOption.emptySelectionClipboard);\n\n\t\tlet ranges: readonly IRange[] = selections;\n\t\tconst wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty();\n\t\tif (wasFromEmptySelection) {\n\t\t\tif (!enableEmptySelectionClipboard) {\n\t\t\t\tthis._logService.trace('CopyPasteController#handleCopy/earlyReturn4');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tranges = [new Range(ranges[0].startLineNumber, 1, ranges[0].startLineNumber, 1 + model.getLineLength(ranges[0].startLineNumber))];\n\t\t}\n\n\t\tconst toCopy = this._editor._getViewModel()?.getPlainTextToCopy(selections, enableEmptySelectionClipboard, platform.isWindows);\n\t\tconst multicursorText = Array.isArray(toCopy) ? toCopy : null;\n\n\t\tconst defaultPastePayload = {\n\t\t\tmulticursorText,\n\t\t\tpasteOnNewLine: wasFromEmptySelection,\n\t\t\tmode: null\n\t\t};\n\n\t\tconst providers = this._languageFeaturesService.documentPasteEditProvider\n\t\t\t.ordered(model)\n\t\t\t.filter(x => !!x.prepareDocumentPaste);\n\t\tif (!providers.length) {\n\t\t\tthis.setCopyMetadata(e.clipboardData, { defaultPastePayload });\n\t\t\tthis._logService.trace('CopyPasteController#handleCopy/earlyReturn5');\n\t\t\treturn;\n\t\t}\n\n\t\tconst dataTransfer = toVSDataTransfer(e.clipboardData);\n\t\tconst providerCopyMimeTypes = providers.flatMap(x => x.copyMimeTypes ?? []);\n\n\t\t// Save off a handle pointing to data that VS Code maintains.\n\t\tconst handle = id ?? generateUuid();\n\t\tthis.setCopyMetadata(e.clipboardData, {\n\t\t\tid: handle,\n\t\t\tproviderCopyMimeTypes,\n\t\t\tdefaultPastePayload\n\t\t});\n\n\t\tconst operations = providers.map((provider): CopyOperation => {\n\t\t\treturn {\n\t\t\t\tproviderMimeTypes: provider.copyMimeTypes,\n\t\t\t\toperation: createCancelablePromise(token =>\n\t\t\t\t\tprovider.prepareDocumentPaste!(model, ranges, dataTransfer, token)\n\t\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t}))\n\t\t\t};\n\t\t});\n\n\t\tCopyPasteController._currentCopyOperation?.operations.forEach(entry => entry.operation.cancel());\n\t\tCopyPasteController._currentCopyOperation = { handle, operations };\n\t\tthis._logService.trace('CopyPasteController#handleCopy/end');\n\t}\n\n\tprivate async handlePaste(e: ClipboardEvent) {\n\t\tPasteOptions.electronBugWorkaroundPasteEventHasFired = true;\n\t\tif (e.clipboardData) {\n\t\t\tconst [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\t\t\tconst metadataComputed = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\t\t\tthis._logService.trace('CopyPasteController#handlePaste for id : ', metadataComputed?.id);\n\t\t} else {\n\t\t\tthis._logService.trace('CopyPasteController#handlePaste');\n\t\t}\n\t\tif (!e.clipboardData || !this._editor.hasTextFocus()) {\n\t\t\tthis._logService.trace('CopyPasteController#handlePaste/earlyReturn1');\n\t\t\treturn;\n\t\t}\n\n\t\tMessageController.get(this._editor)?.closeMessage();\n\t\tthis._currentPasteOperation?.cancel();\n\t\tthis._currentPasteOperation = undefined;\n\n\t\tconst model = this._editor.getModel();\n\t\tconst selections = this._editor.getSelections();\n\t\tif (!selections?.length || !model) {\n\t\t\tthis._logService.trace('CopyPasteController#handlePaste/earlyReturn2');\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tthis._editor.getOption(EditorOption.readOnly) // Never enabled if editor is readonly.\n\t\t\t|| (!this.isPasteAsEnabled() && !this._pasteAsActionContext) // Or feature disabled (but still enable if paste was explicitly requested)\n\t\t) {\n\t\t\tthis._logService.trace('CopyPasteController#handlePaste/earlyReturn3');\n\t\t\treturn;\n\t\t}\n\n\t\tconst metadata = this.fetchCopyMetadata(e);\n\t\tthis._logService.trace('CopyPasteController#handlePaste with metadata : ', metadata?.id, ' and text.length : ', e.clipboardData.getData('text/plain').length);\n\t\tconst dataTransfer = toExternalVSDataTransfer(e.clipboardData);\n\t\tdataTransfer.delete(vscodeClipboardMime);\n\n\t\tconst fileTypes = Array.from(e.clipboardData.files).map(file => file.type);\n\n\t\tconst allPotentialMimeTypes = [\n\t\t\t...e.clipboardData.types,\n\t\t\t...fileTypes,\n\t\t\t...metadata?.providerCopyMimeTypes ?? [],\n\t\t\t// TODO: always adds `uri-list` because this get set if there are resources in the system clipboard.\n\t\t\t// However we can only check the system clipboard async. For this early check, just add it in.\n\t\t\t// We filter providers again once we have the final dataTransfer we will use.\n\t\t\tMimes.uriList,\n\t\t];\n\n\t\tconst allProviders = this._languageFeaturesService.documentPasteEditProvider\n\t\t\t.ordered(model)\n\t\t\t.filter(provider => {\n\t\t\t\t// Filter out providers that don't match the requested paste types\n\t\t\t\tconst preference = this._pasteAsActionContext?.preferred;\n\t\t\t\tif (preference) {\n\t\t\t\t\tif (!this.providerMatchesPreference(provider, preference)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// And providers that don't handle any of mime types in the clipboard\n\t\t\t\treturn provider.pasteMimeTypes?.some(type => matchesMimeType(type, allPotentialMimeTypes));\n\t\t\t});\n\t\tif (!allProviders.length) {\n\t\t\tif (this._pasteAsActionContext?.preferred) {\n\t\t\t\tthis.showPasteAsNoEditMessage(selections, this._pasteAsActionContext.preferred);\n\n\t\t\t\t// Also prevent default paste from applying\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t}\n\t\t\tthis._logService.trace('CopyPasteController#handlePaste/earlyReturn4');\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent the editor's default paste handler from running.\n\t\t// Note that after this point, we are fully responsible for handling paste.\n\t\t// If we can't provider a paste for any reason, we need to explicitly delegate pasting back to the editor.\n\t\te.preventDefault();\n\t\te.stopImmediatePropagation();\n\n\t\tif (this._pasteAsActionContext) {\n\t\t\tthis.showPasteAsPick(this._pasteAsActionContext.preferred, allProviders, selections, dataTransfer, metadata);\n\t\t} else {\n\t\t\tthis.doPasteInline(allProviders, selections, dataTransfer, metadata, e);\n\t\t}\n\t\tthis._logService.trace('CopyPasteController#handlePaste/end');\n\t}\n\n\tprivate showPasteAsNoEditMessage(selections: readonly Selection[], preference: PastePreference) {\n\t\tconst kindLabel = 'only' in preference\n\t\t\t? preference.only.value\n\t\t\t: 'preferences' in preference\n\t\t\t\t? (preference.preferences.length ? preference.preferences.map(preference => preference.value).join(', ') : localize('noPreferences', \"empty\"))\n\t\t\t\t: preference.providerId;\n\n\t\tMessageController.get(this._editor)?.showMessage(localize('pasteAsError', \"No paste edits for '{0}' found\", kindLabel), selections[0].getStartPosition());\n\t}\n\n\tprivate doPasteInline(allProviders: readonly DocumentPasteEditProvider[], selections: readonly Selection[], dataTransfer: VSDataTransfer, metadata: CopyMetadata | undefined, clipboardEvent: ClipboardEvent): void {\n\t\tthis._logService.trace('CopyPasteController#doPasteInline');\n\t\tconst editor = this._editor;\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editorStateCts = new EditorStateCancellationTokenSource(editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection, undefined);\n\n\t\tconst p = createCancelablePromise(async (pToken) => {\n\t\t\tconst editor = this._editor;\n\t\t\tif (!editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = editor.getModel();\n\n\t\t\tconst disposables = new DisposableStore();\n\t\t\tconst cts = disposables.add(new CancellationTokenSource(pToken));\n\t\t\tdisposables.add(editorStateCts.token.onCancellationRequested(() => cts.cancel()));\n\n\t\t\tconst token = cts.token;\n\t\t\ttry {\n\t\t\t\tawait this.mergeInDataFromCopy(allProviders, dataTransfer, metadata, token);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst supportedProviders = allProviders.filter(provider => this.isSupportedPasteProvider(provider, dataTransfer));\n\t\t\t\tif (!supportedProviders.length\n\t\t\t\t\t|| (supportedProviders.length === 1 && supportedProviders[0] instanceof DefaultTextPasteOrDropEditProvider) // Only our default text provider is active\n\t\t\t\t) {\n\t\t\t\t\treturn this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent);\n\t\t\t\t}\n\n\t\t\t\tconst context: DocumentPasteContext = {\n\t\t\t\t\ttriggerKind: DocumentPasteTriggerKind.Automatic,\n\t\t\t\t};\n\n\t\t\t\tconst editSession = await this.getPasteEdits(supportedProviders, dataTransfer, model, selections, context, token);\n\t\t\t\tdisposables.add(editSession);\n\t\t\t\tif (token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If the only edit returned is our default text edit, use the default paste handler\n\t\t\t\tif (editSession.edits.length === 1 && editSession.edits[0].provider instanceof DefaultTextPasteOrDropEditProvider) {\n\t\t\t\t\treturn this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent);\n\t\t\t\t}\n\n\t\t\t\tif (editSession.edits.length) {\n\t\t\t\t\tconst canShowWidget = editor.getOption(EditorOption.pasteAs).showPasteSelector === 'afterPaste';\n\t\t\t\t\treturn this._postPasteWidgetManager.applyEditAndShowIfNeeded(selections, { activeEditIndex: this.getInitialActiveEditIndex(model, editSession.edits), allEdits: editSession.edits }, canShowWidget, async (edit, resolveToken) => {\n\t\t\t\t\t\tif (!edit.provider.resolveDocumentPasteEdit) {\n\t\t\t\t\t\t\treturn edit;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst resolveP = edit.provider.resolveDocumentPasteEdit(edit, resolveToken);\n\t\t\t\t\t\tconst showP = new DeferredPromise<void>();\n\t\t\t\t\t\tconst resolved = await this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize('resolveProcess', \"Resolving paste edit for '{0}'. Click to cancel\", edit.title), raceCancellation(Promise.race([showP.p, resolveP]), resolveToken), {\n\t\t\t\t\t\t\tcancel: () => showP.cancel()\n\t\t\t\t\t\t}, 0);\n\n\t\t\t\t\t\tif (resolved) {\n\t\t\t\t\t\t\tedit.insertText = resolved.insertText;\n\t\t\t\t\t\t\tedit.additionalEdit = resolved.additionalEdit;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn edit;\n\t\t\t\t\t}, token);\n\t\t\t\t}\n\n\t\t\t\tawait this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent);\n\t\t\t} finally {\n\t\t\t\tdisposables.dispose();\n\t\t\t\tif (this._currentPasteOperation === p) {\n\t\t\t\t\tthis._currentPasteOperation = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize('pasteIntoEditorProgress', \"Running paste handlers. Click to cancel and do basic paste\"), p, {\n\t\t\tcancel: async () => {\n\t\t\t\tp.cancel();\n\t\t\t\tif (editorStateCts.token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tawait this.applyDefaultPasteHandler(dataTransfer, metadata, editorStateCts.token, clipboardEvent);\n\t\t\t}\n\t\t}).finally(() => {\n\t\t\teditorStateCts.dispose();\n\t\t});\n\t\tthis._currentPasteOperation = p;\n\t}\n\n\tprivate showPasteAsPick(preference: PastePreference | undefined, allProviders: readonly DocumentPasteEditProvider[], selections: readonly Selection[], dataTransfer: VSDataTransfer, metadata: CopyMetadata | undefined): void {\n\t\tthis._logService.trace('CopyPasteController#showPasteAsPick');\n\t\tconst p = createCancelablePromise(async (token) => {\n\t\t\tconst editor = this._editor;\n\t\t\tif (!editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst model = editor.getModel();\n\n\t\t\tconst disposables = new DisposableStore();\n\t\t\tconst tokenSource = disposables.add(new EditorStateCancellationTokenSource(editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection, undefined, token));\n\t\t\ttry {\n\t\t\t\tawait this.mergeInDataFromCopy(allProviders, dataTransfer, metadata, tokenSource.token);\n\t\t\t\tif (tokenSource.token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Filter out any providers the don't match the full data transfer we will send them.\n\t\t\t\tlet supportedProviders = allProviders.filter(provider => this.isSupportedPasteProvider(provider, dataTransfer, preference));\n\t\t\t\tif (preference) {\n\t\t\t\t\t// We are looking for a specific edit\n\t\t\t\t\tsupportedProviders = supportedProviders.filter(provider => this.providerMatchesPreference(provider, preference));\n\t\t\t\t}\n\n\t\t\t\tconst context: DocumentPasteContext = {\n\t\t\t\t\ttriggerKind: DocumentPasteTriggerKind.PasteAs,\n\t\t\t\t\tonly: preference && 'only' in preference ? preference.only : undefined,\n\t\t\t\t};\n\t\t\t\tlet editSession = disposables.add(await this.getPasteEdits(supportedProviders, dataTransfer, model, selections, context, tokenSource.token));\n\t\t\t\tif (tokenSource.token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Filter out any edits that don't match the requested kind\n\t\t\t\tif (preference) {\n\t\t\t\t\teditSession = {\n\t\t\t\t\t\tedits: editSession.edits.filter(edit => {\n\t\t\t\t\t\t\tif ('only' in preference) {\n\t\t\t\t\t\t\t\treturn preference.only.contains(edit.kind);\n\t\t\t\t\t\t\t} else if ('preferences' in preference) {\n\t\t\t\t\t\t\t\treturn preference.preferences.some(preference => preference.contains(edit.kind));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn preference.providerId === edit.provider.id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdispose: editSession.dispose\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (!editSession.edits.length) {\n\t\t\t\t\tif (preference) {\n\t\t\t\t\t\tthis.showPasteAsNoEditMessage(selections, preference);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet pickedEdit: DocumentPasteEdit | undefined;\n\t\t\t\tif (preference) {\n\t\t\t\t\tpickedEdit = editSession.edits.at(0);\n\t\t\t\t} else {\n\t\t\t\t\ttype ItemWithEdit = IQuickPickItem & { edit?: DocumentPasteEdit };\n\t\t\t\t\tconst configureDefaultItem: ItemWithEdit = {\n\t\t\t\t\t\tid: 'editor.pasteAs.default',\n\t\t\t\t\t\tlabel: localize('pasteAsDefault', \"Configure default paste action\"),\n\t\t\t\t\t\tedit: undefined,\n\t\t\t\t\t};\n\n\t\t\t\t\tconst selected = await this._quickInputService.pick<ItemWithEdit>(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...editSession.edits.map((edit): ItemWithEdit => ({\n\t\t\t\t\t\t\t\tlabel: edit.title,\n\t\t\t\t\t\t\t\tdescription: edit.kind?.value,\n\t\t\t\t\t\t\t\tedit,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t...(CopyPasteController._configureDefaultAction ? [\n\t\t\t\t\t\t\t\tupcast<IQuickPickSeparator>({ type: 'separator' }),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: CopyPasteController._configureDefaultAction.label,\n\t\t\t\t\t\t\t\t\tedit: undefined,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t] : [])\n\t\t\t\t\t\t], {\n\t\t\t\t\t\tplaceHolder: localize('pasteAsPickerPlaceholder', \"Select Paste Action\"),\n\t\t\t\t\t});\n\n\t\t\t\t\tif (selected === configureDefaultItem) {\n\t\t\t\t\t\tCopyPasteController._configureDefaultAction?.run();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tpickedEdit = selected?.edit;\n\t\t\t\t}\n\n\t\t\t\tif (!pickedEdit) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, selections, pickedEdit);\n\t\t\t\tawait this._bulkEditService.apply(combinedWorkspaceEdit, { editor: this._editor });\n\t\t\t} finally {\n\t\t\t\tdisposables.dispose();\n\t\t\t\tif (this._currentPasteOperation === p) {\n\t\t\t\t\tthis._currentPasteOperation = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis._progressService.withProgress({\n\t\t\tlocation: ProgressLocation.Window,\n\t\t\ttitle: localize('pasteAsProgress', \"Running paste handlers\"),\n\t\t}, () => p);\n\t}\n\n\tprivate setCopyMetadata(dataTransfer: DataTransfer, metadata: CopyMetadata) {\n\t\tthis._logService.trace('CopyPasteController#setCopyMetadata new id : ', metadata.id);\n\t\tdataTransfer.setData(vscodeClipboardMime, JSON.stringify(metadata));\n\t}\n\n\tprivate fetchCopyMetadata(e: ClipboardEvent): CopyMetadata | undefined {\n\t\tthis._logService.trace('CopyPasteController#fetchCopyMetadata');\n\t\tif (!e.clipboardData) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prefer using the clipboard data we saved off\n\t\tconst rawMetadata = e.clipboardData.getData(vscodeClipboardMime);\n\t\tif (rawMetadata) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(rawMetadata);\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Otherwise try to extract the generic text editor metadata\n\t\tconst [_, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\t\tif (metadata) {\n\t\t\treturn {\n\t\t\t\tdefaultPastePayload: {\n\t\t\t\t\tmode: metadata.mode,\n\t\t\t\t\tmulticursorText: metadata.multicursorText ?? null,\n\t\t\t\t\tpasteOnNewLine: !!metadata.isFromEmptySelection,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate async mergeInDataFromCopy(allProviders: readonly DocumentPasteEditProvider[], dataTransfer: VSDataTransfer, metadata: CopyMetadata | undefined, token: CancellationToken): Promise<void> {\n\t\tthis._logService.trace('CopyPasteController#mergeInDataFromCopy with metadata : ', metadata?.id);\n\t\tif (metadata?.id && CopyPasteController._currentCopyOperation?.handle === metadata.id) {\n\t\t\t// Only resolve providers that have data we may care about\n\t\t\tconst toResolve = CopyPasteController._currentCopyOperation.operations\n\t\t\t\t.filter(op => allProviders.some(provider => provider.pasteMimeTypes.some(type => matchesMimeType(type, op.providerMimeTypes))))\n\t\t\t\t.map(op => op.operation);\n\n\t\t\tconst toMergeResults = await Promise.all(toResolve);\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Values from higher priority providers should overwrite values from lower priority ones.\n\t\t\t// Reverse the array to so that the calls to `DataTransfer.replace` later will do this\n\t\t\tfor (const toMergeData of toMergeResults.reverse()) {\n\t\t\t\tif (toMergeData) {\n\t\t\t\t\tfor (const [key, value] of toMergeData) {\n\t\t\t\t\t\tdataTransfer.replace(key, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!dataTransfer.has(Mimes.uriList)) {\n\t\t\tconst resources = await this._clipboardService.readResources();\n\t\t\tif (token.isCancellationRequested) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resources.length) {\n\t\t\t\tdataTransfer.append(Mimes.uriList, createStringDataTransferItem(UriList.create(resources)));\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async getPasteEdits(providers: readonly DocumentPasteEditProvider[], dataTransfer: VSDataTransfer, model: ITextModel, selections: readonly Selection[], context: DocumentPasteContext, token: CancellationToken): Promise<DocumentPasteWithProviderEditsSession> {\n\t\tconst disposables = new DisposableStore();\n\n\t\tconst results = await raceCancellation(\n\t\t\tPromise.all(providers.map(async provider => {\n\t\t\t\ttry {\n\t\t\t\t\tconst edits = await provider.provideDocumentPasteEdits?.(model, selections, dataTransfer, context, token);\n\t\t\t\t\tif (edits) {\n\t\t\t\t\t\tdisposables.add(edits);\n\t\t\t\t\t}\n\t\t\t\t\treturn edits?.edits?.map(edit => ({ ...edit, provider }));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!isCancellationError(err)) {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t}\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t})),\n\t\t\ttoken);\n\t\tconst edits = coalesce(results ?? []).flat().filter(edit => {\n\t\t\treturn !context.only || context.only.contains(edit.kind);\n\t\t});\n\t\treturn {\n\t\t\tedits: sortEditsByYieldTo(edits),\n\t\t\tdispose: () => disposables.dispose()\n\t\t};\n\t}\n\n\tprivate async applyDefaultPasteHandler(dataTransfer: VSDataTransfer, metadata: CopyMetadata | undefined, token: CancellationToken, clipboardEvent: ClipboardEvent) {\n\t\tconst textDataTransfer = dataTransfer.get(Mimes.text) ?? dataTransfer.get('text');\n\t\tconst text = (await textDataTransfer?.asString()) ?? '';\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst payload: PastePayload = {\n\t\t\tclipboardEvent,\n\t\t\ttext,\n\t\t\tpasteOnNewLine: metadata?.defaultPastePayload.pasteOnNewLine ?? false,\n\t\t\tmulticursorText: metadata?.defaultPastePayload.multicursorText ?? null,\n\t\t\tmode: null,\n\t\t};\n\t\tthis._logService.trace('CopyPasteController#applyDefaultPasteHandler for id : ', metadata?.id);\n\t\tthis._editor.trigger('keyboard', Handler.Paste, payload);\n\t}\n\n\t/**\n\t * Filter out providers if they:\n\t * - Don't handle any of the data transfer types we have\n\t * - Don't match the preferred paste kind\n\t */\n\tprivate isSupportedPasteProvider(provider: DocumentPasteEditProvider, dataTransfer: VSDataTransfer, preference?: PastePreference): boolean {\n\t\tif (!provider.pasteMimeTypes?.some(type => dataTransfer.matches(type))) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !preference || this.providerMatchesPreference(provider, preference);\n\t}\n\n\tprivate providerMatchesPreference(provider: DocumentPasteEditProvider, preference: PastePreference): boolean {\n\t\tif ('only' in preference) {\n\t\t\treturn provider.providedPasteEditKinds.some(providedKind => preference.only.contains(providedKind));\n\t\t} else if ('preferences' in preference) {\n\t\t\treturn preference.preferences.some(providedKind => preference.preferences.some(preferredKind => preferredKind.contains(providedKind)));\n\t\t} else {\n\t\t\treturn provider.id === preference.providerId;\n\t\t}\n\t}\n\n\tprivate getInitialActiveEditIndex(model: ITextModel, edits: readonly DocumentPasteEdit[]): number {\n\t\tconst preferredProviders = this._configService.getValue<PreferredPasteConfiguration[]>(pasteAsPreferenceConfig, { resource: model.uri });\n\t\tfor (const config of Array.isArray(preferredProviders) ? preferredProviders : []) {\n\t\t\tconst desiredKind = new HierarchicalKind(config);\n\t\t\tconst editIndex = edits.findIndex(edit => desiredKind.contains(edit.kind));\n\t\t\tif (editIndex >= 0) {\n\t\t\t\treturn editIndex;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n}\n"]}
|
|
@@ -241,7 +241,7 @@ class MarkdownRenderedHoverParts {
|
|
|
241
241
|
const isActionIncrease = action === HoverVerbosityAction.Increase;
|
|
242
242
|
const actionElement = dom.append(container, $(ThemeIcon.asCSSSelector(isActionIncrease ? increaseHoverVerbosityIcon : decreaseHoverVerbosityIcon)));
|
|
243
243
|
actionElement.tabIndex = 0;
|
|
244
|
-
const hoverDelegate = new WorkbenchHoverDelegate('mouse', undefined, { target: container, position: { hoverPosition: 0 /* HoverPosition.LEFT */ } }, this._configurationService, this._hoverService);
|
|
244
|
+
const hoverDelegate = store.add(new WorkbenchHoverDelegate('mouse', undefined, { target: container, position: { hoverPosition: 0 /* HoverPosition.LEFT */ } }, this._configurationService, this._hoverService));
|
|
245
245
|
store.add(this._hoverService.setupManagedHover(hoverDelegate, actionElement, labelForHoverVerbosityAction(this._keybindingService, action)));
|
|
246
246
|
if (!actionEnabled) {
|
|
247
247
|
actionElement.classList.add('disabled');
|