monaco-editor-core 0.56.0-dev-20260119 → 0.56.0-dev-20260121
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.messages.cs.js +1 -1
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/browser/dom.js +8 -0
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +1 -0
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +4 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.css +8 -5
- package/esm/vs/base/browser/ui/contextview/contextview.js +1 -1
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/list/list.js +1 -0
- package/esm/vs/base/browser/ui/list/list.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +62 -5
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +0 -4
- package/esm/vs/base/common/defaultAccount.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +81 -35
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/editContext.js +11 -0
- package/esm/vs/editor/browser/controller/editContext/editContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +38 -18
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +4 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +39 -16
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/view.js +21 -1
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +18 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js +3 -3
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +7 -5
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +21 -17
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -1
- package/esm/vs/editor/common/model.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js +11 -4
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +25 -14
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/common/viewModel.js.map +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +3 -3
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +28 -64
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +27 -20
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +37 -10
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.css +7 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +22 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +19 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +5 -1
- package/esm/vs/platform/actionWidget/browser/actionList.js +46 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +8 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js +2 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +1 -0
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/product/common/product.js +16 -1
- package/esm/vs/platform/product/common/product.js.map +1 -1
- package/monaco.d.ts +5 -1
- package/package.json +2 -2
- package/version.txt +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/viewModel.ts","vs/editor/common/viewModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAyMxD,MAAM,OAAO,QAAQ;IAQpB,YAAY,GAAW,EAAE,IAAY,EAAE,KAAa,EAAE,MAAc;QAP3D,mBAAc,GAAS,SAAS,CAAC;QAQzC,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC;IAC1B,CAAC;CACD;AAED,MAAM,OAAO,yBAAyB;IAIrC,YACC,OAAe,EACf,IAAgC;QAEhC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD;AAED,MAAM,OAAO,YAAY;IAiCxB,YACC,OAAe,EACf,wBAAiC,EACjC,SAAiB,EACjB,SAAiB,EACjB,kBAA0B,EAC1B,MAAuB,EACvB,iBAA+D;QAvChE,uBAAkB,GAAS,SAAS,CAAC;QAyCpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;Q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CAAC,CAChC,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,CAAkC,EAAE,CAAkC;QAC7F,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,6BAA6B,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;CACD","file":"viewModel.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 arrays from '../../base/common/arrays.js';\nimport { IScrollPosition, Scrollable } from '../../base/common/scrollable.js';\nimport * as strings from '../../base/common/strings.js';\nimport { ISimpleModel } from './viewModel/screenReaderSimpleModel.js';\nimport { ICoordinatesConverter } from './coordinatesConverter.js';\nimport { IPosition, Position } from './core/position.js';\nimport { Range } from './core/range.js';\nimport { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, ICursorSimpleModel, PartialCursorState } from './cursorCommon.js';\nimport { CursorChangeReason } from './cursorEvents.js';\nimport { INewScrollPosition, ScrollType } from './editorCommon.js';\nimport { EditorTheme } from './editorTheme.js';\nimport { EndOfLinePreference, IGlyphMarginLanesModel, IModelDecorationOptions, ITextModel, TextDirection } from './model.js';\nimport { ILineBreaksComputer, InjectedText } from './modelLineProjectionData.js';\nimport { BracketGuideOptions, IActiveIndentGuideInfo, IndentGuide } from './textModelGuides.js';\nimport { IViewLineTokens } from './tokens/lineTokens.js';\nimport { ViewEventHandler } from './viewEventHandler.js';\nimport { VerticalRevealType } from './viewEvents.js';\nimport { InlineDecoration, SingleLineInlineDecoration } from './viewModel/inlineDecorations.js';\n\nexport interface IViewModel extends ICursorSimpleModel, ISimpleModel {\n\n\treadonly model: ITextModel;\n\n\treadonly coordinatesConverter: ICoordinatesConverter;\n\n\treadonly viewLayout: IViewLayout;\n\n\treadonly cursorConfig: CursorConfiguration;\n\n\treadonly glyphLanes: IGlyphMarginLanesModel;\n\n\taddViewEventHandler(eventHandler: ViewEventHandler): void;\n\tremoveViewEventHandler(eventHandler: ViewEventHandler): void;\n\n\t/**\n\t * Gives a hint that a lot of requests are about to come in for these line numbers.\n\t */\n\tsetViewport(startLineNumber: number, endLineNumber: number, centeredLineNumber: number): void;\n\tvisibleLinesStabilized(): void;\n\tsetHasFocus(hasFocus: boolean): void;\n\tsetHasWidgetFocus(hasWidgetFocus: boolean): void;\n\tonCompositionStart(): void;\n\tonCompositionEnd(): void;\n\n\tgetFontSizeAtPosition(position: IPosition): string | null;\n\tgetMinimapDecorationsInRange(range: Range): ViewModelDecoration[];\n\tgetDecorationsInViewport(visibleRange: Range): ViewModelDecoration[];\n\tgetTextDirection(lineNumber: number): TextDirection;\n\tgetViewportViewLineRenderingData(visibleRange: Range, lineNumber: number): ViewLineRenderingData;\n\tgetViewLineRenderingData(lineNumber: number): ViewLineRenderingData;\n\tgetViewLineData(lineNumber: number): ViewLineData;\n\tgetMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): MinimapLinesRenderingData;\n\tgetCompletelyVisibleViewRange(): Range;\n\tgetCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range;\n\tgetViewRangeWithCursorPadding(viewRange: Range): Range;\n\n\tgetHiddenAreas(): Range[];\n\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineLength(lineNumber: number): number;\n\tgetActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;\n\tgetLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[];\n\tgetBracketGuidesInRangeByLine(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\n\tgetAllOverviewRulerDecorations(theme: EditorTheme): OverviewRulerDecorationsGroup[];\n\tgetValueInRange(range: Range, eol: EndOfLinePreference): string;\n\tgetValueLengthInRange(range: Range, eol: EndOfLinePreference): number;\n\n\tgetInjectedTextAt(viewPosition: Position): InjectedText | null;\n\n\tdeduceModelPositionRelativeToViewPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position;\n\tgetPlainTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[];\n\tgetRichTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean): { html: string; mode: string } | null;\n\n\tcreateLineBreaksComputer(): ILineBreaksComputer;\n\n\t//#region cursor\n\tgetPrimaryCursorState(): CursorState;\n\tgetLastAddedCursorIndex(): number;\n\tgetCursorStates(): CursorState[];\n\tsetCursorStates(source: string | null | undefined, reason: CursorChangeReason, states: PartialCursorState[] | null): boolean;\n\tgetCursorColumnSelectData(): IColumnSelectData;\n\tgetCursorAutoClosedCharacters(): Range[];\n\tsetCursorColumnSelectData(columnSelectData: IColumnSelectData): void;\n\tgetPrevEditOperationType(): EditOperationType;\n\tsetPrevEditOperationType(type: EditOperationType): void;\n\trevealAllCursors(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealPrimaryCursor(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealTopMostCursor(source: string | null | undefined): void;\n\trevealBottomMostCursor(source: string | null | undefined): void;\n\trevealRange(source: string | null | undefined, revealHorizontal: boolean, viewRange: Range, verticalType: VerticalRevealType, scrollType: ScrollType): void;\n\t//#endregion\n\n\t//#region viewLayout\n\tchangeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): void;\n}\n\nexport interface IViewLayout {\n\n\tgetScrollable(): Scrollable;\n\n\tgetScrollWidth(): number;\n\tgetScrollHeight(): number;\n\n\tgetCurrentScrollLeft(): number;\n\tgetCurrentScrollTop(): number;\n\tgetCurrentViewport(): Viewport;\n\n\tgetFutureViewport(): Viewport;\n\n\tsetScrollPosition(position: INewScrollPosition, type: ScrollType): void;\n\tdeltaScrollNow(deltaScrollLeft: number, deltaScrollTop: number): void;\n\n\tvalidateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition;\n\n\tsetMaxLineWidth(maxLineWidth: number): void;\n\tsetOverlayWidgetsMinWidth(overlayWidgetsMinWidth: number): void;\n\n\tgetLinesViewportData(): IPartialViewLinesViewportData;\n\tgetWhitespaces(): IEditorWhitespace[];\n\n\tisAfterLines(verticalOffset: number): boolean;\n\tisInTopPadding(verticalOffset: number): boolean;\n\tisInBottomPadding(verticalOffset: number): boolean;\n\tgetLineNumberAtVerticalOffset(verticalOffset: number): number;\n\tgetVerticalOffsetForLineNumber(lineNumber: number, includeViewZones?: boolean): number;\n\tgetVerticalOffsetAfterLineNumber(lineNumber: number, includeViewZones?: boolean): number;\n\tgetLineHeightForLineNumber(lineNumber: number): number;\n\tgetWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null;\n\n\t/**\n\t * Get the layout information for whitespaces currently in the viewport\n\t */\n\tgetWhitespaceViewportData(): IViewWhitespaceViewportData[];\n}\n\nexport interface IEditorWhitespace {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly height: number;\n}\n\n/**\n * An accessor that allows for whitespace to be added, removed or changed in bulk.\n */\nexport interface IWhitespaceChangeAccessor {\n\tinsertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string;\n\tchangeOneWhitespace(id: string, newAfterLineNumber: number, newHeight: number): void;\n\tremoveWhitespace(id: string): void;\n}\n\nexport interface ILineHeightChangeAccessor {\n\tinsertOrChangeCustomLineHeight(decorationId: string, startLineNumber: number, endLineNumber: number, lineHeight: number): void;\n\tremoveCustomLineHeight(decorationId: string): void;\n}\n\nexport interface IPartialViewLinesViewportData {\n\t/**\n\t * Value to be substracted from `scrollTop` (in order to vertical offset numbers < 1MM)\n\t */\n\treadonly bigNumbersDelta: number;\n\t/**\n\t * The first (partially) visible line number.\n\t */\n\treadonly startLineNumber: number;\n\t/**\n\t * The last (partially) visible line number.\n\t */\n\treadonly endLineNumber: number;\n\t/**\n\t * relativeVerticalOffset[i] is the `top` position for line at `i` + `startLineNumber`.\n\t */\n\treadonly relativeVerticalOffset: number[];\n\t/**\n\t * The centered line in the viewport.\n\t */\n\treadonly centeredLineNumber: number;\n\t/**\n\t * The first completely visible line number.\n\t */\n\treadonly completelyVisibleStartLineNumber: number;\n\t/**\n\t * The last completely visible line number.\n\t */\n\treadonly completelyVisibleEndLineNumber: number;\n\n\t/**\n\t * The height of a line.\n\t */\n\treadonly lineHeight: number;\n}\n\nexport interface IViewWhitespaceViewportData {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly verticalOffset: number;\n\treadonly height: number;\n}\n\nexport class Viewport {\n\treadonly _viewportBrand: void = undefined;\n\n\treadonly top: number;\n\treadonly left: number;\n\treadonly width: number;\n\treadonly height: number;\n\n\tconstructor(top: number, left: number, width: number, height: number) {\n\t\tthis.top = top | 0;\n\t\tthis.left = left | 0;\n\t\tthis.width = width | 0;\n\t\tthis.height = height | 0;\n\t}\n}\n\nexport class MinimapLinesRenderingData {\n\tpublic readonly tabSize: number;\n\tpublic readonly data: Array<ViewLineData | null>;\n\n\tconstructor(\n\t\ttabSize: number,\n\t\tdata: Array<ViewLineData | null>\n\t) {\n\t\tthis.tabSize = tabSize;\n\t\tthis.data = data;\n\t}\n}\n\nexport class ViewLineData {\n\t_viewLineDataBrand: void = undefined;\n\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent).\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\n\t/**\n\t * Additional inline decorations for this line.\n\t*/\n\tpublic readonly inlineDecorations: readonly SingleLineInlineDecoration[] | null;\n\n\tconstructor(\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tstartVisibleColumn: number,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: readonly SingleLineInlineDecoration[] | null\n\t) {\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t}\n}\n\nexport class ViewLineRenderingData {\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * Describes if `content` contains RTL characters.\n\t */\n\tpublic readonly containsRTL: boolean;\n\t/**\n\t * Describes if `content` contains non basic ASCII chars.\n\t */\n\tpublic readonly isBasicASCII: boolean;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\t/**\n\t * Inline decorations at this view line.\n\t */\n\tpublic readonly inlineDecorations: InlineDecoration[];\n\t/**\n\t * The tab size for this view model.\n\t */\n\tpublic readonly tabSize: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent)\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The direction to use for rendering the line.\n\t */\n\tpublic readonly textDirection: TextDirection;\n\t/**\n\t * Whether the line has variable fonts\n\t */\n\tpublic readonly hasVariableFonts: boolean;\n\n\tconstructor(\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tmightContainRTL: boolean,\n\t\tmightContainNonBasicASCII: boolean,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: InlineDecoration[],\n\t\ttabSize: number,\n\t\tstartVisibleColumn: number,\n\t\ttextDirection: TextDirection,\n\t\thasVariableFonts: boolean\n\t) {\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\n\t\tthis.isBasicASCII = ViewLineRenderingData.isBasicASCII(content, mightContainNonBasicASCII);\n\t\tthis.containsRTL = ViewLineRenderingData.containsRTL(content, this.isBasicASCII, mightContainRTL);\n\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t\tthis.tabSize = tabSize;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.textDirection = textDirection;\n\t\tthis.hasVariableFonts = hasVariableFonts;\n\t}\n\n\tpublic static isBasicASCII(lineContent: string, mightContainNonBasicASCII: boolean): boolean {\n\t\tif (mightContainNonBasicASCII) {\n\t\t\treturn strings.isBasicASCII(lineContent);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic static containsRTL(lineContent: string, isBasicASCII: boolean, mightContainRTL: boolean): boolean {\n\t\tif (!isBasicASCII && mightContainRTL) {\n\t\t\treturn strings.containsRTL(lineContent);\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport class ViewModelDecoration {\n\t_viewModelDecorationBrand: void = undefined;\n\n\tpublic readonly range: Range;\n\tpublic readonly options: IModelDecorationOptions;\n\n\tconstructor(range: Range, options: IModelDecorationOptions) {\n\t\tthis.range = range;\n\t\tthis.options = options;\n\t}\n}\n\nexport class OverviewRulerDecorationsGroup {\n\n\tconstructor(\n\t\tpublic readonly color: string,\n\t\tpublic readonly zIndex: number,\n\t\t/**\n\t\t * Decorations are encoded in a number array using the following scheme:\n\t\t * - 3*i = lane\n\t\t * - 3*i+1 = startLineNumber\n\t\t * - 3*i+2 = endLineNumber\n\t\t */\n\t\tpublic readonly data: number[]\n\t) { }\n\n\tpublic static compareByRenderingProps(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): number {\n\t\tif (a.zIndex === b.zIndex) {\n\t\t\tif (a.color < b.color) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.color > b.color) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\treturn a.zIndex - b.zIndex;\n\t}\n\n\tpublic static equals(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): boolean {\n\t\treturn (\n\t\t\ta.color === b.color\n\t\t\t&& a.zIndex === b.zIndex\n\t\t\t&& arrays.equals(a.data, b.data)\n\t\t);\n\t}\n\n\tpublic static equalsArr(a: OverviewRulerDecorationsGroup[], b: OverviewRulerDecorationsGroup[]): boolean {\n\t\treturn arrays.equals(a, b, OverviewRulerDecorationsGroup.equals);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\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 arrays from '../../base/common/arrays.js';\nimport { IScrollPosition, Scrollable } from '../../base/common/scrollable.js';\nimport * as strings from '../../base/common/strings.js';\nimport { ISimpleModel } from './viewModel/screenReaderSimpleModel.js';\nimport { ICoordinatesConverter } from './coordinatesConverter.js';\nimport { IPosition, Position } from './core/position.js';\nimport { Range } from './core/range.js';\nimport { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, ICursorSimpleModel, PartialCursorState } from './cursorCommon.js';\nimport { CursorChangeReason } from './cursorEvents.js';\nimport { INewScrollPosition, ScrollType } from './editorCommon.js';\nimport { EditorTheme } from './editorTheme.js';\nimport { EndOfLinePreference, IGlyphMarginLanesModel, IModelDecorationOptions, ITextModel, TextDirection } from './model.js';\nimport { ILineBreaksComputer, InjectedText } from './modelLineProjectionData.js';\nimport { BracketGuideOptions, IActiveIndentGuideInfo, IndentGuide } from './textModelGuides.js';\nimport { IViewLineTokens } from './tokens/lineTokens.js';\nimport { ViewEventHandler } from './viewEventHandler.js';\nimport { VerticalRevealType } from './viewEvents.js';\nimport { InlineDecoration, SingleLineInlineDecoration } from './viewModel/inlineDecorations.js';\n\nexport interface IViewModel extends ICursorSimpleModel, ISimpleModel {\n\n\treadonly model: ITextModel;\n\n\treadonly coordinatesConverter: ICoordinatesConverter;\n\n\treadonly viewLayout: IViewLayout;\n\n\treadonly cursorConfig: CursorConfiguration;\n\n\treadonly glyphLanes: IGlyphMarginLanesModel;\n\n\taddViewEventHandler(eventHandler: ViewEventHandler): void;\n\tremoveViewEventHandler(eventHandler: ViewEventHandler): void;\n\n\t/**\n\t * Gives a hint that a lot of requests are about to come in for these line numbers.\n\t */\n\tsetViewport(startLineNumber: number, endLineNumber: number, centeredLineNumber: number): void;\n\tvisibleLinesStabilized(): void;\n\tsetHasFocus(hasFocus: boolean): void;\n\tsetHasWidgetFocus(hasWidgetFocus: boolean): void;\n\tonCompositionStart(): void;\n\tonCompositionEnd(): void;\n\n\tgetFontSizeAtPosition(position: IPosition): string | null;\n\tgetMinimapDecorationsInRange(range: Range): ViewModelDecoration[];\n\tgetDecorationsInViewport(visibleRange: Range): ViewModelDecoration[];\n\tgetTextDirection(lineNumber: number): TextDirection;\n\tgetViewportViewLineRenderingData(visibleRange: Range, lineNumber: number): ViewLineRenderingData;\n\tgetViewLineRenderingData(lineNumber: number): ViewLineRenderingData;\n\tgetViewLineData(lineNumber: number): ViewLineData;\n\tgetMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): MinimapLinesRenderingData;\n\tgetCompletelyVisibleViewRange(): Range;\n\tgetCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range;\n\tgetViewRangeWithCursorPadding(viewRange: Range): Range;\n\n\tgetHiddenAreas(): Range[];\n\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineLength(lineNumber: number): number;\n\tgetActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;\n\tgetLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[];\n\tgetBracketGuidesInRangeByLine(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\n\tgetAllOverviewRulerDecorations(theme: EditorTheme): OverviewRulerDecorationsGroup[];\n\tgetValueInRange(range: Range, eol: EndOfLinePreference): string;\n\tgetValueLengthInRange(range: Range, eol: EndOfLinePreference): number;\n\n\tgetInjectedTextAt(viewPosition: Position): InjectedText | null;\n\n\tdeduceModelPositionRelativeToViewPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position;\n\tgetPlainTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[];\n\tgetRichTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean): { html: string; mode: string } | null;\n\n\tcreateLineBreaksComputer(): ILineBreaksComputer;\n\n\t//#region cursor\n\tgetPrimaryCursorState(): CursorState;\n\tgetLastAddedCursorIndex(): number;\n\tgetCursorStates(): CursorState[];\n\tsetCursorStates(source: string | null | undefined, reason: CursorChangeReason, states: PartialCursorState[] | null): boolean;\n\tgetCursorColumnSelectData(): IColumnSelectData;\n\tgetCursorAutoClosedCharacters(): Range[];\n\tsetCursorColumnSelectData(columnSelectData: IColumnSelectData): void;\n\tgetPrevEditOperationType(): EditOperationType;\n\tsetPrevEditOperationType(type: EditOperationType): void;\n\trevealAllCursors(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealPrimaryCursor(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealTopMostCursor(source: string | null | undefined): void;\n\trevealBottomMostCursor(source: string | null | undefined): void;\n\trevealRange(source: string | null | undefined, revealHorizontal: boolean, viewRange: Range, verticalType: VerticalRevealType, scrollType: ScrollType): void;\n\t//#endregion\n\n\t//#region viewLayout\n\tchangeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): void;\n}\n\nexport interface IViewLayout {\n\n\tgetScrollable(): Scrollable;\n\n\tgetScrollWidth(): number;\n\tgetScrollHeight(): number;\n\n\tgetCurrentScrollLeft(): number;\n\tgetCurrentScrollTop(): number;\n\tgetCurrentViewport(): Viewport;\n\n\tgetFutureViewport(): Viewport;\n\n\tsetScrollPosition(position: INewScrollPosition, type: ScrollType): void;\n\tdeltaScrollNow(deltaScrollLeft: number, deltaScrollTop: number): void;\n\n\tvalidateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition;\n\n\tsetMaxLineWidth(maxLineWidth: number): void;\n\tsetOverlayWidgetsMinWidth(overlayWidgetsMinWidth: number): void;\n\n\tgetLinesViewportData(): IPartialViewLinesViewportData;\n\tgetWhitespaces(): IEditorWhitespace[];\n\n\tisAfterLines(verticalOffset: number): boolean;\n\tisInTopPadding(verticalOffset: number): boolean;\n\tisInBottomPadding(verticalOffset: number): boolean;\n\tgetLineNumberAtVerticalOffset(verticalOffset: number): number;\n\tgetVerticalOffsetForLineNumber(lineNumber: number, includeViewZones?: boolean): number;\n\tgetVerticalOffsetAfterLineNumber(lineNumber: number, includeViewZones?: boolean): number;\n\tgetLineHeightForLineNumber(lineNumber: number): number;\n\tgetWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null;\n\n\t/**\n\t * Get the layout information for whitespaces currently in the viewport\n\t */\n\tgetWhitespaceViewportData(): IViewWhitespaceViewportData[];\n}\n\nexport interface IEditorWhitespace {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly height: number;\n}\n\n/**\n * An accessor that allows for whitespace to be added, removed or changed in bulk.\n */\nexport interface IWhitespaceChangeAccessor {\n\tinsertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string;\n\tchangeOneWhitespace(id: string, newAfterLineNumber: number, newHeight: number): void;\n\tremoveWhitespace(id: string): void;\n}\n\nexport interface ILineHeightChangeAccessor {\n\tinsertOrChangeCustomLineHeight(decorationId: string, startLineNumber: number, endLineNumber: number, lineHeight: number): void;\n\tremoveCustomLineHeight(decorationId: string): void;\n}\n\nexport interface IPartialViewLinesViewportData {\n\t/**\n\t * Value to be substracted from `scrollTop` (in order to vertical offset numbers < 1MM)\n\t */\n\treadonly bigNumbersDelta: number;\n\t/**\n\t * The first (partially) visible line number.\n\t */\n\treadonly startLineNumber: number;\n\t/**\n\t * The last (partially) visible line number.\n\t */\n\treadonly endLineNumber: number;\n\t/**\n\t * relativeVerticalOffset[i] is the `top` position for line at `i` + `startLineNumber`.\n\t */\n\treadonly relativeVerticalOffset: number[];\n\t/**\n\t * The centered line in the viewport.\n\t */\n\treadonly centeredLineNumber: number;\n\t/**\n\t * The first completely visible line number.\n\t */\n\treadonly completelyVisibleStartLineNumber: number;\n\t/**\n\t * The last completely visible line number.\n\t */\n\treadonly completelyVisibleEndLineNumber: number;\n\n\t/**\n\t * The height of a line.\n\t */\n\treadonly lineHeight: number;\n}\n\nexport interface IViewWhitespaceViewportData {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly verticalOffset: number;\n\treadonly height: number;\n}\n\nexport class Viewport {\n\treadonly _viewportBrand: void = undefined;\n\n\treadonly top: number;\n\treadonly left: number;\n\treadonly width: number;\n\treadonly height: number;\n\n\tconstructor(top: number, left: number, width: number, height: number) {\n\t\tthis.top = top | 0;\n\t\tthis.left = left | 0;\n\t\tthis.width = width | 0;\n\t\tthis.height = height | 0;\n\t}\n}\n\nexport class MinimapLinesRenderingData {\n\tpublic readonly tabSize: number;\n\tpublic readonly data: Array<ViewLineData | null>;\n\n\tconstructor(\n\t\ttabSize: number,\n\t\tdata: Array<ViewLineData | null>\n\t) {\n\t\tthis.tabSize = tabSize;\n\t\tthis.data = data;\n\t}\n}\n\nexport class ViewLineData {\n\t_viewLineDataBrand: void = undefined;\n\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent).\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\n\t/**\n\t * Additional inline decorations for this line.\n\t*/\n\tpublic readonly inlineDecorations: readonly SingleLineInlineDecoration[] | null;\n\n\tconstructor(\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tstartVisibleColumn: number,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: readonly SingleLineInlineDecoration[] | null\n\t) {\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t}\n}\n\nexport class ViewLineRenderingData {\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * Describes if `content` contains RTL characters.\n\t */\n\tpublic readonly containsRTL: boolean;\n\t/**\n\t * Describes if `content` contains non basic ASCII chars.\n\t */\n\tpublic readonly isBasicASCII: boolean;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\t/**\n\t * Inline decorations at this view line.\n\t */\n\tpublic readonly inlineDecorations: InlineDecoration[];\n\t/**\n\t * The tab size for this view model.\n\t */\n\tpublic readonly tabSize: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent)\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The direction to use for rendering the line.\n\t */\n\tpublic readonly textDirection: TextDirection;\n\t/**\n\t * Whether the line has variable fonts\n\t */\n\tpublic readonly hasVariableFonts: boolean;\n\n\tconstructor(\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tmightContainRTL: boolean,\n\t\tmightContainNonBasicASCII: boolean,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: InlineDecoration[],\n\t\ttabSize: number,\n\t\tstartVisibleColumn: number,\n\t\ttextDirection: TextDirection,\n\t\thasVariableFonts: boolean\n\t) {\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\n\t\tthis.isBasicASCII = ViewLineRenderingData.isBasicASCII(content, mightContainNonBasicASCII);\n\t\tthis.containsRTL = ViewLineRenderingData.containsRTL(content, this.isBasicASCII, mightContainRTL);\n\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t\tthis.tabSize = tabSize;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.textDirection = textDirection;\n\t\tthis.hasVariableFonts = hasVariableFonts;\n\t}\n\n\tpublic static isBasicASCII(lineContent: string, mightContainNonBasicASCII: boolean): boolean {\n\t\tif (mightContainNonBasicASCII) {\n\t\t\treturn strings.isBasicASCII(lineContent);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic static containsRTL(lineContent: string, isBasicASCII: boolean, mightContainRTL: boolean): boolean {\n\t\tif (!isBasicASCII && mightContainRTL) {\n\t\t\treturn strings.containsRTL(lineContent);\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport class ViewModelDecoration {\n\t_viewModelDecorationBrand: void = undefined;\n\n\tpublic readonly range: Range;\n\tpublic readonly options: IModelDecorationOptions;\n\n\tconstructor(range: Range, options: IModelDecorationOptions) {\n\t\tthis.range = range;\n\t\tthis.options = options;\n\t}\n}\n\nexport class OverviewRulerDecorationsGroup {\n\n\tconstructor(\n\t\tpublic readonly color: string,\n\t\tpublic readonly zIndex: number,\n\t\t/**\n\t\t * Decorations are encoded in a number array using the following scheme:\n\t\t * - 3*i = lane\n\t\t * - 3*i+1 = startLineNumber\n\t\t * - 3*i+2 = endLineNumber\n\t\t */\n\t\tpublic readonly data: number[]\n\t) { }\n\n\tpublic static compareByRenderingProps(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): number {\n\t\tif (a.zIndex === b.zIndex) {\n\t\t\tif (a.color < b.color) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.color > b.color) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\treturn a.zIndex - b.zIndex;\n\t}\n\n\tpublic static equals(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): boolean {\n\t\treturn (\n\t\t\ta.color === b.color\n\t\t\t&& a.zIndex === b.zIndex\n\t\t\t&& arrays.equals(a.data, b.data)\n\t\t);\n\t}\n\n\tpublic static equalsArr(a: OverviewRulerDecorationsGroup[], b: OverviewRulerDecorationsGroup[]): boolean {\n\t\treturn arrays.equals(a, b, OverviewRulerDecorationsGroup.equals);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/viewModel.ts","vs/editor/common/viewModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AA4MxD,MAAM,OAAO,QAAQ;IAQpB,YAAY,GAAW,EAAE,IAAY,EAAE,KAAa,EAAE,MAAc;QAP3D,mBAAc,GAAS,SAAS,CAAC;QAQzC,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC;IAC1B,CAAC;CACD;AAED,MAAM,OAAO,yBAAyB;IAIrC,YACC,OAAe,EACf,IAAgC;QAEhC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD;AAED,MAAM,OAAO,YAAY;IAiCxB,YACC,OAAe,EACf,wBAAiC,EACjC,SAAiB,EACjB,SAAiB,EACjB,kBAA0B,EAC1B,MAAuB,EACvB,iBAA+D;QAvChE,uBAAkB,GAAS,SAAS,CAAC;QAyCpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC5C,CAAC;CAC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C,MAAM,CAAC,CAAC;IAClE,CAAC;CACD","file":"viewModel.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 arrays from '../../base/common/arrays.js';\nimport { IScrollPosition, Scrollable } from '../../base/common/scrollable.js';\nimport * as strings from '../../base/common/strings.js';\nimport { ISimpleModel } from './viewModel/screenReaderSimpleModel.js';\nimport { ICoordinatesConverter } from './coordinatesConverter.js';\nimport { IPosition, Position } from './core/position.js';\nimport { Range } from './core/range.js';\nimport { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, ICursorSimpleModel, PartialCursorState } from './cursorCommon.js';\nimport { CursorChangeReason } from './cursorEvents.js';\nimport { INewScrollPosition, ScrollType } from './editorCommon.js';\nimport { EditorTheme } from './editorTheme.js';\nimport { EndOfLinePreference, IGlyphMarginLanesModel, IModelDecorationOptions, ITextModel, TextDirection } from './model.js';\nimport { ILineBreaksComputer, InjectedText } from './modelLineProjectionData.js';\nimport { BracketGuideOptions, IActiveIndentGuideInfo, IndentGuide } from './textModelGuides.js';\nimport { IViewLineTokens } from './tokens/lineTokens.js';\nimport { ViewEventHandler } from './viewEventHandler.js';\nimport { VerticalRevealType } from './viewEvents.js';\nimport { InlineDecoration, SingleLineInlineDecoration } from './viewModel/inlineDecorations.js';\nimport { EditorOption, FindComputedEditorOptionValueById } from './config/editorOptions.js';\n\nexport interface IViewModel extends ICursorSimpleModel, ISimpleModel {\n\n\treadonly model: ITextModel;\n\n\treadonly coordinatesConverter: ICoordinatesConverter;\n\n\treadonly viewLayout: IViewLayout;\n\n\treadonly cursorConfig: CursorConfiguration;\n\n\treadonly glyphLanes: IGlyphMarginLanesModel;\n\n\taddViewEventHandler(eventHandler: ViewEventHandler): void;\n\tremoveViewEventHandler(eventHandler: ViewEventHandler): void;\n\n\tgetEditorOption<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n\n\t/**\n\t * Gives a hint that a lot of requests are about to come in for these line numbers.\n\t */\n\tsetViewport(startLineNumber: number, endLineNumber: number, centeredLineNumber: number): void;\n\tvisibleLinesStabilized(): void;\n\tsetHasFocus(hasFocus: boolean): void;\n\tsetHasWidgetFocus(hasWidgetFocus: boolean): void;\n\tonCompositionStart(): void;\n\tonCompositionEnd(): void;\n\n\tgetFontSizeAtPosition(position: IPosition): string | null;\n\tgetMinimapDecorationsInRange(range: Range): ViewModelDecoration[];\n\tgetDecorationsInViewport(visibleRange: Range): ViewModelDecoration[];\n\tgetTextDirection(lineNumber: number): TextDirection;\n\tgetViewportViewLineRenderingData(visibleRange: Range, lineNumber: number): ViewLineRenderingData;\n\tgetViewLineRenderingData(lineNumber: number): ViewLineRenderingData;\n\tgetViewLineData(lineNumber: number): ViewLineData;\n\tgetMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): MinimapLinesRenderingData;\n\tgetCompletelyVisibleViewRange(): Range;\n\tgetCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range;\n\tgetViewRangeWithCursorPadding(viewRange: Range): Range;\n\n\tgetHiddenAreas(): Range[];\n\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineLength(lineNumber: number): number;\n\tgetActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;\n\tgetLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[];\n\tgetBracketGuidesInRangeByLine(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\n\tgetAllOverviewRulerDecorations(theme: EditorTheme): OverviewRulerDecorationsGroup[];\n\tgetValueInRange(range: Range, eol: EndOfLinePreference): string;\n\tgetValueLengthInRange(range: Range, eol: EndOfLinePreference): number;\n\n\tgetInjectedTextAt(viewPosition: Position): InjectedText | null;\n\n\tdeduceModelPositionRelativeToViewPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position;\n\tgetPlainTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): { sourceRanges: Range[]; sourceText: string | string[] };\n\tgetRichTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean): { html: string; mode: string } | null;\n\n\tcreateLineBreaksComputer(): ILineBreaksComputer;\n\n\t//#region cursor\n\tgetPrimaryCursorState(): CursorState;\n\tgetLastAddedCursorIndex(): number;\n\tgetCursorStates(): CursorState[];\n\tsetCursorStates(source: string | null | undefined, reason: CursorChangeReason, states: PartialCursorState[] | null): boolean;\n\tgetCursorColumnSelectData(): IColumnSelectData;\n\tgetCursorAutoClosedCharacters(): Range[];\n\tsetCursorColumnSelectData(columnSelectData: IColumnSelectData): void;\n\tgetPrevEditOperationType(): EditOperationType;\n\tsetPrevEditOperationType(type: EditOperationType): void;\n\trevealAllCursors(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealPrimaryCursor(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealTopMostCursor(source: string | null | undefined): void;\n\trevealBottomMostCursor(source: string | null | undefined): void;\n\trevealRange(source: string | null | undefined, revealHorizontal: boolean, viewRange: Range, verticalType: VerticalRevealType, scrollType: ScrollType): void;\n\t//#endregion\n\n\t//#region viewLayout\n\tchangeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): void;\n}\n\nexport interface IViewLayout {\n\n\tgetScrollable(): Scrollable;\n\n\tgetScrollWidth(): number;\n\tgetScrollHeight(): number;\n\n\tgetCurrentScrollLeft(): number;\n\tgetCurrentScrollTop(): number;\n\tgetCurrentViewport(): Viewport;\n\n\tgetFutureViewport(): Viewport;\n\n\tsetScrollPosition(position: INewScrollPosition, type: ScrollType): void;\n\tdeltaScrollNow(deltaScrollLeft: number, deltaScrollTop: number): void;\n\n\tvalidateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition;\n\n\tsetMaxLineWidth(maxLineWidth: number): void;\n\tsetOverlayWidgetsMinWidth(overlayWidgetsMinWidth: number): void;\n\n\tgetLinesViewportData(): IPartialViewLinesViewportData;\n\tgetWhitespaces(): IEditorWhitespace[];\n\n\tisAfterLines(verticalOffset: number): boolean;\n\tisInTopPadding(verticalOffset: number): boolean;\n\tisInBottomPadding(verticalOffset: number): boolean;\n\tgetLineNumberAtVerticalOffset(verticalOffset: number): number;\n\tgetVerticalOffsetForLineNumber(lineNumber: number, includeViewZones?: boolean): number;\n\tgetVerticalOffsetAfterLineNumber(lineNumber: number, includeViewZones?: boolean): number;\n\tgetLineHeightForLineNumber(lineNumber: number): number;\n\tgetWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null;\n\n\t/**\n\t * Get the layout information for whitespaces currently in the viewport\n\t */\n\tgetWhitespaceViewportData(): IViewWhitespaceViewportData[];\n}\n\nexport interface IEditorWhitespace {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly height: number;\n}\n\n/**\n * An accessor that allows for whitespace to be added, removed or changed in bulk.\n */\nexport interface IWhitespaceChangeAccessor {\n\tinsertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string;\n\tchangeOneWhitespace(id: string, newAfterLineNumber: number, newHeight: number): void;\n\tremoveWhitespace(id: string): void;\n}\n\nexport interface ILineHeightChangeAccessor {\n\tinsertOrChangeCustomLineHeight(decorationId: string, startLineNumber: number, endLineNumber: number, lineHeight: number): void;\n\tremoveCustomLineHeight(decorationId: string): void;\n}\n\nexport interface IPartialViewLinesViewportData {\n\t/**\n\t * Value to be substracted from `scrollTop` (in order to vertical offset numbers < 1MM)\n\t */\n\treadonly bigNumbersDelta: number;\n\t/**\n\t * The first (partially) visible line number.\n\t */\n\treadonly startLineNumber: number;\n\t/**\n\t * The last (partially) visible line number.\n\t */\n\treadonly endLineNumber: number;\n\t/**\n\t * relativeVerticalOffset[i] is the `top` position for line at `i` + `startLineNumber`.\n\t */\n\treadonly relativeVerticalOffset: number[];\n\t/**\n\t * The centered line in the viewport.\n\t */\n\treadonly centeredLineNumber: number;\n\t/**\n\t * The first completely visible line number.\n\t */\n\treadonly completelyVisibleStartLineNumber: number;\n\t/**\n\t * The last completely visible line number.\n\t */\n\treadonly completelyVisibleEndLineNumber: number;\n\n\t/**\n\t * The height of a line.\n\t */\n\treadonly lineHeight: number;\n}\n\nexport interface IViewWhitespaceViewportData {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly verticalOffset: number;\n\treadonly height: number;\n}\n\nexport class Viewport {\n\treadonly _viewportBrand: void = undefined;\n\n\treadonly top: number;\n\treadonly left: number;\n\treadonly width: number;\n\treadonly height: number;\n\n\tconstructor(top: number, left: number, width: number, height: number) {\n\t\tthis.top = top | 0;\n\t\tthis.left = left | 0;\n\t\tthis.width = width | 0;\n\t\tthis.height = height | 0;\n\t}\n}\n\nexport class MinimapLinesRenderingData {\n\tpublic readonly tabSize: number;\n\tpublic readonly data: Array<ViewLineData | null>;\n\n\tconstructor(\n\t\ttabSize: number,\n\t\tdata: Array<ViewLineData | null>\n\t) {\n\t\tthis.tabSize = tabSize;\n\t\tthis.data = data;\n\t}\n}\n\nexport class ViewLineData {\n\t_viewLineDataBrand: void = undefined;\n\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent).\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\n\t/**\n\t * Additional inline decorations for this line.\n\t*/\n\tpublic readonly inlineDecorations: readonly SingleLineInlineDecoration[] | null;\n\n\tconstructor(\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tstartVisibleColumn: number,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: readonly SingleLineInlineDecoration[] | null\n\t) {\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t}\n}\n\nexport class ViewLineRenderingData {\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * Describes if `content` contains RTL characters.\n\t */\n\tpublic readonly containsRTL: boolean;\n\t/**\n\t * Describes if `content` contains non basic ASCII chars.\n\t */\n\tpublic readonly isBasicASCII: boolean;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\t/**\n\t * Inline decorations at this view line.\n\t */\n\tpublic readonly inlineDecorations: InlineDecoration[];\n\t/**\n\t * The tab size for this view model.\n\t */\n\tpublic readonly tabSize: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent)\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The direction to use for rendering the line.\n\t */\n\tpublic readonly textDirection: TextDirection;\n\t/**\n\t * Whether the line has variable fonts\n\t */\n\tpublic readonly hasVariableFonts: boolean;\n\n\tconstructor(\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tmightContainRTL: boolean,\n\t\tmightContainNonBasicASCII: boolean,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: InlineDecoration[],\n\t\ttabSize: number,\n\t\tstartVisibleColumn: number,\n\t\ttextDirection: TextDirection,\n\t\thasVariableFonts: boolean\n\t) {\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\n\t\tthis.isBasicASCII = ViewLineRenderingData.isBasicASCII(content, mightContainNonBasicASCII);\n\t\tthis.containsRTL = ViewLineRenderingData.containsRTL(content, this.isBasicASCII, mightContainRTL);\n\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t\tthis.tabSize = tabSize;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.textDirection = textDirection;\n\t\tthis.hasVariableFonts = hasVariableFonts;\n\t}\n\n\tpublic static isBasicASCII(lineContent: string, mightContainNonBasicASCII: boolean): boolean {\n\t\tif (mightContainNonBasicASCII) {\n\t\t\treturn strings.isBasicASCII(lineContent);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic static containsRTL(lineContent: string, isBasicASCII: boolean, mightContainRTL: boolean): boolean {\n\t\tif (!isBasicASCII && mightContainRTL) {\n\t\t\treturn strings.containsRTL(lineContent);\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport class ViewModelDecoration {\n\t_viewModelDecorationBrand: void = undefined;\n\n\tpublic readonly range: Range;\n\tpublic readonly options: IModelDecorationOptions;\n\n\tconstructor(range: Range, options: IModelDecorationOptions) {\n\t\tthis.range = range;\n\t\tthis.options = options;\n\t}\n}\n\nexport class OverviewRulerDecorationsGroup {\n\n\tconstructor(\n\t\tpublic readonly color: string,\n\t\tpublic readonly zIndex: number,\n\t\t/**\n\t\t * Decorations are encoded in a number array using the following scheme:\n\t\t * - 3*i = lane\n\t\t * - 3*i+1 = startLineNumber\n\t\t * - 3*i+2 = endLineNumber\n\t\t */\n\t\tpublic readonly data: number[]\n\t) { }\n\n\tpublic static compareByRenderingProps(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): number {\n\t\tif (a.zIndex === b.zIndex) {\n\t\t\tif (a.color < b.color) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.color > b.color) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\treturn a.zIndex - b.zIndex;\n\t}\n\n\tpublic static equals(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): boolean {\n\t\treturn (\n\t\t\ta.color === b.color\n\t\t\t&& a.zIndex === b.zIndex\n\t\t\t&& arrays.equals(a.data, b.data)\n\t\t);\n\t}\n\n\tpublic static equalsArr(a: OverviewRulerDecorationsGroup[], b: OverviewRulerDecorationsGroup[]): boolean {\n\t\treturn arrays.equals(a, b, OverviewRulerDecorationsGroup.equals);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\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 arrays from '../../base/common/arrays.js';\nimport { IScrollPosition, Scrollable } from '../../base/common/scrollable.js';\nimport * as strings from '../../base/common/strings.js';\nimport { ISimpleModel } from './viewModel/screenReaderSimpleModel.js';\nimport { ICoordinatesConverter } from './coordinatesConverter.js';\nimport { IPosition, Position } from './core/position.js';\nimport { Range } from './core/range.js';\nimport { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, ICursorSimpleModel, PartialCursorState } from './cursorCommon.js';\nimport { CursorChangeReason } from './cursorEvents.js';\nimport { INewScrollPosition, ScrollType } from './editorCommon.js';\nimport { EditorTheme } from './editorTheme.js';\nimport { EndOfLinePreference, IGlyphMarginLanesModel, IModelDecorationOptions, ITextModel, TextDirection } from './model.js';\nimport { ILineBreaksComputer, InjectedText } from './modelLineProjectionData.js';\nimport { BracketGuideOptions, IActiveIndentGuideInfo, IndentGuide } from './textModelGuides.js';\nimport { IViewLineTokens } from './tokens/lineTokens.js';\nimport { ViewEventHandler } from './viewEventHandler.js';\nimport { VerticalRevealType } from './viewEvents.js';\nimport { InlineDecoration, SingleLineInlineDecoration } from './viewModel/inlineDecorations.js';\nimport { EditorOption, FindComputedEditorOptionValueById } from './config/editorOptions.js';\n\nexport interface IViewModel extends ICursorSimpleModel, ISimpleModel {\n\n\treadonly model: ITextModel;\n\n\treadonly coordinatesConverter: ICoordinatesConverter;\n\n\treadonly viewLayout: IViewLayout;\n\n\treadonly cursorConfig: CursorConfiguration;\n\n\treadonly glyphLanes: IGlyphMarginLanesModel;\n\n\taddViewEventHandler(eventHandler: ViewEventHandler): void;\n\tremoveViewEventHandler(eventHandler: ViewEventHandler): void;\n\n\tgetEditorOption<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n\n\t/**\n\t * Gives a hint that a lot of requests are about to come in for these line numbers.\n\t */\n\tsetViewport(startLineNumber: number, endLineNumber: number, centeredLineNumber: number): void;\n\tvisibleLinesStabilized(): void;\n\tsetHasFocus(hasFocus: boolean): void;\n\tsetHasWidgetFocus(hasWidgetFocus: boolean): void;\n\tonCompositionStart(): void;\n\tonCompositionEnd(): void;\n\n\tgetFontSizeAtPosition(position: IPosition): string | null;\n\tgetMinimapDecorationsInRange(range: Range): ViewModelDecoration[];\n\tgetDecorationsInViewport(visibleRange: Range): ViewModelDecoration[];\n\tgetTextDirection(lineNumber: number): TextDirection;\n\tgetViewportViewLineRenderingData(visibleRange: Range, lineNumber: number): ViewLineRenderingData;\n\tgetViewLineRenderingData(lineNumber: number): ViewLineRenderingData;\n\tgetViewLineData(lineNumber: number): ViewLineData;\n\tgetMinimapLinesRenderingData(startLineNumber: number, endLineNumber: number, needed: boolean[]): MinimapLinesRenderingData;\n\tgetCompletelyVisibleViewRange(): Range;\n\tgetCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range;\n\tgetViewRangeWithCursorPadding(viewRange: Range): Range;\n\n\tgetHiddenAreas(): Range[];\n\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineLength(lineNumber: number): number;\n\tgetActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;\n\tgetLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[];\n\tgetBracketGuidesInRangeByLine(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\n\tgetAllOverviewRulerDecorations(theme: EditorTheme): OverviewRulerDecorationsGroup[];\n\tgetValueInRange(range: Range, eol: EndOfLinePreference): string;\n\tgetValueLengthInRange(range: Range, eol: EndOfLinePreference): number;\n\n\tgetInjectedTextAt(viewPosition: Position): InjectedText | null;\n\n\tdeduceModelPositionRelativeToViewPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position;\n\tgetPlainTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): { sourceRanges: Range[]; sourceText: string | string[] };\n\tgetRichTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean): { html: string; mode: string } | null;\n\n\tcreateLineBreaksComputer(): ILineBreaksComputer;\n\n\t//#region cursor\n\tgetPrimaryCursorState(): CursorState;\n\tgetLastAddedCursorIndex(): number;\n\tgetCursorStates(): CursorState[];\n\tsetCursorStates(source: string | null | undefined, reason: CursorChangeReason, states: PartialCursorState[] | null): boolean;\n\tgetCursorColumnSelectData(): IColumnSelectData;\n\tgetCursorAutoClosedCharacters(): Range[];\n\tsetCursorColumnSelectData(columnSelectData: IColumnSelectData): void;\n\tgetPrevEditOperationType(): EditOperationType;\n\tsetPrevEditOperationType(type: EditOperationType): void;\n\trevealAllCursors(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealPrimaryCursor(source: string | null | undefined, revealHorizontal: boolean, minimalReveal?: boolean): void;\n\trevealTopMostCursor(source: string | null | undefined): void;\n\trevealBottomMostCursor(source: string | null | undefined): void;\n\trevealRange(source: string | null | undefined, revealHorizontal: boolean, viewRange: Range, verticalType: VerticalRevealType, scrollType: ScrollType): void;\n\t//#endregion\n\n\t//#region viewLayout\n\tchangeWhitespace(callback: (accessor: IWhitespaceChangeAccessor) => void): void;\n}\n\nexport interface IViewLayout {\n\n\tgetScrollable(): Scrollable;\n\n\tgetScrollWidth(): number;\n\tgetScrollHeight(): number;\n\n\tgetCurrentScrollLeft(): number;\n\tgetCurrentScrollTop(): number;\n\tgetCurrentViewport(): Viewport;\n\n\tgetFutureViewport(): Viewport;\n\n\tsetScrollPosition(position: INewScrollPosition, type: ScrollType): void;\n\tdeltaScrollNow(deltaScrollLeft: number, deltaScrollTop: number): void;\n\n\tvalidateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition;\n\n\tsetMaxLineWidth(maxLineWidth: number): void;\n\tsetOverlayWidgetsMinWidth(overlayWidgetsMinWidth: number): void;\n\n\tgetLinesViewportData(): IPartialViewLinesViewportData;\n\tgetWhitespaces(): IEditorWhitespace[];\n\n\tisAfterLines(verticalOffset: number): boolean;\n\tisInTopPadding(verticalOffset: number): boolean;\n\tisInBottomPadding(verticalOffset: number): boolean;\n\tgetLineNumberAtVerticalOffset(verticalOffset: number): number;\n\tgetVerticalOffsetForLineNumber(lineNumber: number, includeViewZones?: boolean): number;\n\tgetVerticalOffsetAfterLineNumber(lineNumber: number, includeViewZones?: boolean): number;\n\tgetLineHeightForLineNumber(lineNumber: number): number;\n\tgetWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null;\n\n\t/**\n\t * Get the layout information for whitespaces currently in the viewport\n\t */\n\tgetWhitespaceViewportData(): IViewWhitespaceViewportData[];\n}\n\nexport interface IEditorWhitespace {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly height: number;\n}\n\n/**\n * An accessor that allows for whitespace to be added, removed or changed in bulk.\n */\nexport interface IWhitespaceChangeAccessor {\n\tinsertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): string;\n\tchangeOneWhitespace(id: string, newAfterLineNumber: number, newHeight: number): void;\n\tremoveWhitespace(id: string): void;\n}\n\nexport interface ILineHeightChangeAccessor {\n\tinsertOrChangeCustomLineHeight(decorationId: string, startLineNumber: number, endLineNumber: number, lineHeight: number): void;\n\tremoveCustomLineHeight(decorationId: string): void;\n}\n\nexport interface IPartialViewLinesViewportData {\n\t/**\n\t * Value to be substracted from `scrollTop` (in order to vertical offset numbers < 1MM)\n\t */\n\treadonly bigNumbersDelta: number;\n\t/**\n\t * The first (partially) visible line number.\n\t */\n\treadonly startLineNumber: number;\n\t/**\n\t * The last (partially) visible line number.\n\t */\n\treadonly endLineNumber: number;\n\t/**\n\t * relativeVerticalOffset[i] is the `top` position for line at `i` + `startLineNumber`.\n\t */\n\treadonly relativeVerticalOffset: number[];\n\t/**\n\t * The centered line in the viewport.\n\t */\n\treadonly centeredLineNumber: number;\n\t/**\n\t * The first completely visible line number.\n\t */\n\treadonly completelyVisibleStartLineNumber: number;\n\t/**\n\t * The last completely visible line number.\n\t */\n\treadonly completelyVisibleEndLineNumber: number;\n\n\t/**\n\t * The height of a line.\n\t */\n\treadonly lineHeight: number;\n}\n\nexport interface IViewWhitespaceViewportData {\n\treadonly id: string;\n\treadonly afterLineNumber: number;\n\treadonly verticalOffset: number;\n\treadonly height: number;\n}\n\nexport class Viewport {\n\treadonly _viewportBrand: void = undefined;\n\n\treadonly top: number;\n\treadonly left: number;\n\treadonly width: number;\n\treadonly height: number;\n\n\tconstructor(top: number, left: number, width: number, height: number) {\n\t\tthis.top = top | 0;\n\t\tthis.left = left | 0;\n\t\tthis.width = width | 0;\n\t\tthis.height = height | 0;\n\t}\n}\n\nexport class MinimapLinesRenderingData {\n\tpublic readonly tabSize: number;\n\tpublic readonly data: Array<ViewLineData | null>;\n\n\tconstructor(\n\t\ttabSize: number,\n\t\tdata: Array<ViewLineData | null>\n\t) {\n\t\tthis.tabSize = tabSize;\n\t\tthis.data = data;\n\t}\n}\n\nexport class ViewLineData {\n\t_viewLineDataBrand: void = undefined;\n\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent).\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\n\t/**\n\t * Additional inline decorations for this line.\n\t*/\n\tpublic readonly inlineDecorations: readonly SingleLineInlineDecoration[] | null;\n\n\tconstructor(\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tstartVisibleColumn: number,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: readonly SingleLineInlineDecoration[] | null\n\t) {\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t}\n}\n\nexport class ViewLineRenderingData {\n\t/**\n\t * The minimum allowed column at this view line.\n\t */\n\tpublic readonly minColumn: number;\n\t/**\n\t * The maximum allowed column at this view line.\n\t */\n\tpublic readonly maxColumn: number;\n\t/**\n\t * The content at this view line.\n\t */\n\tpublic readonly content: string;\n\t/**\n\t * Does this line continue with a wrapped line?\n\t */\n\tpublic readonly continuesWithWrappedLine: boolean;\n\t/**\n\t * Describes if `content` contains RTL characters.\n\t */\n\tpublic readonly containsRTL: boolean;\n\t/**\n\t * Describes if `content` contains non basic ASCII chars.\n\t */\n\tpublic readonly isBasicASCII: boolean;\n\t/**\n\t * The tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\t/**\n\t * Inline decorations at this view line.\n\t */\n\tpublic readonly inlineDecorations: InlineDecoration[];\n\t/**\n\t * The tab size for this view model.\n\t */\n\tpublic readonly tabSize: number;\n\t/**\n\t * The visible column at the start of the line (after the fauxIndent)\n\t */\n\tpublic readonly startVisibleColumn: number;\n\t/**\n\t * The direction to use for rendering the line.\n\t */\n\tpublic readonly textDirection: TextDirection;\n\t/**\n\t * Whether the line has variable fonts\n\t */\n\tpublic readonly hasVariableFonts: boolean;\n\n\tconstructor(\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tmightContainRTL: boolean,\n\t\tmightContainNonBasicASCII: boolean,\n\t\ttokens: IViewLineTokens,\n\t\tinlineDecorations: InlineDecoration[],\n\t\ttabSize: number,\n\t\tstartVisibleColumn: number,\n\t\ttextDirection: TextDirection,\n\t\thasVariableFonts: boolean\n\t) {\n\t\tthis.minColumn = minColumn;\n\t\tthis.maxColumn = maxColumn;\n\t\tthis.content = content;\n\t\tthis.continuesWithWrappedLine = continuesWithWrappedLine;\n\n\t\tthis.isBasicASCII = ViewLineRenderingData.isBasicASCII(content, mightContainNonBasicASCII);\n\t\tthis.containsRTL = ViewLineRenderingData.containsRTL(content, this.isBasicASCII, mightContainRTL);\n\n\t\tthis.tokens = tokens;\n\t\tthis.inlineDecorations = inlineDecorations;\n\t\tthis.tabSize = tabSize;\n\t\tthis.startVisibleColumn = startVisibleColumn;\n\t\tthis.textDirection = textDirection;\n\t\tthis.hasVariableFonts = hasVariableFonts;\n\t}\n\n\tpublic static isBasicASCII(lineContent: string, mightContainNonBasicASCII: boolean): boolean {\n\t\tif (mightContainNonBasicASCII) {\n\t\t\treturn strings.isBasicASCII(lineContent);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic static containsRTL(lineContent: string, isBasicASCII: boolean, mightContainRTL: boolean): boolean {\n\t\tif (!isBasicASCII && mightContainRTL) {\n\t\t\treturn strings.containsRTL(lineContent);\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport class ViewModelDecoration {\n\t_viewModelDecorationBrand: void = undefined;\n\n\tpublic readonly range: Range;\n\tpublic readonly options: IModelDecorationOptions;\n\n\tconstructor(range: Range, options: IModelDecorationOptions) {\n\t\tthis.range = range;\n\t\tthis.options = options;\n\t}\n}\n\nexport class OverviewRulerDecorationsGroup {\n\n\tconstructor(\n\t\tpublic readonly color: string,\n\t\tpublic readonly zIndex: number,\n\t\t/**\n\t\t * Decorations are encoded in a number array using the following scheme:\n\t\t * - 3*i = lane\n\t\t * - 3*i+1 = startLineNumber\n\t\t * - 3*i+2 = endLineNumber\n\t\t */\n\t\tpublic readonly data: number[]\n\t) { }\n\n\tpublic static compareByRenderingProps(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): number {\n\t\tif (a.zIndex === b.zIndex) {\n\t\t\tif (a.color < b.color) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.color > b.color) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\treturn a.zIndex - b.zIndex;\n\t}\n\n\tpublic static equals(a: OverviewRulerDecorationsGroup, b: OverviewRulerDecorationsGroup): boolean {\n\t\treturn (\n\t\t\ta.color === b.color\n\t\t\t&& a.zIndex === b.zIndex\n\t\t\t&& arrays.equals(a.data, b.data)\n\t\t);\n\t}\n\n\tpublic static equalsArr(a: OverviewRulerDecorationsGroup[], b: OverviewRulerDecorationsGroup[]): boolean {\n\t\treturn arrays.equals(a, b, OverviewRulerDecorationsGroup.equals);\n\t}\n}\n"]}
|
|
@@ -179,7 +179,7 @@ function executeClipboardCopyWithWorkaround(editor, clipboardService) {
|
|
|
179
179
|
// We have encountered the Electron bug!
|
|
180
180
|
// As a workaround, we will write (only the plaintext data) to the clipboard in a different way
|
|
181
181
|
// We will use the clipboard service (which in the native case will go to electron's clipboard API)
|
|
182
|
-
const { dataToCopy } = generateDataToCopyAndStoreInMemory(editor._getViewModel(),
|
|
182
|
+
const { dataToCopy } = generateDataToCopyAndStoreInMemory(editor._getViewModel(), undefined, browser.isFirefox);
|
|
183
183
|
clipboardService.writeText(dataToCopy.text);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
@@ -240,7 +240,7 @@ function logCopyCommand(editor) {
|
|
|
240
240
|
if (editContextEnabled) {
|
|
241
241
|
const nativeEditContext = NativeEditContextRegistry.get(editor.getId());
|
|
242
242
|
if (nativeEditContext) {
|
|
243
|
-
nativeEditContext.
|
|
243
|
+
nativeEditContext.handleWillCopy();
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
@@ -261,7 +261,7 @@ if (PasteAction) {
|
|
|
261
261
|
if (editContextEnabled) {
|
|
262
262
|
const nativeEditContext = NativeEditContextRegistry.get(focusedEditor.getId());
|
|
263
263
|
if (nativeEditContext) {
|
|
264
|
-
nativeEditContext.
|
|
264
|
+
nativeEditContext.handleWillPaste();
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
logService.trace('registerExecCommandImpl (before triggerPaste)');
|
|
@@ -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,iBAAiB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAErF,OA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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 } 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\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\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\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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K,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 * 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 } 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(), undefined, browser.isFirefox);\n\t\tclipboardService.writeText(dataToCopy.text);\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.handleWillCopy();\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.handleWillPaste();\n\t\t\t\t}\n\t\t\t}\n\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\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"]}
|
|
@@ -12,16 +12,14 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
var CopyPasteController_1;
|
|
15
|
-
import { addDisposableListener } from '../../../../base/browser/dom.js';
|
|
16
15
|
import { coalesce } from '../../../../base/common/arrays.js';
|
|
17
16
|
import { createCancelablePromise, DeferredPromise, raceCancellation } from '../../../../base/common/async.js';
|
|
18
17
|
import { CancellationTokenSource } from '../../../../base/common/cancellation.js';
|
|
19
|
-
import { createStringDataTransferItem, matchesMimeType, UriList } from '../../../../base/common/dataTransfer.js';
|
|
18
|
+
import { createStringDataTransferItem, matchesMimeType, UriList, VSDataTransfer } from '../../../../base/common/dataTransfer.js';
|
|
20
19
|
import { isCancellationError } from '../../../../base/common/errors.js';
|
|
21
20
|
import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';
|
|
22
21
|
import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
23
22
|
import { Mimes } from '../../../../base/common/mime.js';
|
|
24
|
-
import * as platform from '../../../../base/common/platform.js';
|
|
25
23
|
import { upcast } from '../../../../base/common/types.js';
|
|
26
24
|
import { generateUuid } from '../../../../base/common/uuid.js';
|
|
27
25
|
import { localize } from '../../../../nls.js';
|
|
@@ -33,10 +31,7 @@ import { IInstantiationService } from '../../../../platform/instantiation/common
|
|
|
33
31
|
import { ILogService } from '../../../../platform/log/common/log.js';
|
|
34
32
|
import { IProgressService } from '../../../../platform/progress/common/progress.js';
|
|
35
33
|
import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js';
|
|
36
|
-
import { ClipboardEventUtils, InMemoryClipboardMetadataManager } from '../../../browser/controller/editContext/clipboardUtils.js';
|
|
37
|
-
import { toExternalVSDataTransfer, toVSDataTransfer } from '../../../browser/dataTransfer.js';
|
|
38
34
|
import { IBulkEditService } from '../../../browser/services/bulkEditService.js';
|
|
39
|
-
import { Range } from '../../../common/core/range.js';
|
|
40
35
|
import { DocumentPasteTriggerKind } from '../../../common/languages.js';
|
|
41
36
|
import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';
|
|
42
37
|
import { EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js';
|
|
@@ -66,10 +61,9 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
66
61
|
this._quickInputService = _quickInputService;
|
|
67
62
|
this._progressService = _progressService;
|
|
68
63
|
this._editor = editor;
|
|
69
|
-
|
|
70
|
-
this._register(
|
|
71
|
-
this._register(
|
|
72
|
-
this._register(addDisposableListener(container, 'paste', e => this.handlePaste(e), true));
|
|
64
|
+
this._register(editor.onWillCopy(e => this.handleCopy(e)));
|
|
65
|
+
this._register(editor.onWillCut(e => this.handleCopy(e)));
|
|
66
|
+
this._register(editor.onWillPaste(e => this.handlePaste(e)));
|
|
73
67
|
this._pasteProgressManager = this._register(new InlineProgressManager('pasteIntoEditor', editor, instantiationService));
|
|
74
68
|
this._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'pasteIntoEditor', editor, pasteWidgetVisibleCtx, { id: changePasteTypeCommandId, label: localize(927, "Show paste options...") }, () => CopyPasteController_1._configureDefaultAction ? [CopyPasteController_1._configureDefaultAction] : []));
|
|
75
69
|
}
|
|
@@ -98,16 +92,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
98
92
|
await this._currentPasteOperation;
|
|
99
93
|
}
|
|
100
94
|
handleCopy(e) {
|
|
101
|
-
|
|
102
|
-
if (e.clipboardData) {
|
|
103
|
-
const [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);
|
|
104
|
-
const storedMetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);
|
|
105
|
-
id = storedMetadata?.id || null;
|
|
106
|
-
this._logService.trace('CopyPasteController#handleCopy for id : ', id, ' with text.length : ', text.length);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
this._logService.trace('CopyPasteController#handleCopy');
|
|
110
|
-
}
|
|
95
|
+
this._logService.trace('CopyPasteController#handleCopy');
|
|
111
96
|
if (!this._editor.hasTextFocus()) {
|
|
112
97
|
return;
|
|
113
98
|
}
|
|
@@ -115,28 +100,18 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
115
100
|
// This is needed because on web, the browser clipboard is faked out using an in-memory store.
|
|
116
101
|
// This means the resources clipboard is not properly updated when copying from the editor.
|
|
117
102
|
this._clipboardService.clearInternalState?.();
|
|
118
|
-
if (!
|
|
103
|
+
if (!this.isPasteAsEnabled()) {
|
|
119
104
|
return;
|
|
120
105
|
}
|
|
121
106
|
const model = this._editor.getModel();
|
|
107
|
+
const viewModel = this._editor._getViewModel();
|
|
122
108
|
const selections = this._editor.getSelections();
|
|
123
|
-
if (!model || !selections?.length) {
|
|
109
|
+
if (!model || !viewModel || !selections?.length) {
|
|
124
110
|
return;
|
|
125
111
|
}
|
|
126
|
-
const enableEmptySelectionClipboard = this._editor.getOption(45 /* EditorOption.emptySelectionClipboard */);
|
|
127
|
-
let ranges = selections;
|
|
128
|
-
const wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty();
|
|
129
|
-
if (wasFromEmptySelection) {
|
|
130
|
-
if (!enableEmptySelectionClipboard) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
ranges = [new Range(ranges[0].startLineNumber, 1, ranges[0].startLineNumber, 1 + model.getLineLength(ranges[0].startLineNumber))];
|
|
134
|
-
}
|
|
135
|
-
const toCopy = this._editor._getViewModel()?.getPlainTextToCopy(selections, enableEmptySelectionClipboard, platform.isWindows);
|
|
136
|
-
const multicursorText = Array.isArray(toCopy) ? toCopy : null;
|
|
137
112
|
const defaultPastePayload = {
|
|
138
|
-
multicursorText,
|
|
139
|
-
pasteOnNewLine:
|
|
113
|
+
multicursorText: e.dataToCopy.multicursorText ?? null,
|
|
114
|
+
pasteOnNewLine: e.dataToCopy.isFromEmptySelection,
|
|
140
115
|
mode: null
|
|
141
116
|
};
|
|
142
117
|
const providers = this._languageFeaturesService.documentPasteEditProvider
|
|
@@ -146,10 +121,10 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
146
121
|
this.setCopyMetadata(e.clipboardData, { defaultPastePayload });
|
|
147
122
|
return;
|
|
148
123
|
}
|
|
149
|
-
const dataTransfer =
|
|
124
|
+
const dataTransfer = new VSDataTransfer();
|
|
150
125
|
const providerCopyMimeTypes = providers.flatMap(x => x.copyMimeTypes ?? []);
|
|
151
126
|
// Save off a handle pointing to data that VS Code maintains.
|
|
152
|
-
const handle =
|
|
127
|
+
const handle = generateUuid();
|
|
153
128
|
this.setCopyMetadata(e.clipboardData, {
|
|
154
129
|
id: handle,
|
|
155
130
|
providerCopyMimeTypes,
|
|
@@ -158,7 +133,7 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
158
133
|
const operations = providers.map((provider) => {
|
|
159
134
|
return {
|
|
160
135
|
providerMimeTypes: provider.copyMimeTypes,
|
|
161
|
-
operation: createCancelablePromise(token => provider.prepareDocumentPaste(model,
|
|
136
|
+
operation: createCancelablePromise(token => provider.prepareDocumentPaste(model, e.dataToCopy.sourceRanges, dataTransfer, token)
|
|
162
137
|
.catch(err => {
|
|
163
138
|
console.error(err);
|
|
164
139
|
return undefined;
|
|
@@ -169,17 +144,15 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
169
144
|
CopyPasteController_1._currentCopyOperation = { handle, operations };
|
|
170
145
|
}
|
|
171
146
|
async handlePaste(e) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
this._logService.trace('CopyPasteController#handlePaste for id : ', metadataComputed?.id);
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
this._logService.trace('CopyPasteController#handlePaste');
|
|
147
|
+
this._logService.trace('CopyPasteController#handlePaste for id : ', e.metadata?.id);
|
|
148
|
+
if (!this._editor.hasTextFocus()) {
|
|
149
|
+
return;
|
|
179
150
|
}
|
|
180
|
-
|
|
151
|
+
const dataTransfer = e.toExternalVSDataTransfer();
|
|
152
|
+
if (!dataTransfer) {
|
|
181
153
|
return;
|
|
182
154
|
}
|
|
155
|
+
dataTransfer.delete(vscodeClipboardMime);
|
|
183
156
|
MessageController.get(this._editor)?.closeMessage();
|
|
184
157
|
this._currentPasteOperation?.cancel();
|
|
185
158
|
this._currentPasteOperation = undefined;
|
|
@@ -195,8 +168,6 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
195
168
|
}
|
|
196
169
|
const metadata = this.fetchCopyMetadata(e);
|
|
197
170
|
this._logService.trace('CopyPasteController#handlePaste with metadata : ', metadata?.id, ' and text.length : ', e.clipboardData.getData('text/plain').length);
|
|
198
|
-
const dataTransfer = toExternalVSDataTransfer(e.clipboardData);
|
|
199
|
-
dataTransfer.delete(vscodeClipboardMime);
|
|
200
171
|
const fileTypes = Array.from(e.clipboardData.files).map(file => file.type);
|
|
201
172
|
const allPotentialMimeTypes = [
|
|
202
173
|
...e.clipboardData.types,
|
|
@@ -224,21 +195,19 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
224
195
|
if (this._pasteAsActionContext?.preferred) {
|
|
225
196
|
this.showPasteAsNoEditMessage(selections, this._pasteAsActionContext.preferred);
|
|
226
197
|
// Also prevent default paste from applying
|
|
227
|
-
e.
|
|
228
|
-
e.stopImmediatePropagation();
|
|
198
|
+
e.setHandled();
|
|
229
199
|
}
|
|
230
200
|
return;
|
|
231
201
|
}
|
|
232
202
|
// Prevent the editor's default paste handler from running.
|
|
233
203
|
// Note that after this point, we are fully responsible for handling paste.
|
|
234
204
|
// If we can't provider a paste for any reason, we need to explicitly delegate pasting back to the editor.
|
|
235
|
-
e.
|
|
236
|
-
e.stopImmediatePropagation();
|
|
205
|
+
e.setHandled();
|
|
237
206
|
if (this._pasteAsActionContext) {
|
|
238
207
|
this.showPasteAsPick(this._pasteAsActionContext.preferred, allProviders, selections, dataTransfer, metadata);
|
|
239
208
|
}
|
|
240
209
|
else {
|
|
241
|
-
this.doPasteInline(allProviders, selections, dataTransfer, metadata, e);
|
|
210
|
+
this.doPasteInline(allProviders, selections, dataTransfer, metadata, e.browserEvent);
|
|
242
211
|
}
|
|
243
212
|
}
|
|
244
213
|
showPasteAsNoEditMessage(selections, preference) {
|
|
@@ -431,15 +400,12 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
431
400
|
title: localize(934, "Running paste handlers"),
|
|
432
401
|
}, () => p);
|
|
433
402
|
}
|
|
434
|
-
setCopyMetadata(
|
|
403
|
+
setCopyMetadata(clipboardData, metadata) {
|
|
435
404
|
this._logService.trace('CopyPasteController#setCopyMetadata new id : ', metadata.id);
|
|
436
|
-
|
|
405
|
+
clipboardData.setData(vscodeClipboardMime, JSON.stringify(metadata));
|
|
437
406
|
}
|
|
438
407
|
fetchCopyMetadata(e) {
|
|
439
408
|
this._logService.trace('CopyPasteController#fetchCopyMetadata');
|
|
440
|
-
if (!e.clipboardData) {
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
409
|
// Prefer using the clipboard data we saved off
|
|
444
410
|
const rawMetadata = e.clipboardData.getData(vscodeClipboardMime);
|
|
445
411
|
if (rawMetadata) {
|
|
@@ -450,14 +416,12 @@ let CopyPasteController = class CopyPasteController extends Disposable {
|
|
|
450
416
|
return undefined;
|
|
451
417
|
}
|
|
452
418
|
}
|
|
453
|
-
|
|
454
|
-
const [_, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);
|
|
455
|
-
if (metadata) {
|
|
419
|
+
if (e.metadata) {
|
|
456
420
|
return {
|
|
457
421
|
defaultPastePayload: {
|
|
458
|
-
mode: metadata.mode,
|
|
459
|
-
multicursorText: metadata.multicursorText ?? null,
|
|
460
|
-
pasteOnNewLine: !!metadata.isFromEmptySelection,
|
|
422
|
+
mode: e.metadata.mode,
|
|
423
|
+
multicursorText: e.metadata.multicursorText ?? null,
|
|
424
|
+
pasteOnNewLine: !!e.metadata.isFromEmptySelection,
|
|
461
425
|
},
|
|
462
426
|
};
|
|
463
427
|
}
|