monaco-editor-core 0.56.0-dev-20251223 → 0.56.0-dev-20251225

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.
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251223(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251225(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -118,7 +118,8 @@ export const CopyOptions = {
118
118
  electronBugWorkaroundCopyEventHasFired: false
119
119
  };
120
120
  export const PasteOptions = {
121
- electronBugWorkaroundPasteEventHasFired: false
121
+ electronBugWorkaroundPasteEventHasFired: false,
122
+ electronBugWorkaroundPasteEventLock: false
122
123
  };
123
124
  export const ClipboardEventUtils = {
124
125
  getTextData(clipboardData) {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/controller/editContext/clipboardUtils.ts","vs/editor/browser/controller/editContext/clipboardUtils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAe,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,UAAU,kCAAkC,CAAC,CAAiB,EAAE,OAAoB,EAAE,UAAuB,EAAE,SAAkB;IACtI,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC;IAC9C,IAAI,EAAE,GAAuB,SAAS,CAAC;IACvC,IAAI,UAAU,CAAC,QAAQ,EAAE,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC9C,EAAE,GAAG,YAAY,EAAE,CAAC;IACrB,CAAC;IAED,MAA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encies/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 *--------------------------------------------------------------------------------------------*/\nimport { IViewModel } from '../../../common/viewModel.js';\nimport { Range } from '../../../common/core/range.js';\nimport { isWindows } from '../../../../base/common/platform.js';\nimport { Mimes } from '../../../../base/common/mime.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ILogService, LogLevel } from '../../../../platform/log/common/log.js';\nimport { EditorOption, IComputedEditorOptions } from '../../../common/config/editorOptions.js';\nimport { generateUuid } from '../../../../base/common/uuid.js';\n\nexport function ensureClipboardGetsEditorSelection(e: ClipboardEvent, context: ViewContext, logService: ILogService, isFirefox: boolean): void {\n\tconst viewModel = context.viewModel;\n\tconst options = context.configuration.options;\n\tlet id: string | undefined = undefined;\n\tif (logService.getLevel() === LogLevel.Trace) {\n\t\tid = generateUuid();\n\t}\n\n\tconst { dataToCopy, storedMetadata } = generateDataToCopyAndStoreInMemory(viewModel, options, id, isFirefox);\n\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// !!!!!\n\t// We signal that we have executed a copy command\n\tCopyOptions.electronBugWorkaroundCopyEventHasFired = true;\n\n\te.preventDefault();\n\tif (e.clipboardData) {\n\t\tClipboardEventUtils.setTextData(e.clipboardData, dataToCopy.text, dataToCopy.html, storedMetadata);\n\t}\n\tlogService.trace('ensureClipboardGetsEditorSelection with id : ', id, ' with text.length: ', dataToCopy.text.length);\n}\n\nexport function generateDataToCopyAndStoreInMemory(viewModel: IViewModel, options: IComputedEditorOptions, id: string | undefined, isFirefox: boolean) {\n\tconst emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\tconst copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\tconst selections = viewModel.getCursorStates().map(cursorState => cursorState.modelState.selection);\n\tconst dataToCopy = getDataToCopy(viewModel, selections, emptySelectionClipboard, copyWithSyntaxHighlighting);\n\tconst storedMetadata: ClipboardStoredMetadata = {\n\t\tversion: 1,\n\t\tid,\n\t\tisFromEmptySelection: dataToCopy.isFromEmptySelection,\n\t\tmulticursorText: dataToCopy.multicursorText,\n\t\tmode: dataToCopy.mode\n\t};\n\tInMemoryClipboardMetadataManager.INSTANCE.set(\n\t\t// When writing \"LINE\\r\\n\" to the clipboard and then pasting,\n\t\t// Firefox pastes \"LINE\\n\", so let's work around this quirk\n\t\t(isFirefox ? dataToCopy.text.replace(/\\r\\n/g, '\\n') : dataToCopy.text),\n\t\tstoredMetadata\n\t);\n\treturn { dataToCopy, storedMetadata };\n}\n\nfunction getDataToCopy(viewModel: IViewModel, modelSelections: Range[], emptySelectionClipboard: boolean, copyWithSyntaxHighlighting: boolean): ClipboardDataToCopy {\n\tconst rawTextToCopy = viewModel.getPlainTextToCopy(modelSelections, emptySelectionClipboard, isWindows);\n\tconst newLineCharacter = viewModel.model.getEOL();\n\n\tconst isFromEmptySelection = (emptySelectionClipboard && modelSelections.length === 1 && modelSelections[0].isEmpty());\n\tconst multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null);\n\tconst text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy);\n\n\tlet html: string | null | undefined = undefined;\n\tlet mode: string | null = null;\n\tif (CopyOptions.forceCopyWithSyntaxHighlighting || (copyWithSyntaxHighlighting && text.length < 65536)) {\n\t\tconst richText = viewModel.getRichTextToCopy(modelSelections, emptySelectionClipboard);\n\t\tif (richText) {\n\t\t\thtml = richText.html;\n\t\t\tmode = richText.mode;\n\t\t}\n\t}\n\tconst dataToCopy: ClipboardDataToCopy = {\n\t\tisFromEmptySelection,\n\t\tmulticursorText,\n\t\ttext,\n\t\thtml,\n\t\tmode\n\t};\n\treturn dataToCopy;\n}\n\nexport interface IPasteData {\n\ttext: string;\n\tpasteOnNewLine: boolean;\n\tmulticursorText: string[] | null;\n\tmode: string | null;\n}\n\nexport function computePasteData(e: ClipboardEvent, context: ViewContext, logService: ILogService): IPasteData | undefined {\n\te.preventDefault();\n\tif (!e.clipboardData) {\n\t\treturn;\n\t}\n\tlet [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\tlogService.trace('computePasteData with id : ', metadata?.id, ' with text.length: ', text.length);\n\tif (!text) {\n\t\treturn;\n\t}\n\tPasteOptions.electronBugWorkaroundPasteEventHasFired = true;\n\tmetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\treturn getPasteDataFromMetadata(text, metadata, context);\n}\n\nexport function getPasteDataFromMetadata(text: string, metadata: ClipboardStoredMetadata | null, context: ViewContext): IPasteData {\n\tlet pasteOnNewLine = false;\n\tlet multicursorText: string[] | null = null;\n\tlet mode: string | null = null;\n\tif (metadata) {\n\t\tconst options = context.configuration.options;\n\t\tconst emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tpasteOnNewLine = emptySelectionClipboard && !!metadata.isFromEmptySelection;\n\t\tmulticursorText = typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null;\n\t\tmode = metadata.mode;\n\t}\n\treturn { text, pasteOnNewLine, multicursorText, mode };\n}\n/**\n * Every time we write to the clipboard, we record a bit of extra metadata here.\n * Every time we read from the cipboard, if the text matches our last written text,\n * we can fetch the previous metadata.\n */\nexport class InMemoryClipboardMetadataManager {\n\tpublic static readonly INSTANCE = new InMemoryClipboardMetadataManager();\n\n\tprivate _lastState: InMemoryClipboardMetadata | null;\n\n\tconstructor() {\n\t\tthis._lastState = null;\n\t}\n\n\tpublic set(lastCopiedValue: string, data: ClipboardStoredMetadata): void {\n\t\tthis._lastState = { lastCopiedValue, data };\n\t}\n\n\tpublic get(pastedText: string): ClipboardStoredMetadata | null {\n\t\tif (this._lastState && this._lastState.lastCopiedValue === pastedText) {\n\t\t\t// match!\n\t\t\treturn this._lastState.data;\n\t\t}\n\t\tthis._lastState = null;\n\t\treturn null;\n\t}\n}\n\nexport interface ClipboardDataToCopy {\n\tisFromEmptySelection: boolean;\n\tmulticursorText: string[] | null | undefined;\n\ttext: string;\n\thtml: string | null | undefined;\n\tmode: string | null;\n}\n\nexport interface ClipboardStoredMetadata {\n\tversion: 1;\n\tid: string | undefined;\n\tisFromEmptySelection: boolean | undefined;\n\tmulticursorText: string[] | null | undefined;\n\tmode: string | null;\n}\n\nexport const CopyOptions = {\n\tforceCopyWithSyntaxHighlighting: false,\n\telectronBugWorkaroundCopyEventHasFired: false\n};\n\nexport const PasteOptions = {\n\telectronBugWorkaroundPasteEventHasFired: false\n};\n\ninterface InMemoryClipboardMetadata {\n\tlastCopiedValue: string;\n\tdata: ClipboardStoredMetadata;\n}\n\nexport const ClipboardEventUtils = {\n\n\tgetTextData(clipboardData: DataTransfer): [string, ClipboardStoredMetadata | null] {\n\t\tconst text = clipboardData.getData(Mimes.text);\n\t\tlet metadata: ClipboardStoredMetadata | null = null;\n\t\tconst rawmetadata = clipboardData.getData('vscode-editor-data');\n\t\tif (typeof rawmetadata === 'string') {\n\t\t\ttry {\n\t\t\t\tmetadata = <ClipboardStoredMetadata>JSON.parse(rawmetadata);\n\t\t\t\tif (metadata.version !== 1) {\n\t\t\t\t\tmetadata = null;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// no problem!\n\t\t\t}\n\t\t}\n\t\tif (text.length === 0 && metadata === null && clipboardData.files.length > 0) {\n\t\t\t// no textual data pasted, generate text from file names\n\t\t\tconst files: File[] = Array.prototype.slice.call(clipboardData.files, 0);\n\t\t\treturn [files.map(file => file.name).join('\\n'), null];\n\t\t}\n\t\treturn [text, metadata];\n\t},\n\n\tsetTextData(clipboardData: DataTransfer, text: string, html: string | null | undefined, metadata: ClipboardStoredMetadata): void {\n\t\tclipboardData.setData(Mimes.text, text);\n\t\tif (typeof html === 'string') {\n\t\t\tclipboardData.setData('text/html', html);\n\t\t}\n\t\tclipboardData.setData('vscode-editor-data', JSON.stringify(metadata));\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 *--------------------------------------------------------------------------------------------*/\nimport { IViewModel } from '../../../common/viewModel.js';\nimport { Range } from '../../../common/core/range.js';\nimport { isWindows } from '../../../../base/common/platform.js';\nimport { Mimes } from '../../../../base/common/mime.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ILogService, LogLevel } from '../../../../platform/log/common/log.js';\nimport { EditorOption, IComputedEditorOptions } from '../../../common/config/editorOptions.js';\nimport { generateUuid } from '../../../../base/common/uuid.js';\n\nexport function ensureClipboardGetsEditorSelection(e: ClipboardEvent, context: ViewContext, logService: ILogService, isFirefox: boolean): void {\n\tconst viewModel = context.viewModel;\n\tconst options = context.configuration.options;\n\tlet id: string | undefined = undefined;\n\tif (logService.getLevel() === LogLevel.Trace) {\n\t\tid = generateUuid();\n\t}\n\n\tconst { dataToCopy, storedMetadata } = generateDataToCopyAndStoreInMemory(viewModel, options, id, isFirefox);\n\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// !!!!!\n\t// We signal that we have executed a copy command\n\tCopyOptions.electronBugWorkaroundCopyEventHasFired = true;\n\n\te.preventDefault();\n\tif (e.clipboardData) {\n\t\tClipboardEventUtils.setTextData(e.clipboardData, dataToCopy.text, dataToCopy.html, storedMetadata);\n\t}\n\tlogService.trace('ensureClipboardGetsEditorSelection with id : ', id, ' with text.length: ', dataToCopy.text.length);\n}\n\nexport function generateDataToCopyAndStoreInMemory(viewModel: IViewModel, options: IComputedEditorOptions, id: string | undefined, isFirefox: boolean) {\n\tconst emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\tconst copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\tconst selections = viewModel.getCursorStates().map(cursorState => cursorState.modelState.selection);\n\tconst dataToCopy = getDataToCopy(viewModel, selections, emptySelectionClipboard, copyWithSyntaxHighlighting);\n\tconst storedMetadata: ClipboardStoredMetadata = {\n\t\tversion: 1,\n\t\tid,\n\t\tisFromEmptySelection: dataToCopy.isFromEmptySelection,\n\t\tmulticursorText: dataToCopy.multicursorText,\n\t\tmode: dataToCopy.mode\n\t};\n\tInMemoryClipboardMetadataManager.INSTANCE.set(\n\t\t// When writing \"LINE\\r\\n\" to the clipboard and then pasting,\n\t\t// Firefox pastes \"LINE\\n\", so let's work around this quirk\n\t\t(isFirefox ? dataToCopy.text.replace(/\\r\\n/g, '\\n') : dataToCopy.text),\n\t\tstoredMetadata\n\t);\n\treturn { dataToCopy, storedMetadata };\n}\n\nfunction getDataToCopy(viewModel: IViewModel, modelSelections: Range[], emptySelectionClipboard: boolean, copyWithSyntaxHighlighting: boolean): ClipboardDataToCopy {\n\tconst rawTextToCopy = viewModel.getPlainTextToCopy(modelSelections, emptySelectionClipboard, isWindows);\n\tconst newLineCharacter = viewModel.model.getEOL();\n\n\tconst isFromEmptySelection = (emptySelectionClipboard && modelSelections.length === 1 && modelSelections[0].isEmpty());\n\tconst multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null);\n\tconst text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy);\n\n\tlet html: string | null | undefined = undefined;\n\tlet mode: string | null = null;\n\tif (CopyOptions.forceCopyWithSyntaxHighlighting || (copyWithSyntaxHighlighting && text.length < 65536)) {\n\t\tconst richText = viewModel.getRichTextToCopy(modelSelections, emptySelectionClipboard);\n\t\tif (richText) {\n\t\t\thtml = richText.html;\n\t\t\tmode = richText.mode;\n\t\t}\n\t}\n\tconst dataToCopy: ClipboardDataToCopy = {\n\t\tisFromEmptySelection,\n\t\tmulticursorText,\n\t\ttext,\n\t\thtml,\n\t\tmode\n\t};\n\treturn dataToCopy;\n}\n\nexport interface IPasteData {\n\ttext: string;\n\tpasteOnNewLine: boolean;\n\tmulticursorText: string[] | null;\n\tmode: string | null;\n}\n\nexport function computePasteData(e: ClipboardEvent, context: ViewContext, logService: ILogService): IPasteData | undefined {\n\te.preventDefault();\n\tif (!e.clipboardData) {\n\t\treturn;\n\t}\n\tlet [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\tlogService.trace('computePasteData with id : ', metadata?.id, ' with text.length: ', text.length);\n\tif (!text) {\n\t\treturn;\n\t}\n\tPasteOptions.electronBugWorkaroundPasteEventHasFired = true;\n\tmetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\treturn getPasteDataFromMetadata(text, metadata, context);\n}\n\nexport function getPasteDataFromMetadata(text: string, metadata: ClipboardStoredMetadata | null, context: ViewContext): IPasteData {\n\tlet pasteOnNewLine = false;\n\tlet multicursorText: string[] | null = null;\n\tlet mode: string | null = null;\n\tif (metadata) {\n\t\tconst options = context.configuration.options;\n\t\tconst emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tpasteOnNewLine = emptySelectionClipboard && !!metadata.isFromEmptySelection;\n\t\tmulticursorText = typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null;\n\t\tmode = metadata.mode;\n\t}\n\treturn { text, pasteOnNewLine, multicursorText, mode };\n}\n/**\n * Every time we write to the clipboard, we record a bit of extra metadata here.\n * Every time we read from the cipboard, if the text matches our last written text,\n * we can fetch the previous metadata.\n */\nexport class InMemoryClipboardMetadataManager {\n\tpublic static readonly INSTANCE = new InMemoryClipboardMetadataManager();\n\n\tprivate _lastState: InMemoryClipboardMetadata | null;\n\n\tconstructor() {\n\t\tthis._lastState = null;\n\t}\n\n\tpublic set(lastCopiedValue: string, data: ClipboardStoredMetadata): void {\n\t\tthis._lastState = { lastCopiedValue, data };\n\t}\n\n\tpublic get(pastedText: string): ClipboardStoredMetadata | null {\n\t\tif (this._lastState && this._lastState.lastCopiedValue === pastedText) {\n\t\t\t// match!\n\t\t\treturn this._lastState.data;\n\t\t}\n\t\tthis._lastState = null;\n\t\treturn null;\n\t}\n}\n\nexport interface ClipboardDataToCopy {\n\tisFromEmptySelection: boolean;\n\tmulticursorText: string[] | null | undefined;\n\ttext: string;\n\thtml: string | null | undefined;\n\tmode: string | null;\n}\n\nexport interface ClipboardStoredMetadata {\n\tversion: 1;\n\tid: string | undefined;\n\tisFromEmptySelection: boolean | undefined;\n\tmulticursorText: string[] | null | undefined;\n\tmode: string | null;\n}\n\nexport const CopyOptions = {\n\tforceCopyWithSyntaxHighlighting: false,\n\telectronBugWorkaroundCopyEventHasFired: false\n};\n\nexport const PasteOptions = {\n\telectronBugWorkaroundPasteEventHasFired: false\n};\n\ninterface InMemoryClipboardMetadata {\n\tlastCopiedValue: string;\n\tdata: ClipboardStoredMetadata;\n}\n\nexport const ClipboardEventUtils = {\n\n\tgetTextData(clipboardData: DataTransfer): [string, ClipboardStoredMetadata | null] {\n\t\tconst text = clipboardData.getData(Mimes.text);\n\t\tlet metadata: ClipboardStoredMetadata | null = null;\n\t\tconst rawmetadata = clipboardData.getData('vscode-editor-data');\n\t\tif (typeof rawmetadata === 'string') {\n\t\t\ttry {\n\t\t\t\tmetadata = <ClipboardStoredMetadata>JSON.parse(rawmetadata);\n\t\t\t\tif (metadata.version !== 1) {\n\t\t\t\t\tmetadata = null;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// no problem!\n\t\t\t}\n\t\t}\n\t\tif (text.length === 0 && metadata === null && clipboardData.files.length > 0) {\n\t\t\t// no textual data pasted, generate text from file names\n\t\t\tconst files: File[] = Array.prototype.slice.call(clipboardData.files, 0);\n\t\t\treturn [files.map(file => file.name).join('\\n'), null];\n\t\t}\n\t\treturn [text, metadata];\n\t},\n\n\tsetTextData(clipboardData: DataTransfer, text: string, html: string | null | undefined, metadata: ClipboardStoredMetadata): void {\n\t\tclipboardData.setData(Mimes.text, text);\n\t\tif (typeof html === 'string') {\n\t\t\tclipboardData.setData('text/html', html);\n\t\t}\n\t\tclipboardData.setData('vscode-editor-data', JSON.stringify(metadata));\n\t}\n};\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/controller/editContext/clipboardUtils.ts","vs/editor/browser/controller/editContext/clipboardUtils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAe,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,UAAU,kCAAkC,CAAC,CAAiB,EAAE,OAAoB,EAAE,UAAuB,EAAE,SAAkB;IACtI,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC;IAC9C,IAAI,EAAE,GAAuB,SAAS,CAAC;IACvC,IAAI,UAAU,CAAC,QAAQ,EAAE,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC9C,EAAE,GAAG,YAAY,EAAE,CAAC;IACrB,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,kCAAkC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;IAE7G,QAAQ;IACR,kEAAkE;IAClE,gFAAgF;IAChF,QAAQ;IACR,iDAAiD;IACjD,WAAW,CAAC,sCAAsC,GAAG,IAAI,CAAC;IAE1D,CAAC,CAAC,cAAc,EAAE,CAAC;IACnB,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;QACrB,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACpG,CAAC;IACD,UAAU,CAAC,KAAK,CAAC,+CAA+C,EAAE,EAAE,EAAE,qBAAqB,EAAE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wD;YACxD,MAAM,KAAK,GAAW,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACzE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,WAAW,CAAC,aAA2B,EAAE,IAAY,EAAE,IAA+B,EAAE,QAAiC;QACxH,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACxC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9B,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;QACD,aAAa,CAAC,OAAO,CAAC,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvE,CAAC;CACD,CAAC","file":"clipboardUtils.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 *--------------------------------------------------------------------------------------------*/\nimport { IViewModel } from '../../../common/viewModel.js';\nimport { Range } from '../../../common/core/range.js';\nimport { isWindows } from '../../../../base/common/platform.js';\nimport { Mimes } from '../../../../base/common/mime.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ILogService, LogLevel } from '../../../../platform/log/common/log.js';\nimport { EditorOption, IComputedEditorOptions } from '../../../common/config/editorOptions.js';\nimport { generateUuid } from '../../../../base/common/uuid.js';\n\nexport function ensureClipboardGetsEditorSelection(e: ClipboardEvent, context: ViewContext, logService: ILogService, isFirefox: boolean): void {\n\tconst viewModel = context.viewModel;\n\tconst options = context.configuration.options;\n\tlet id: string | undefined = undefined;\n\tif (logService.getLevel() === LogLevel.Trace) {\n\t\tid = generateUuid();\n\t}\n\n\tconst { dataToCopy, storedMetadata } = generateDataToCopyAndStoreInMemory(viewModel, options, id, isFirefox);\n\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// !!!!!\n\t// We signal that we have executed a copy command\n\tCopyOptions.electronBugWorkaroundCopyEventHasFired = true;\n\n\te.preventDefault();\n\tif (e.clipboardData) {\n\t\tClipboardEventUtils.setTextData(e.clipboardData, dataToCopy.text, dataToCopy.html, storedMetadata);\n\t}\n\tlogService.trace('ensureClipboardGetsEditorSelection with id : ', id, ' with text.length: ', dataToCopy.text.length);\n}\n\nexport function generateDataToCopyAndStoreInMemory(viewModel: IViewModel, options: IComputedEditorOptions, id: string | undefined, isFirefox: boolean) {\n\tconst emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\tconst copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\tconst selections = viewModel.getCursorStates().map(cursorState => cursorState.modelState.selection);\n\tconst dataToCopy = getDataToCopy(viewModel, selections, emptySelectionClipboard, copyWithSyntaxHighlighting);\n\tconst storedMetadata: ClipboardStoredMetadata = {\n\t\tversion: 1,\n\t\tid,\n\t\tisFromEmptySelection: dataToCopy.isFromEmptySelection,\n\t\tmulticursorText: dataToCopy.multicursorText,\n\t\tmode: dataToCopy.mode\n\t};\n\tInMemoryClipboardMetadataManager.INSTANCE.set(\n\t\t// When writing \"LINE\\r\\n\" to the clipboard and then pasting,\n\t\t// Firefox pastes \"LINE\\n\", so let's work around this quirk\n\t\t(isFirefox ? dataToCopy.text.replace(/\\r\\n/g, '\\n') : dataToCopy.text),\n\t\tstoredMetadata\n\t);\n\treturn { dataToCopy, storedMetadata };\n}\n\nfunction getDataToCopy(viewModel: IViewModel, modelSelections: Range[], emptySelectionClipboard: boolean, copyWithSyntaxHighlighting: boolean): ClipboardDataToCopy {\n\tconst rawTextToCopy = viewModel.getPlainTextToCopy(modelSelections, emptySelectionClipboard, isWindows);\n\tconst newLineCharacter = viewModel.model.getEOL();\n\n\tconst isFromEmptySelection = (emptySelectionClipboard && modelSelections.length === 1 && modelSelections[0].isEmpty());\n\tconst multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null);\n\tconst text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy);\n\n\tlet html: string | null | undefined = undefined;\n\tlet mode: string | null = null;\n\tif (CopyOptions.forceCopyWithSyntaxHighlighting || (copyWithSyntaxHighlighting && text.length < 65536)) {\n\t\tconst richText = viewModel.getRichTextToCopy(modelSelections, emptySelectionClipboard);\n\t\tif (richText) {\n\t\t\thtml = richText.html;\n\t\t\tmode = richText.mode;\n\t\t}\n\t}\n\tconst dataToCopy: ClipboardDataToCopy = {\n\t\tisFromEmptySelection,\n\t\tmulticursorText,\n\t\ttext,\n\t\thtml,\n\t\tmode\n\t};\n\treturn dataToCopy;\n}\n\nexport interface IPasteData {\n\ttext: string;\n\tpasteOnNewLine: boolean;\n\tmulticursorText: string[] | null;\n\tmode: string | null;\n}\n\nexport function computePasteData(e: ClipboardEvent, context: ViewContext, logService: ILogService): IPasteData | undefined {\n\te.preventDefault();\n\tif (!e.clipboardData) {\n\t\treturn;\n\t}\n\tlet [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\tlogService.trace('computePasteData with id : ', metadata?.id, ' with text.length: ', text.length);\n\tif (!text) {\n\t\treturn;\n\t}\n\tPasteOptions.electronBugWorkaroundPasteEventHasFired = true;\n\tmetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\treturn getPasteDataFromMetadata(text, metadata, context);\n}\n\nexport function getPasteDataFromMetadata(text: string, metadata: ClipboardStoredMetadata | null, context: ViewContext): IPasteData {\n\tlet pasteOnNewLine = false;\n\tlet multicursorText: string[] | null = null;\n\tlet mode: string | null = null;\n\tif (metadata) {\n\t\tconst options = context.configuration.options;\n\t\tconst emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tpasteOnNewLine = emptySelectionClipboard && !!metadata.isFromEmptySelection;\n\t\tmulticursorText = typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null;\n\t\tmode = metadata.mode;\n\t}\n\treturn { text, pasteOnNewLine, multicursorText, mode };\n}\n/**\n * Every time we write to the clipboard, we record a bit of extra metadata here.\n * Every time we read from the cipboard, if the text matches our last written text,\n * we can fetch the previous metadata.\n */\nexport class InMemoryClipboardMetadataManager {\n\tpublic static readonly INSTANCE = new InMemoryClipboardMetadataManager();\n\n\tprivate _lastState: InMemoryClipboardMetadata | null;\n\n\tconstructor() {\n\t\tthis._lastState = null;\n\t}\n\n\tpublic set(lastCopiedValue: string, data: ClipboardStoredMetadata): void {\n\t\tthis._lastState = { lastCopiedValue, data };\n\t}\n\n\tpublic get(pastedText: string): ClipboardStoredMetadata | null {\n\t\tif (this._lastState && this._lastState.lastCopiedValue === pastedText) {\n\t\t\t// match!\n\t\t\treturn this._lastState.data;\n\t\t}\n\t\tthis._lastState = null;\n\t\treturn null;\n\t}\n}\n\nexport interface ClipboardDataToCopy {\n\tisFromEmptySelection: boolean;\n\tmulticursorText: string[] | null | undefined;\n\ttext: string;\n\thtml: string | null | undefined;\n\tmode: string | null;\n}\n\nexport interface ClipboardStoredMetadata {\n\tversion: 1;\n\tid: string | undefined;\n\tisFromEmptySelection: boolean | undefined;\n\tmulticursorText: string[] | null | undefined;\n\tmode: string | null;\n}\n\nexport const CopyOptions = {\n\tforceCopyWithSyntaxHighlighting: false,\n\telectronBugWorkaroundCopyEventHasFired: false\n};\n\nexport const PasteOptions = {\n\telectronBugWorkaroundPasteEventHasFired: false,\n\telectronBugWorkaroundPasteEventLock: false\n};\n\ninterface InMemoryClipboardMetadata {\n\tlastCopiedValue: string;\n\tdata: ClipboardStoredMetadata;\n}\n\nexport const ClipboardEventUtils = {\n\n\tgetTextData(clipboardData: DataTransfer): [string, ClipboardStoredMetadata | null] {\n\t\tconst text = clipboardData.getData(Mimes.text);\n\t\tlet metadata: ClipboardStoredMetadata | null = null;\n\t\tconst rawmetadata = clipboardData.getData('vscode-editor-data');\n\t\tif (typeof rawmetadata === 'string') {\n\t\t\ttry {\n\t\t\t\tmetadata = <ClipboardStoredMetadata>JSON.parse(rawmetadata);\n\t\t\t\tif (metadata.version !== 1) {\n\t\t\t\t\tmetadata = null;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// no problem!\n\t\t\t}\n\t\t}\n\t\tif (text.length === 0 && metadata === null && clipboardData.files.length > 0) {\n\t\t\t// no textual data pasted, generate text from file names\n\t\t\tconst files: File[] = Array.prototype.slice.call(clipboardData.files, 0);\n\t\t\treturn [files.map(file => file.name).join('\\n'), null];\n\t\t}\n\t\treturn [text, metadata];\n\t},\n\n\tsetTextData(clipboardData: DataTransfer, text: string, html: string | null | undefined, metadata: ClipboardStoredMetadata): void {\n\t\tclipboardData.setData(Mimes.text, text);\n\t\tif (typeof html === 'string') {\n\t\t\tclipboardData.setData('text/html', html);\n\t\t}\n\t\tclipboardData.setData('vscode-editor-data', JSON.stringify(metadata));\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 *--------------------------------------------------------------------------------------------*/\nimport { IViewModel } from '../../../common/viewModel.js';\nimport { Range } from '../../../common/core/range.js';\nimport { isWindows } from '../../../../base/common/platform.js';\nimport { Mimes } from '../../../../base/common/mime.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ILogService, LogLevel } from '../../../../platform/log/common/log.js';\nimport { EditorOption, IComputedEditorOptions } from '../../../common/config/editorOptions.js';\nimport { generateUuid } from '../../../../base/common/uuid.js';\n\nexport function ensureClipboardGetsEditorSelection(e: ClipboardEvent, context: ViewContext, logService: ILogService, isFirefox: boolean): void {\n\tconst viewModel = context.viewModel;\n\tconst options = context.configuration.options;\n\tlet id: string | undefined = undefined;\n\tif (logService.getLevel() === LogLevel.Trace) {\n\t\tid = generateUuid();\n\t}\n\n\tconst { dataToCopy, storedMetadata } = generateDataToCopyAndStoreInMemory(viewModel, options, id, isFirefox);\n\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// !!!!!\n\t// We signal that we have executed a copy command\n\tCopyOptions.electronBugWorkaroundCopyEventHasFired = true;\n\n\te.preventDefault();\n\tif (e.clipboardData) {\n\t\tClipboardEventUtils.setTextData(e.clipboardData, dataToCopy.text, dataToCopy.html, storedMetadata);\n\t}\n\tlogService.trace('ensureClipboardGetsEditorSelection with id : ', id, ' with text.length: ', dataToCopy.text.length);\n}\n\nexport function generateDataToCopyAndStoreInMemory(viewModel: IViewModel, options: IComputedEditorOptions, id: string | undefined, isFirefox: boolean) {\n\tconst emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\tconst copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\tconst selections = viewModel.getCursorStates().map(cursorState => cursorState.modelState.selection);\n\tconst dataToCopy = getDataToCopy(viewModel, selections, emptySelectionClipboard, copyWithSyntaxHighlighting);\n\tconst storedMetadata: ClipboardStoredMetadata = {\n\t\tversion: 1,\n\t\tid,\n\t\tisFromEmptySelection: dataToCopy.isFromEmptySelection,\n\t\tmulticursorText: dataToCopy.multicursorText,\n\t\tmode: dataToCopy.mode\n\t};\n\tInMemoryClipboardMetadataManager.INSTANCE.set(\n\t\t// When writing \"LINE\\r\\n\" to the clipboard and then pasting,\n\t\t// Firefox pastes \"LINE\\n\", so let's work around this quirk\n\t\t(isFirefox ? dataToCopy.text.replace(/\\r\\n/g, '\\n') : dataToCopy.text),\n\t\tstoredMetadata\n\t);\n\treturn { dataToCopy, storedMetadata };\n}\n\nfunction getDataToCopy(viewModel: IViewModel, modelSelections: Range[], emptySelectionClipboard: boolean, copyWithSyntaxHighlighting: boolean): ClipboardDataToCopy {\n\tconst rawTextToCopy = viewModel.getPlainTextToCopy(modelSelections, emptySelectionClipboard, isWindows);\n\tconst newLineCharacter = viewModel.model.getEOL();\n\n\tconst isFromEmptySelection = (emptySelectionClipboard && modelSelections.length === 1 && modelSelections[0].isEmpty());\n\tconst multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null);\n\tconst text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy);\n\n\tlet html: string | null | undefined = undefined;\n\tlet mode: string | null = null;\n\tif (CopyOptions.forceCopyWithSyntaxHighlighting || (copyWithSyntaxHighlighting && text.length < 65536)) {\n\t\tconst richText = viewModel.getRichTextToCopy(modelSelections, emptySelectionClipboard);\n\t\tif (richText) {\n\t\t\thtml = richText.html;\n\t\t\tmode = richText.mode;\n\t\t}\n\t}\n\tconst dataToCopy: ClipboardDataToCopy = {\n\t\tisFromEmptySelection,\n\t\tmulticursorText,\n\t\ttext,\n\t\thtml,\n\t\tmode\n\t};\n\treturn dataToCopy;\n}\n\nexport interface IPasteData {\n\ttext: string;\n\tpasteOnNewLine: boolean;\n\tmulticursorText: string[] | null;\n\tmode: string | null;\n}\n\nexport function computePasteData(e: ClipboardEvent, context: ViewContext, logService: ILogService): IPasteData | undefined {\n\te.preventDefault();\n\tif (!e.clipboardData) {\n\t\treturn;\n\t}\n\tlet [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n\tlogService.trace('computePasteData with id : ', metadata?.id, ' with text.length: ', text.length);\n\tif (!text) {\n\t\treturn;\n\t}\n\tPasteOptions.electronBugWorkaroundPasteEventHasFired = true;\n\tmetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n\treturn getPasteDataFromMetadata(text, metadata, context);\n}\n\nexport function getPasteDataFromMetadata(text: string, metadata: ClipboardStoredMetadata | null, context: ViewContext): IPasteData {\n\tlet pasteOnNewLine = false;\n\tlet multicursorText: string[] | null = null;\n\tlet mode: string | null = null;\n\tif (metadata) {\n\t\tconst options = context.configuration.options;\n\t\tconst emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tpasteOnNewLine = emptySelectionClipboard && !!metadata.isFromEmptySelection;\n\t\tmulticursorText = typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null;\n\t\tmode = metadata.mode;\n\t}\n\treturn { text, pasteOnNewLine, multicursorText, mode };\n}\n/**\n * Every time we write to the clipboard, we record a bit of extra metadata here.\n * Every time we read from the cipboard, if the text matches our last written text,\n * we can fetch the previous metadata.\n */\nexport class InMemoryClipboardMetadataManager {\n\tpublic static readonly INSTANCE = new InMemoryClipboardMetadataManager();\n\n\tprivate _lastState: InMemoryClipboardMetadata | null;\n\n\tconstructor() {\n\t\tthis._lastState = null;\n\t}\n\n\tpublic set(lastCopiedValue: string, data: ClipboardStoredMetadata): void {\n\t\tthis._lastState = { lastCopiedValue, data };\n\t}\n\n\tpublic get(pastedText: string): ClipboardStoredMetadata | null {\n\t\tif (this._lastState && this._lastState.lastCopiedValue === pastedText) {\n\t\t\t// match!\n\t\t\treturn this._lastState.data;\n\t\t}\n\t\tthis._lastState = null;\n\t\treturn null;\n\t}\n}\n\nexport interface ClipboardDataToCopy {\n\tisFromEmptySelection: boolean;\n\tmulticursorText: string[] | null | undefined;\n\ttext: string;\n\thtml: string | null | undefined;\n\tmode: string | null;\n}\n\nexport interface ClipboardStoredMetadata {\n\tversion: 1;\n\tid: string | undefined;\n\tisFromEmptySelection: boolean | undefined;\n\tmulticursorText: string[] | null | undefined;\n\tmode: string | null;\n}\n\nexport const CopyOptions = {\n\tforceCopyWithSyntaxHighlighting: false,\n\telectronBugWorkaroundCopyEventHasFired: false\n};\n\nexport const PasteOptions = {\n\telectronBugWorkaroundPasteEventHasFired: false,\n\telectronBugWorkaroundPasteEventLock: false\n};\n\ninterface InMemoryClipboardMetadata {\n\tlastCopiedValue: string;\n\tdata: ClipboardStoredMetadata;\n}\n\nexport const ClipboardEventUtils = {\n\n\tgetTextData(clipboardData: DataTransfer): [string, ClipboardStoredMetadata | null] {\n\t\tconst text = clipboardData.getData(Mimes.text);\n\t\tlet metadata: ClipboardStoredMetadata | null = null;\n\t\tconst rawmetadata = clipboardData.getData('vscode-editor-data');\n\t\tif (typeof rawmetadata === 'string') {\n\t\t\ttry {\n\t\t\t\tmetadata = <ClipboardStoredMetadata>JSON.parse(rawmetadata);\n\t\t\t\tif (metadata.version !== 1) {\n\t\t\t\t\tmetadata = null;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// no problem!\n\t\t\t}\n\t\t}\n\t\tif (text.length === 0 && metadata === null && clipboardData.files.length > 0) {\n\t\t\t// no textual data pasted, generate text from file names\n\t\t\tconst files: File[] = Array.prototype.slice.call(clipboardData.files, 0);\n\t\t\treturn [files.map(file => file.name).join('\\n'), null];\n\t\t}\n\t\treturn [text, metadata];\n\t},\n\n\tsetTextData(clipboardData: DataTransfer, text: string, html: string | null | undefined, metadata: ClipboardStoredMetadata): void {\n\t\tclipboardData.setData(Mimes.text, text);\n\t\tif (typeof html === 'string') {\n\t\t\tclipboardData.setData('text/html', html);\n\t\t}\n\t\tclipboardData.setData('vscode-editor-data', JSON.stringify(metadata));\n\t}\n};\n"]}
@@ -84,8 +84,8 @@ function _findMatches(model, regex) {
84
84
  }
85
85
  function computeColors(model) {
86
86
  const result = [];
87
- // Early validation for RGB and HSL
88
- const initialValidationRegex = /\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm;
87
+ // Early validation for RGB and HSL (including CSS Level 4 syntax with / separator)
88
+ const initialValidationRegex = /\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%\/]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm;
89
89
  const initialValidationMatches = _findMatches(model, initialValidationRegex);
90
90
  // Potential colors have been found, validate the parameters
91
91
  if (initialValidationMatches.length > 0) {
@@ -98,11 +98,13 @@ function computeColors(model) {
98
98
  }
99
99
  let colorInformation;
100
100
  if (colorScheme === 'rgb') {
101
- const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;
101
+ // Supports both comma-separated (rgb(255, 0, 0)) and CSS Level 4 space-separated syntax (rgb(255 0 0))
102
+ const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*[\s,]\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*[\s,]\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;
102
103
  colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);
103
104
  }
104
105
  else if (colorScheme === 'rgba') {
105
- const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;
106
+ // Supports both comma-separated (rgba(255, 0, 0, 0.5)) and CSS Level 4 syntax (rgba(255 0 0 / 0.5))
107
+ const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*[\s,]\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*[\s,]\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*(?:[\s,]|[\s]*\/)\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;
106
108
  colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);
107
109
  }
108
110
  else if (colorScheme === 'hsl') {
@@ -110,7 +112,8 @@ function computeColors(model) {
110
112
  colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);
111
113
  }
112
114
  else if (colorScheme === 'hsla') {
113
- const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100(?:\.0+)?|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100(?:\.0+)?|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;
115
+ // Supports both comma-separated (hsla(253, 100%, 50%, 0.5)) and CSS Level 4 syntax (hsla(253 100% 50% / 0.5))
116
+ const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100(?:\.0+)?|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100(?:\.0+)?|\d{1,2}[.]\d*|\d{1,2})%\s*(?:[\s,]|[\s]*\/)\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;
114
117
  colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);
115
118
  }
116
119
  else if (colorScheme === '#') {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/defaultDocumentColorsComputer.ts","vs/editor/common/languages/defaultDocumentColorsComputer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAW5D,SAAS,mBAAmB,CAAC,aAAuC;IACnE,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QAC1C,IAAI,YAAY,IAAI,YAAY,KAAK,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC;YAClF,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,SAAS,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IAC5D,OAAO;QACN,GAAG,EAAE,CAAC,GAAG,GAAG;QACZ,IAAI,EAAE,CAAC,GAAG,GAAG;QACb,KAAK,EAAE,CAAC,GAAG,GAAG;QACd,KAAK,EAAE,CAAC;KACR,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,KAAmC,EAAE,KAAuB;IAC/E,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CA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K,EAAE,CAAC;gBAClC,MAAM,eAAe,GAAG,6LAA6L,CAAC;gBACtN,gBAAgB,GAAG,wBAAwB,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,YAAY,CAAC,eAAe,EAAE,eAAe,CAAC,EAAE,KAAK,CAAC,CAAC;YACrI,CAAC;iBAAM,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;gBACnC,MAAM,eAAe,GAAG,6OAA6O,CAAC;gBACtQ,gBAAgB,GAAG,wBAAwB,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,YAAY,CAAC,eAAe,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;YACpI,CAAC;iBAAM,IAAI,WAAW,KAAK,GAAG,EAAE,CAAC;gBAChC,gBAAgB,GAAG,wBAAwB,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,WAAW,GAAG,eAAe,CAAC,CAAC;YAC7G,CAAC;YACD,IAAI,gBAAgB,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC/B,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAmC;IAC/E,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QAC9F,kBAAkB;QAClB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","file":"defaultDocumentColorsComputer.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 *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nimport { IPosition } from '../core/position.js';\nimport { IRange } from '../core/range.js';\nimport { IColor, IColorInformation } from '../languages.js';\n\nexport interface IDocumentColorComputerTarget {\n\tgetValue(): string;\n\tpositionAt(offset: number): IPosition;\n\tfindMatches(regex: RegExp): RegExpMatchArray[];\n}\n\nfunction _parseCaptureGroups(captureGroups: IterableIterator<string>) {\n\tconst values = [];\n\tfor (const captureGroup of captureGroups) {\n\t\tconst parsedNumber = Number(captureGroup);\n\t\tif (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n\t\t\tvalues.push(parsedNumber);\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction _toIColor(r: number, g: number, b: number, a: number): IColor {\n\treturn {\n\t\tred: r / 255,\n\t\tblue: b / 255,\n\t\tgreen: g / 255,\n\t\talpha: a\n\t};\n}\n\nfunction _findRange(model: IDocumentColorComputerTarget, match: RegExpMatchArray): IRange | undefined {\n\tconst index = match.index;\n\tconst length = match[0].length;\n\tif (index === undefined) {\n\t\treturn;\n\t}\n\tconst startPosition = model.positionAt(index);\n\tconst range: IRange = {\n\t\tstartLineNumber: startPosition.lineNumber,\n\t\tstartColumn: startPosition.column,\n\t\tendLineNumber: startPosition.lineNumber,\n\t\tendColumn: startPosition.column + length\n\t};\n\treturn range;\n}\n\nfunction _findHexColorInformation(range: IRange | undefined, hexValue: string) {\n\tif (!range) {\n\t\treturn;\n\t}\n\tconst parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n\tif (!parsedHexColor) {\n\t\treturn;\n\t}\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n\t};\n}\n\nfunction _findRGBColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n\t};\n}\n\nfunction _findHSLColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\tconst colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n\t};\n}\n\nfunction _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {\n\tif (typeof model === 'string') {\n\t\treturn [...model.matchAll(regex)];\n\t} else {\n\t\treturn model.findMatches(regex);\n\t}\n}\n\nfunction computeColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tconst result: IColorInformation[] = [];\n\t// Early validation for RGB and HSL\n\tconst initialValidationRegex = /\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{8})\\b/gm;\n\tconst initialValidationMatches = _findMatches(model, initialValidationRegex);\n\n\t// Potential colors have been found, validate the parameters\n\tif (initialValidationMatches.length > 0) {\n\t\tfor (const initialMatch of initialValidationMatches) {\n\t\t\tconst initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n\t\t\tconst colorScheme = initialCaptureGroups[1];\n\t\t\tconst colorParameters = initialCaptureGroups[2];\n\t\t\tif (!colorParameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet colorInformation;\n\t\t\tif (colorScheme === 'rgb') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'rgba') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === 'hsl') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'hsla') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === '#') {\n\t\t\t\tcolorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n\t\t\t}\n\t\t\tif (colorInformation) {\n\t\t\t\tresult.push(colorInformation);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tif (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn computeColors(model);\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 *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nimport { IPosition } from '../core/position.js';\nimport { IRange } from '../core/range.js';\nimport { IColor, IColorInformation } from '../languages.js';\n\nexport interface IDocumentColorComputerTarget {\n\tgetValue(): string;\n\tpositionAt(offset: number): IPosition;\n\tfindMatches(regex: RegExp): RegExpMatchArray[];\n}\n\nfunction _parseCaptureGroups(captureGroups: IterableIterator<string>) {\n\tconst values = [];\n\tfor (const captureGroup of captureGroups) {\n\t\tconst parsedNumber = Number(captureGroup);\n\t\tif (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n\t\t\tvalues.push(parsedNumber);\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction _toIColor(r: number, g: number, b: number, a: number): IColor {\n\treturn {\n\t\tred: r / 255,\n\t\tblue: b / 255,\n\t\tgreen: g / 255,\n\t\talpha: a\n\t};\n}\n\nfunction _findRange(model: IDocumentColorComputerTarget, match: RegExpMatchArray): IRange | undefined {\n\tconst index = match.index;\n\tconst length = match[0].length;\n\tif (index === undefined) {\n\t\treturn;\n\t}\n\tconst startPosition = model.positionAt(index);\n\tconst range: IRange = {\n\t\tstartLineNumber: startPosition.lineNumber,\n\t\tstartColumn: startPosition.column,\n\t\tendLineNumber: startPosition.lineNumber,\n\t\tendColumn: startPosition.column + length\n\t};\n\treturn range;\n}\n\nfunction _findHexColorInformation(range: IRange | undefined, hexValue: string) {\n\tif (!range) {\n\t\treturn;\n\t}\n\tconst parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n\tif (!parsedHexColor) {\n\t\treturn;\n\t}\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n\t};\n}\n\nfunction _findRGBColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n\t};\n}\n\nfunction _findHSLColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\tconst colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n\t};\n}\n\nfunction _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {\n\tif (typeof model === 'string') {\n\t\treturn [...model.matchAll(regex)];\n\t} else {\n\t\treturn model.findMatches(regex);\n\t}\n}\n\nfunction computeColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tconst result: IColorInformation[] = [];\n\t// Early validation for RGB and HSL\n\tconst initialValidationRegex = /\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{8})\\b/gm;\n\tconst initialValidationMatches = _findMatches(model, initialValidationRegex);\n\n\t// Potential colors have been found, validate the parameters\n\tif (initialValidationMatches.length > 0) {\n\t\tfor (const initialMatch of initialValidationMatches) {\n\t\t\tconst initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n\t\t\tconst colorScheme = initialCaptureGroups[1];\n\t\t\tconst colorParameters = initialCaptureGroups[2];\n\t\t\tif (!colorParameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet colorInformation;\n\t\t\tif (colorScheme === 'rgb') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'rgba') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === 'hsl') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'hsla') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === '#') {\n\t\t\t\tcolorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n\t\t\t}\n\t\t\tif (colorInformation) {\n\t\t\t\tresult.push(colorInformation);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tif (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn computeColors(model);\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/defaultDocumentColorsComputer.ts","vs/editor/common/languages/defaultDocumentColorsComputer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAW5D,SAAS,mBAAmB,CAAC,aAAuC;IACnE,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QAC1C,IAAI,YAAY,IAAI,YAAY,KAAK,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC;YAClF,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,SAAS,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IAC5D,OAAO;QACN,GAAG,EAAE,CAAC,GAAG,G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CAAC;IACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","file":"defaultDocumentColorsComputer.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 *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nimport { IPosition } from '../core/position.js';\nimport { IRange } from '../core/range.js';\nimport { IColor, IColorInformation } from '../languages.js';\n\nexport interface IDocumentColorComputerTarget {\n\tgetValue(): string;\n\tpositionAt(offset: number): IPosition;\n\tfindMatches(regex: RegExp): RegExpMatchArray[];\n}\n\nfunction _parseCaptureGroups(captureGroups: IterableIterator<string>) {\n\tconst values = [];\n\tfor (const captureGroup of captureGroups) {\n\t\tconst parsedNumber = Number(captureGroup);\n\t\tif (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n\t\t\tvalues.push(parsedNumber);\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction _toIColor(r: number, g: number, b: number, a: number): IColor {\n\treturn {\n\t\tred: r / 255,\n\t\tblue: b / 255,\n\t\tgreen: g / 255,\n\t\talpha: a\n\t};\n}\n\nfunction _findRange(model: IDocumentColorComputerTarget, match: RegExpMatchArray): IRange | undefined {\n\tconst index = match.index;\n\tconst length = match[0].length;\n\tif (index === undefined) {\n\t\treturn;\n\t}\n\tconst startPosition = model.positionAt(index);\n\tconst range: IRange = {\n\t\tstartLineNumber: startPosition.lineNumber,\n\t\tstartColumn: startPosition.column,\n\t\tendLineNumber: startPosition.lineNumber,\n\t\tendColumn: startPosition.column + length\n\t};\n\treturn range;\n}\n\nfunction _findHexColorInformation(range: IRange | undefined, hexValue: string) {\n\tif (!range) {\n\t\treturn;\n\t}\n\tconst parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n\tif (!parsedHexColor) {\n\t\treturn;\n\t}\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n\t};\n}\n\nfunction _findRGBColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n\t};\n}\n\nfunction _findHSLColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\tconst colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n\t};\n}\n\nfunction _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {\n\tif (typeof model === 'string') {\n\t\treturn [...model.matchAll(regex)];\n\t} else {\n\t\treturn model.findMatches(regex);\n\t}\n}\n\nfunction computeColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tconst result: IColorInformation[] = [];\n\t// Early validation for RGB and HSL (including CSS Level 4 syntax with / separator)\n\tconst initialValidationRegex = /\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%\\/]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{8})\\b/gm;\n\tconst initialValidationMatches = _findMatches(model, initialValidationRegex);\n\n\t// Potential colors have been found, validate the parameters\n\tif (initialValidationMatches.length > 0) {\n\t\tfor (const initialMatch of initialValidationMatches) {\n\t\t\tconst initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n\t\t\tconst colorScheme = initialCaptureGroups[1];\n\t\t\tconst colorParameters = initialCaptureGroups[2];\n\t\t\tif (!colorParameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet colorInformation;\n\t\t\tif (colorScheme === 'rgb') {\n\t\t\t\t// Supports both comma-separated (rgb(255, 0, 0)) and CSS Level 4 space-separated syntax (rgb(255 0 0))\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*[\\s,]\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*[\\s,]\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'rgba') {\n\t\t\t\t// Supports both comma-separated (rgba(255, 0, 0, 0.5)) and CSS Level 4 syntax (rgba(255 0 0 / 0.5))\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*[\\s,]\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*[\\s,]\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*(?:[\\s,]|[\\s]*\\/)\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === 'hsl') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'hsla') {\n\t\t\t\t// Supports both comma-separated (hsla(253, 100%, 50%, 0.5)) and CSS Level 4 syntax (hsla(253 100% 50% / 0.5))\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*(?:[\\s,]|[\\s]*\\/)\\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === '#') {\n\t\t\t\tcolorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n\t\t\t}\n\t\t\tif (colorInformation) {\n\t\t\t\tresult.push(colorInformation);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tif (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn computeColors(model);\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 *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nimport { IPosition } from '../core/position.js';\nimport { IRange } from '../core/range.js';\nimport { IColor, IColorInformation } from '../languages.js';\n\nexport interface IDocumentColorComputerTarget {\n\tgetValue(): string;\n\tpositionAt(offset: number): IPosition;\n\tfindMatches(regex: RegExp): RegExpMatchArray[];\n}\n\nfunction _parseCaptureGroups(captureGroups: IterableIterator<string>) {\n\tconst values = [];\n\tfor (const captureGroup of captureGroups) {\n\t\tconst parsedNumber = Number(captureGroup);\n\t\tif (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n\t\t\tvalues.push(parsedNumber);\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction _toIColor(r: number, g: number, b: number, a: number): IColor {\n\treturn {\n\t\tred: r / 255,\n\t\tblue: b / 255,\n\t\tgreen: g / 255,\n\t\talpha: a\n\t};\n}\n\nfunction _findRange(model: IDocumentColorComputerTarget, match: RegExpMatchArray): IRange | undefined {\n\tconst index = match.index;\n\tconst length = match[0].length;\n\tif (index === undefined) {\n\t\treturn;\n\t}\n\tconst startPosition = model.positionAt(index);\n\tconst range: IRange = {\n\t\tstartLineNumber: startPosition.lineNumber,\n\t\tstartColumn: startPosition.column,\n\t\tendLineNumber: startPosition.lineNumber,\n\t\tendColumn: startPosition.column + length\n\t};\n\treturn range;\n}\n\nfunction _findHexColorInformation(range: IRange | undefined, hexValue: string) {\n\tif (!range) {\n\t\treturn;\n\t}\n\tconst parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n\tif (!parsedHexColor) {\n\t\treturn;\n\t}\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n\t};\n}\n\nfunction _findRGBColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n\t};\n}\n\nfunction _findHSLColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\tconst colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n\t};\n}\n\nfunction _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {\n\tif (typeof model === 'string') {\n\t\treturn [...model.matchAll(regex)];\n\t} else {\n\t\treturn model.findMatches(regex);\n\t}\n}\n\nfunction computeColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tconst result: IColorInformation[] = [];\n\t// Early validation for RGB and HSL (including CSS Level 4 syntax with / separator)\n\tconst initialValidationRegex = /\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%\\/]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{8})\\b/gm;\n\tconst initialValidationMatches = _findMatches(model, initialValidationRegex);\n\n\t// Potential colors have been found, validate the parameters\n\tif (initialValidationMatches.length > 0) {\n\t\tfor (const initialMatch of initialValidationMatches) {\n\t\t\tconst initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n\t\t\tconst colorScheme = initialCaptureGroups[1];\n\t\t\tconst colorParameters = initialCaptureGroups[2];\n\t\t\tif (!colorParameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet colorInformation;\n\t\t\tif (colorScheme === 'rgb') {\n\t\t\t\t// Supports both comma-separated (rgb(255, 0, 0)) and CSS Level 4 space-separated syntax (rgb(255 0 0))\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*[\\s,]\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*[\\s,]\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'rgba') {\n\t\t\t\t// Supports both comma-separated (rgba(255, 0, 0, 0.5)) and CSS Level 4 syntax (rgba(255 0 0 / 0.5))\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*[\\s,]\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*[\\s,]\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*(?:[\\s,]|[\\s]*\\/)\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === 'hsl') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'hsla') {\n\t\t\t\t// Supports both comma-separated (hsla(253, 100%, 50%, 0.5)) and CSS Level 4 syntax (hsla(253 100% 50% / 0.5))\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*(?:[\\s,]|[\\s]*\\/)\\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === '#') {\n\t\t\t\tcolorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n\t\t\t}\n\t\t\tif (colorInformation) {\n\t\t\t\tresult.push(colorInformation);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tif (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn computeColors(model);\n}\n"]}
@@ -290,8 +290,16 @@ if (PasteAction) {
290
290
  const triggerPaste = clipboardService.triggerPaste(getActiveWindow().vscodeWindowId);
291
291
  if (triggerPaste) {
292
292
  logService.trace('registerExecCommandImpl (triggerPaste defined)');
293
+ PasteOptions.electronBugWorkaroundPasteEventLock = false;
293
294
  return triggerPaste.then(async () => {
294
295
  if (PasteOptions.electronBugWorkaroundPasteEventHasFired === false) {
296
+ // Ensure this doesn't run twice, what appears to be happening is
297
+ // triggerPasteis called once but it's handler is called multiple times
298
+ // when it reproduces
299
+ if (PasteOptions.electronBugWorkaroundPasteEventLock === true) {
300
+ return;
301
+ }
302
+ PasteOptions.electronBugWorkaroundPasteEventLock = true;
295
303
  return pasteWithNavigatorAPI(focusedEditor, clipboardService, logService);
296
304
  }
297
305
  logService.trace('registerExecCommandImpl (after 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,OAAO,KAAK,QAAQ,MAAM,qCAAqC,CAAC;AAChE,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAA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,oBAAoB,CAAC,2CAA2C,CAAC,CAAC;AACnE,CAAC","file":"clipboard.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as browser from '../../../../base/browser/browser.js';\nimport { getActiveDocument, getActiveWindow } from '../../../../base/browser/dom.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport * as nls from '../../../../nls.js';\nimport { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nimport { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';\nimport { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { CopyOptions, generateDataToCopyAndStoreInMemory, InMemoryClipboardMetadataManager, PasteOptions } from '../../../browser/controller/editContext/clipboardUtils.js';\nimport { NativeEditContextRegistry } from '../../../browser/controller/editContext/native/nativeEditContextRegistry.js';\nimport { IActiveCodeEditor, ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Command, EditorAction, MultiCommand, registerEditorAction } from '../../../browser/editorExtensions.js';\nimport { ICodeEditorService } from '../../../browser/services/codeEditorService.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Handler } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { CopyPasteController } from '../../dropOrPasteInto/browser/copyPasteController.js';\n\nconst CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';\n\nconst supportsCut = (platform.isNative || document.queryCommandSupported('cut'));\nconst supportsCopy = (platform.isNative || document.queryCommandSupported('copy'));\n// Firefox only supports navigator.clipboard.readText() in browser extensions.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#Browser_compatibility\n// When loading over http, navigator.clipboard can be undefined. See https://github.com/microsoft/monaco-editor/issues/2313\nconst supportsPaste = (typeof navigator.clipboard === 'undefined' || browser.isFirefox) ? document.queryCommandSupported('paste') : true;\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport const CutAction = supportsCut ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCutAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind cut keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyX,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyX, secondary: [KeyMod.Shift | KeyCode.Delete] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCut', comment: ['&& denotes a mnemonic'] }, \"Cu&&t\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}]\n})) : undefined;\n\nexport const CopyAction = supportsCopy ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCopyAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind copy keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyC,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCopy', comment: ['&& denotes a mnemonic'] }, \"&&Copy\"),\n\t\torder: 2\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}]\n})) : undefined;\n\nMenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2('copy as', \"Copy As\"), group: '2_ccp', order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2('copy as', \"Copy As\"), group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1, when: ContextKeyExpr.and(ContextKeyExpr.notEquals('resourceScheme', 'output'), EditorContextKeys.editorTextFocus) });\nMenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1 });\n\nexport const PasteAction = supportsPaste ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardPasteAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind paste keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyV,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, \"&&Paste\"),\n\t\torder: 4\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}]\n})) : undefined;\n\nclass ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',\n\t\t\tlabel: nls.localize2('actions.clipboard.copyWithSyntaxHighlightingLabel', \"Copy with Syntax Highlighting\"),\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst logService = accessor.get(ILogService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction#run');\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptySelectionClipboard = editor.getOption(EditorOption.emptySelectionClipboard);\n\n\t\tif (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = true;\n\t\teditor.focus();\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)');\n\t\texecuteClipboardCopyWithWorkaround(editor, clipboardService);\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)');\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = false;\n\t}\n}\n\nfunction executeClipboardCopyWithWorkaround(editor: IActiveCodeEditor, clipboardService: IClipboardService) {\n\t// !!!!!\n\t// This is a workaround for what we think is an Electron bug where\n\t// execCommand('copy') does not always work (it does not fire a clipboard event)\n\t// We will use this as a signal that we have executed a copy command\n\t// !!!!!\n\tCopyOptions.electronBugWorkaroundCopyEventHasFired = false;\n\teditor.getContainerDomNode().ownerDocument.execCommand('copy');\n\tif (platform.isNative && CopyOptions.electronBugWorkaroundCopyEventHasFired === false) {\n\t\t// We have encountered the Electron bug!\n\t\t// As a workaround, we will write (only the plaintext data) to the clipboard in a different way\n\t\t// We will use the clipboard service (which in the native case will go to electron's clipboard API)\n\t\tconst { dataToCopy } = generateDataToCopyAndStoreInMemory(editor._getViewModel(), editor.getOptions(), undefined, browser.isFirefox);\n\t\tclipboardService.writeText(dataToCopy.text);\n\t}\n}\n\nasync function pasteWithNavigatorAPI(editor: IActiveCodeEditor, clipboardService: IClipboardService, logService: ILogService): Promise<void> {\n\tconst clipboardText = await clipboardService.readText();\n\tif (clipboardText !== '') {\n\t\tconst metadata = InMemoryClipboardMetadataManager.INSTANCE.get(clipboardText);\n\t\tlet pasteOnNewLine = false;\n\t\tlet multicursorText: string[] | null = null;\n\t\tlet mode: string | null = null;\n\t\tif (metadata) {\n\t\t\tpasteOnNewLine = (editor.getOption(EditorOption.emptySelectionClipboard) && !!metadata.isFromEmptySelection);\n\t\t\tmulticursorText = (typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null);\n\t\t\tmode = metadata.mode;\n\t\t}\n\t\tlogService.trace('pasteWithNavigatorAPI with id : ', metadata?.id, ', clipboardText.length : ', clipboardText.length);\n\t\teditor.trigger('keyboard', Handler.Paste, {\n\t\t\ttext: clipboardText,\n\t\t\tpasteOnNewLine,\n\t\t\tmulticursorText,\n\t\t\tmode\n\t\t});\n\t}\n}\n\nfunction registerExecCommandImpl(target: MultiCommand | undefined, browserCommand: 'cut' | 'copy'): void {\n\tif (!target) {\n\t\treturn;\n\t}\n\n\t// 1. handle case when focus is in editor.\n\ttarget.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation code-editor for : ', browserCommand, ')');\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasTextFocus() && focusedEditor.hasModel()) {\n\t\t\t// Do not execute if there is no selection and empty selection clipboard is off\n\t\t\tconst emptySelectionClipboard = focusedEditor.getOption(EditorOption.emptySelectionClipboard);\n\t\t\tconst selection = focusedEditor.getSelection();\n\t\t\tif (selection && selection.isEmpty() && !emptySelectionClipboard) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// TODO this is very ugly. The entire copy/paste/cut system needs a complete refactoring.\n\t\t\tif (focusedEditor.getOption(EditorOption.effectiveEditContext) && browserCommand === 'cut') {\n\t\t\t\tlogCopyCommand(focusedEditor);\n\t\t\t\t// execCommand(copy) works for edit context, but not execCommand(cut).\n\t\t\t\tlogService.trace('registerExecCommandImpl (before execCommand copy)');\n\t\t\t\texecuteClipboardCopyWithWorkaround(focusedEditor, clipboardService);\n\t\t\t\tfocusedEditor.trigger(undefined, Handler.Cut, undefined);\n\t\t\t\tlogService.trace('registerExecCommandImpl (after execCommand copy)');\n\t\t\t} else {\n\t\t\t\tlogCopyCommand(focusedEditor);\n\t\t\t\tlogService.trace('registerExecCommandImpl (before execCommand ' + browserCommand + ')');\n\t\t\t\tif (browserCommand === 'copy') {\n\t\t\t\t\texecuteClipboardCopyWithWorkaround(focusedEditor, clipboardService);\n\t\t\t\t} else {\n\t\t\t\t\tfocusedEditor.getContainerDomNode().ownerDocument.execCommand(browserCommand);\n\t\t\t\t}\n\t\t\t\tlogService.trace('registerExecCommandImpl (after execCommand ' + browserCommand + ')');\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. (default) handle case when focus is somewhere else.\n\ttarget.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation generic-dom for : ', browserCommand, ')');\n\t\tlogService.trace('registerExecCommandImpl (before execCommand ' + browserCommand + ')');\n\t\tgetActiveDocument().execCommand(browserCommand);\n\t\tlogService.trace('registerExecCommandImpl (after execCommand ' + browserCommand + ')');\n\t\treturn true;\n\t});\n}\n\nfunction logCopyCommand(editor: ICodeEditor) {\n\tconst editContextEnabled = editor.getOption(EditorOption.effectiveEditContext);\n\tif (editContextEnabled) {\n\t\tconst nativeEditContext = NativeEditContextRegistry.get(editor.getId());\n\t\tif (nativeEditContext) {\n\t\t\tnativeEditContext.onWillCopy();\n\t\t}\n\t}\n}\n\nregisterExecCommandImpl(CutAction, 'cut');\nregisterExecCommandImpl(CopyAction, 'copy');\n\nif (PasteAction) {\n\t// 1. Paste: handle case when focus is in editor.\n\tPasteAction.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation code-editor for : paste)');\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = codeEditorService.getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasModel() && focusedEditor.hasTextFocus()) {\n\t\t\t// execCommand(paste) does not work with edit context\n\t\t\tconst editContextEnabled = focusedEditor.getOption(EditorOption.effectiveEditContext);\n\t\t\tif (editContextEnabled) {\n\t\t\t\tconst nativeEditContext = NativeEditContextRegistry.get(focusedEditor.getId());\n\t\t\t\tif (nativeEditContext) {\n\t\t\t\t\tnativeEditContext.onWillPaste();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlogService.trace('registerExecCommandImpl (before triggerPaste)');\n\t\t\tPasteOptions.electronBugWorkaroundPasteEventHasFired = false;\n\t\t\tconst triggerPaste = clipboardService.triggerPaste(getActiveWindow().vscodeWindowId);\n\t\t\tif (triggerPaste) {\n\t\t\t\tlogService.trace('registerExecCommandImpl (triggerPaste defined)');\n\t\t\t\treturn triggerPaste.then(async () => {\n\t\t\t\t\tif (PasteOptions.electronBugWorkaroundPasteEventHasFired === false) {\n\t\t\t\t\t\treturn pasteWithNavigatorAPI(focusedEditor, clipboardService, logService);\n\t\t\t\t\t}\n\t\t\t\t\tlogService.trace('registerExecCommandImpl (after triggerPaste)');\n\t\t\t\t\treturn CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlogService.trace('registerExecCommandImpl (triggerPaste undefined)');\n\t\t\t}\n\t\t\tif (platform.isWeb) {\n\t\t\t\tlogService.trace('registerExecCommandImpl (Paste handling on web)');\n\t\t\t\t// Use the clipboard service if document.execCommand('paste') was not successful\n\t\t\t\treturn pasteWithNavigatorAPI(focusedEditor, clipboardService, logService);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. Paste: (default) handle case when focus is somewhere else.\n\tPasteAction.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation generic-dom for : paste)');\n\t\tconst triggerPaste = accessor.get(IClipboardService).triggerPaste(getActiveWindow().vscodeWindowId);\n\t\treturn triggerPaste ?? false;\n\t});\n}\n\nif (supportsCopy) {\n\tregisterEditorAction(ExecCommandCopyWithSyntaxHighlightingAction);\n}\n"]}
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,EAA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U,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACxF,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC,cAAc,CAAC,CAAC;QACpG,OAAO,YAAY,IAAI,KAAK,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,IAAI,YAAY,EAAE,CAAC;IAClB,oBAAoB,CAAC,2CAA2C,CAAC,CAAC;AACnE,CAAC","file":"clipboard.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as browser from '../../../../base/browser/browser.js';\nimport { getActiveDocument, getActiveWindow } from '../../../../base/browser/dom.js';\nimport { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport * as nls from '../../../../nls.js';\nimport { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nimport { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';\nimport { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';\nimport { ILogService } from '../../../../platform/log/common/log.js';\nimport { CopyOptions, generateDataToCopyAndStoreInMemory, InMemoryClipboardMetadataManager, PasteOptions } from '../../../browser/controller/editContext/clipboardUtils.js';\nimport { NativeEditContextRegistry } from '../../../browser/controller/editContext/native/nativeEditContextRegistry.js';\nimport { IActiveCodeEditor, ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Command, EditorAction, MultiCommand, registerEditorAction } from '../../../browser/editorExtensions.js';\nimport { ICodeEditorService } from '../../../browser/services/codeEditorService.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Handler } from '../../../common/editorCommon.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { CopyPasteController } from '../../dropOrPasteInto/browser/copyPasteController.js';\n\nconst CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';\n\nconst supportsCut = (platform.isNative || document.queryCommandSupported('cut'));\nconst supportsCopy = (platform.isNative || document.queryCommandSupported('copy'));\n// Firefox only supports navigator.clipboard.readText() in browser extensions.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#Browser_compatibility\n// When loading over http, navigator.clipboard can be undefined. See https://github.com/microsoft/monaco-editor/issues/2313\nconst supportsPaste = (typeof navigator.clipboard === 'undefined' || browser.isFirefox) ? document.queryCommandSupported('paste') : true;\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport const CutAction = supportsCut ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCutAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind cut keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyX,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyX, secondary: [KeyMod.Shift | KeyCode.Delete] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCut', comment: ['&& denotes a mnemonic'] }, \"Cu&&t\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 1,\n\t}]\n})) : undefined;\n\nexport const CopyAction = supportsCopy ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardCopyAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind copy keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyC,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miCopy', comment: ['&& denotes a mnemonic'] }, \"&&Copy\"),\n\t\torder: 2\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\torder: 2,\n\t}]\n})) : undefined;\n\nMenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2('copy as', \"Copy As\"), group: '2_ccp', order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2('copy as', \"Copy As\"), group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1, when: ContextKeyExpr.and(ContextKeyExpr.notEquals('resourceScheme', 'output'), EditorContextKeys.editorTextFocus) });\nMenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1 });\n\nexport const PasteAction = supportsPaste ? registerCommand(new MultiCommand({\n\tid: 'editor.action.clipboardPasteAction',\n\tprecondition: undefined,\n\tkbOpts: (\n\t\t// Do not bind paste keybindings in the browser,\n\t\t// since browsers do that for us and it avoids security prompts\n\t\tplatform.isNative ? {\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyV,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t} : undefined\n\t),\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '2_ccp',\n\t\ttitle: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, \"&&Paste\"),\n\t\torder: 4\n\t}, {\n\t\tmenuId: MenuId.EditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\ttitle: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\twhen: EditorContextKeys.writable,\n\t\torder: 4,\n\t}]\n})) : undefined;\n\nclass ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',\n\t\t\tlabel: nls.localize2('actions.clipboard.copyWithSyntaxHighlightingLabel', \"Copy with Syntax Highlighting\"),\n\t\t\tprecondition: undefined,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: 0,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst logService = accessor.get(ILogService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction#run');\n\t\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptySelectionClipboard = editor.getOption(EditorOption.emptySelectionClipboard);\n\n\t\tif (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = true;\n\t\teditor.focus();\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)');\n\t\texecuteClipboardCopyWithWorkaround(editor, clipboardService);\n\t\tlogService.trace('ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)');\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = false;\n\t}\n}\n\nfunction executeClipboardCopyWithWorkaround(editor: IActiveCodeEditor, clipboardService: IClipboardService) {\n\t// !!!!!\n\t// This is a workaround for what we think is an Electron bug where\n\t// execCommand('copy') does not always work (it does not fire a clipboard event)\n\t// We will use this as a signal that we have executed a copy command\n\t// !!!!!\n\tCopyOptions.electronBugWorkaroundCopyEventHasFired = false;\n\teditor.getContainerDomNode().ownerDocument.execCommand('copy');\n\tif (platform.isNative && CopyOptions.electronBugWorkaroundCopyEventHasFired === false) {\n\t\t// We have encountered the Electron bug!\n\t\t// As a workaround, we will write (only the plaintext data) to the clipboard in a different way\n\t\t// We will use the clipboard service (which in the native case will go to electron's clipboard API)\n\t\tconst { dataToCopy } = generateDataToCopyAndStoreInMemory(editor._getViewModel(), editor.getOptions(), undefined, browser.isFirefox);\n\t\tclipboardService.writeText(dataToCopy.text);\n\t}\n}\n\nasync function pasteWithNavigatorAPI(editor: IActiveCodeEditor, clipboardService: IClipboardService, logService: ILogService): Promise<void> {\n\tconst clipboardText = await clipboardService.readText();\n\tif (clipboardText !== '') {\n\t\tconst metadata = InMemoryClipboardMetadataManager.INSTANCE.get(clipboardText);\n\t\tlet pasteOnNewLine = false;\n\t\tlet multicursorText: string[] | null = null;\n\t\tlet mode: string | null = null;\n\t\tif (metadata) {\n\t\t\tpasteOnNewLine = (editor.getOption(EditorOption.emptySelectionClipboard) && !!metadata.isFromEmptySelection);\n\t\t\tmulticursorText = (typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null);\n\t\t\tmode = metadata.mode;\n\t\t}\n\t\tlogService.trace('pasteWithNavigatorAPI with id : ', metadata?.id, ', clipboardText.length : ', clipboardText.length);\n\t\teditor.trigger('keyboard', Handler.Paste, {\n\t\t\ttext: clipboardText,\n\t\t\tpasteOnNewLine,\n\t\t\tmulticursorText,\n\t\t\tmode\n\t\t});\n\t}\n}\n\nfunction registerExecCommandImpl(target: MultiCommand | undefined, browserCommand: 'cut' | 'copy'): void {\n\tif (!target) {\n\t\treturn;\n\t}\n\n\t// 1. handle case when focus is in editor.\n\ttarget.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation code-editor for : ', browserCommand, ')');\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasTextFocus() && focusedEditor.hasModel()) {\n\t\t\t// Do not execute if there is no selection and empty selection clipboard is off\n\t\t\tconst emptySelectionClipboard = focusedEditor.getOption(EditorOption.emptySelectionClipboard);\n\t\t\tconst selection = focusedEditor.getSelection();\n\t\t\tif (selection && selection.isEmpty() && !emptySelectionClipboard) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// TODO this is very ugly. The entire copy/paste/cut system needs a complete refactoring.\n\t\t\tif (focusedEditor.getOption(EditorOption.effectiveEditContext) && browserCommand === 'cut') {\n\t\t\t\tlogCopyCommand(focusedEditor);\n\t\t\t\t// execCommand(copy) works for edit context, but not execCommand(cut).\n\t\t\t\tlogService.trace('registerExecCommandImpl (before execCommand copy)');\n\t\t\t\texecuteClipboardCopyWithWorkaround(focusedEditor, clipboardService);\n\t\t\t\tfocusedEditor.trigger(undefined, Handler.Cut, undefined);\n\t\t\t\tlogService.trace('registerExecCommandImpl (after execCommand copy)');\n\t\t\t} else {\n\t\t\t\tlogCopyCommand(focusedEditor);\n\t\t\t\tlogService.trace('registerExecCommandImpl (before execCommand ' + browserCommand + ')');\n\t\t\t\tif (browserCommand === 'copy') {\n\t\t\t\t\texecuteClipboardCopyWithWorkaround(focusedEditor, clipboardService);\n\t\t\t\t} else {\n\t\t\t\t\tfocusedEditor.getContainerDomNode().ownerDocument.execCommand(browserCommand);\n\t\t\t\t}\n\t\t\t\tlogService.trace('registerExecCommandImpl (after execCommand ' + browserCommand + ')');\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. (default) handle case when focus is somewhere else.\n\ttarget.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation generic-dom for : ', browserCommand, ')');\n\t\tlogService.trace('registerExecCommandImpl (before execCommand ' + browserCommand + ')');\n\t\tgetActiveDocument().execCommand(browserCommand);\n\t\tlogService.trace('registerExecCommandImpl (after execCommand ' + browserCommand + ')');\n\t\treturn true;\n\t});\n}\n\nfunction logCopyCommand(editor: ICodeEditor) {\n\tconst editContextEnabled = editor.getOption(EditorOption.effectiveEditContext);\n\tif (editContextEnabled) {\n\t\tconst nativeEditContext = NativeEditContextRegistry.get(editor.getId());\n\t\tif (nativeEditContext) {\n\t\t\tnativeEditContext.onWillCopy();\n\t\t}\n\t}\n}\n\nregisterExecCommandImpl(CutAction, 'cut');\nregisterExecCommandImpl(CopyAction, 'copy');\n\nif (PasteAction) {\n\t// 1. Paste: handle case when focus is in editor.\n\tPasteAction.addImplementation(10000, 'code-editor', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation code-editor for : paste)');\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\t\tconst clipboardService = accessor.get(IClipboardService);\n\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tconst focusedEditor = codeEditorService.getFocusedCodeEditor();\n\t\tif (focusedEditor && focusedEditor.hasModel() && focusedEditor.hasTextFocus()) {\n\t\t\t// execCommand(paste) does not work with edit context\n\t\t\tconst editContextEnabled = focusedEditor.getOption(EditorOption.effectiveEditContext);\n\t\t\tif (editContextEnabled) {\n\t\t\t\tconst nativeEditContext = NativeEditContextRegistry.get(focusedEditor.getId());\n\t\t\t\tif (nativeEditContext) {\n\t\t\t\t\tnativeEditContext.onWillPaste();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlogService.trace('registerExecCommandImpl (before triggerPaste)');\n\t\t\tPasteOptions.electronBugWorkaroundPasteEventHasFired = false;\n\t\t\tconst triggerPaste = clipboardService.triggerPaste(getActiveWindow().vscodeWindowId);\n\t\t\tif (triggerPaste) {\n\t\t\t\tlogService.trace('registerExecCommandImpl (triggerPaste defined)');\n\t\t\t\tPasteOptions.electronBugWorkaroundPasteEventLock = false;\n\t\t\t\treturn triggerPaste.then(async () => {\n\t\t\t\t\tif (PasteOptions.electronBugWorkaroundPasteEventHasFired === false) {\n\t\t\t\t\t\t// Ensure this doesn't run twice, what appears to be happening is\n\t\t\t\t\t\t// triggerPasteis called once but it's handler is called multiple times\n\t\t\t\t\t\t// when it reproduces\n\t\t\t\t\t\tif (PasteOptions.electronBugWorkaroundPasteEventLock === true) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPasteOptions.electronBugWorkaroundPasteEventLock = true;\n\t\t\t\t\t\treturn pasteWithNavigatorAPI(focusedEditor, clipboardService, logService);\n\t\t\t\t\t}\n\t\t\t\t\tlogService.trace('registerExecCommandImpl (after triggerPaste)');\n\t\t\t\t\treturn CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlogService.trace('registerExecCommandImpl (triggerPaste undefined)');\n\t\t\t}\n\t\t\tif (platform.isWeb) {\n\t\t\t\tlogService.trace('registerExecCommandImpl (Paste handling on web)');\n\t\t\t\t// Use the clipboard service if document.execCommand('paste') was not successful\n\t\t\t\treturn pasteWithNavigatorAPI(focusedEditor, clipboardService, logService);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\t// 2. Paste: (default) handle case when focus is somewhere else.\n\tPasteAction.addImplementation(0, 'generic-dom', (accessor: ServicesAccessor, args: unknown) => {\n\t\tconst logService = accessor.get(ILogService);\n\t\tlogService.trace('registerExecCommandImpl (addImplementation generic-dom for : paste)');\n\t\tconst triggerPaste = accessor.get(IClipboardService).triggerPaste(getActiveWindow().vscodeWindowId);\n\t\treturn triggerPaste ?? false;\n\t});\n}\n\nif (supportsCopy) {\n\tregisterEditorAction(ExecCommandCopyWithSyntaxHighlightingAction);\n}\n"]}
@@ -25,11 +25,10 @@ let DefaultDocumentColorProvider = class DefaultDocumentColorProvider {
25
25
  provideColorPresentations(_model, colorInfo, _token) {
26
26
  const range = colorInfo.range;
27
27
  const colorFromInfo = colorInfo.color;
28
- const alpha = colorFromInfo.alpha;
29
- const color = new Color(new RGBA(Math.round(255 * colorFromInfo.red), Math.round(255 * colorFromInfo.green), Math.round(255 * colorFromInfo.blue), alpha));
30
- const rgb = alpha ? Color.Format.CSS.formatRGBA(color) : Color.Format.CSS.formatRGB(color);
31
- const hsl = alpha ? Color.Format.CSS.formatHSLA(color) : Color.Format.CSS.formatHSL(color);
32
- const hex = alpha ? Color.Format.CSS.formatHexA(color) : Color.Format.CSS.formatHex(color);
28
+ const color = new Color(new RGBA(Math.round(255 * colorFromInfo.red), Math.round(255 * colorFromInfo.green), Math.round(255 * colorFromInfo.blue), colorFromInfo.alpha));
29
+ const rgb = Color.Format.CSS.formatRGB(color);
30
+ const hsl = Color.Format.CSS.formatHSL(color);
31
+ const hex = Color.Format.CSS.formatHexA(color, true);
33
32
  const colorPresentations = [];
34
33
  colorPresentations.push({ label: rgb, textEdit: { range: range, text: rgb } });
35
34
  colorPresentations.push({ label: hsl, textEdit: { range: range, text: hsl } });
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts","vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAGhG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,E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C,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAE3F,MAAM,kBAAkB,GAAyB,EAAE,CAAC;QACpD,kBAAkB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/E,kBAAkB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/E,kBAAkB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/E,OAAO,kBAAkB,CAAC;IAC3B,CAAC;CACD,CAAA;AA1BY,4BAA4B;IAGtC,WAAA,oBAAoB,CAAA;GAHV,4BAA4B,CA0BxC;;AAEM,IAAM,mCAAmC,GAAzC,MAAM,mCAAoC,SAAQ,UAAU;IAClE,YAC2B,wBAAkD,EACtD,mBAAyC;QAE/D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,4BAA4B,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC7H,CAAC;CACD,CAAA;AARY,mCAAmC;IAE7C,WAAA,wBAAwB,CAAA;IACxB,WAAA,oBAAoB,CAAA;GAHV,mCAAmC,CAQ/C","file":"defaultDocumentColorProvider.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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Color, RGBA } from '../../../../base/common/color.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { DocumentColorProvider, IColor, IColorInformation, IColorPresentation } from '../../../common/languages.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { IEditorWorkerService } from '../../../common/services/editorWorker.js';\n\nexport class DefaultDocumentColorProvider implements DocumentColorProvider {\n\n\tconstructor(\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t) { }\n\n\tasync provideDocumentColors(model: ITextModel, _token: CancellationToken): Promise<IColorInformation[] | null> {\n\t\treturn this._editorWorkerService.computeDefaultDocumentColors(model.uri);\n\t}\n\n\tprovideColorPresentations(_model: ITextModel, colorInfo: IColorInformation, _token: CancellationToken): IColorPresentation[] {\n\t\tconst range = colorInfo.range;\n\t\tconst colorFromInfo: IColor = colorInfo.color;\n\t\tconst alpha = colorFromInfo.alpha;\n\t\tconst color = new Color(new RGBA(Math.round(255 * colorFromInfo.red), Math.round(255 * colorFromInfo.green), Math.round(255 * colorFromInfo.blue), alpha));\n\n\t\tconst rgb = alpha ? Color.Format.CSS.formatRGBA(color) : Color.Format.CSS.formatRGB(color);\n\t\tconst hsl = alpha ? Color.Format.CSS.formatHSLA(color) : Color.Format.CSS.formatHSL(color);\n\t\tconst hex = alpha ? Color.Format.CSS.formatHexA(color) : Color.Format.CSS.formatHex(color);\n\n\t\tconst colorPresentations: IColorPresentation[] = [];\n\t\tcolorPresentations.push({ label: rgb, textEdit: { range: range, text: rgb } });\n\t\tcolorPresentations.push({ label: hsl, textEdit: { range: range, text: hsl } });\n\t\tcolorPresentations.push({ label: hex, textEdit: { range: range, text: hex } });\n\t\treturn colorPresentations;\n\t}\n}\n\nexport class DefaultDocumentColorProviderFeature extends Disposable {\n\tconstructor(\n\t\t@ILanguageFeaturesService _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEditorWorkerService editorWorkerService: IEditorWorkerService,\n\t) {\n\t\tsuper();\n\t\tthis._register(_languageFeaturesService.colorProvider.register('*', new DefaultDocumentColorProvider(editorWorkerService)));\n\t}\n}\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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Color, RGBA } from '../../../../base/common/color.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { DocumentColorProvider, IColor, IColorInformation, IColorPresentation } from '../../../common/languages.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { IEditorWorkerService } from '../../../common/services/editorWorker.js';\n\nexport class DefaultDocumentColorProvider implements DocumentColorProvider {\n\n\tconstructor(\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t) { }\n\n\tasync provideDocumentColors(model: ITextModel, _token: CancellationToken): Promise<IColorInformation[] | null> {\n\t\treturn this._editorWorkerService.computeDefaultDocumentColors(model.uri);\n\t}\n\n\tprovideColorPresentations(_model: ITextModel, colorInfo: IColorInformation, _token: CancellationToken): IColorPresentation[] {\n\t\tconst range = colorInfo.range;\n\t\tconst colorFromInfo: IColor = colorInfo.color;\n\t\tconst alpha = colorFromInfo.alpha;\n\t\tconst color = new Color(new RGBA(Math.round(255 * colorFromInfo.red), Math.round(255 * colorFromInfo.green), Math.round(255 * colorFromInfo.blue), alpha));\n\n\t\tconst rgb = alpha ? Color.Format.CSS.formatRGBA(color) : Color.Format.CSS.formatRGB(color);\n\t\tconst hsl = alpha ? Color.Format.CSS.formatHSLA(color) : Color.Format.CSS.formatHSL(color);\n\t\tconst hex = alpha ? Color.Format.CSS.formatHexA(color) : Color.Format.CSS.formatHex(color);\n\n\t\tconst colorPresentations: IColorPresentation[] = [];\n\t\tcolorPresentations.push({ label: rgb, textEdit: { range: range, text: rgb } });\n\t\tcolorPresentations.push({ label: hsl, textEdit: { range: range, text: hsl } });\n\t\tcolorPresentations.push({ label: hex, textEdit: { range: range, text: hex } });\n\t\treturn colorPresentations;\n\t}\n}\n\nexport class DefaultDocumentColorProviderFeature extends Disposable {\n\tconstructor(\n\t\t@ILanguageFeaturesService _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEditorWorkerService editorWorkerService: IEditorWorkerService,\n\t) {\n\t\tsuper();\n\t\tthis._register(_languageFeaturesService.colorProvider.register('*', new DefaultDocumentColorProvider(editorWorkerService)));\n\t}\n}\n\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts","vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAGhG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEzE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAExC,YACwC,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAC9E,CAAC;IAEL,KAAK,CAAC,qBAAqB,CAAC,KAAiB,EAAE,MAAyB;QACvE,OAAO,IAAI,CAAC,oBAAoB,CAAC,4BAA4B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1E,CAAC;IAED,yBAAyB,CAAC,MAAkB,EAAE,SAA4B,EAAE,MAAyB;QACpG,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC;Q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C;;AAEM,IAAM,mCAAmC,GAAzC,MAAM,mCAAoC,SAAQ,UAAU;IAClE,YAC2B,wBAAkD,EACtD,mBAAyC;QAE/D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,4BAA4B,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC7H,CAAC;CACD,CAAA;AARY,mCAAmC;IAE7C,WAAA,wBAAwB,CAAA;IACxB,WAAA,oBAAoB,CAAA;GAHV,mCAAmC,CAQ/C","file":"defaultDocumentColorProvider.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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Color, RGBA } from '../../../../base/common/color.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { DocumentColorProvider, IColor, IColorInformation, IColorPresentation } from '../../../common/languages.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { IEditorWorkerService } from '../../../common/services/editorWorker.js';\n\nexport class DefaultDocumentColorProvider implements DocumentColorProvider {\n\n\tconstructor(\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t) { }\n\n\tasync provideDocumentColors(model: ITextModel, _token: CancellationToken): Promise<IColorInformation[] | null> {\n\t\treturn this._editorWorkerService.computeDefaultDocumentColors(model.uri);\n\t}\n\n\tprovideColorPresentations(_model: ITextModel, colorInfo: IColorInformation, _token: CancellationToken): IColorPresentation[] {\n\t\tconst range = colorInfo.range;\n\t\tconst colorFromInfo: IColor = colorInfo.color;\n\t\tconst color = new Color(new RGBA(Math.round(255 * colorFromInfo.red), Math.round(255 * colorFromInfo.green), Math.round(255 * colorFromInfo.blue), colorFromInfo.alpha));\n\n\t\tconst rgb = Color.Format.CSS.formatRGB(color);\n\t\tconst hsl = Color.Format.CSS.formatHSL(color);\n\t\tconst hex = Color.Format.CSS.formatHexA(color, true);\n\n\t\tconst colorPresentations: IColorPresentation[] = [];\n\t\tcolorPresentations.push({ label: rgb, textEdit: { range: range, text: rgb } });\n\t\tcolorPresentations.push({ label: hsl, textEdit: { range: range, text: hsl } });\n\t\tcolorPresentations.push({ label: hex, textEdit: { range: range, text: hex } });\n\t\treturn colorPresentations;\n\t}\n}\n\nexport class DefaultDocumentColorProviderFeature extends Disposable {\n\tconstructor(\n\t\t@ILanguageFeaturesService _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEditorWorkerService editorWorkerService: IEditorWorkerService,\n\t) {\n\t\tsuper();\n\t\tthis._register(_languageFeaturesService.colorProvider.register('*', new DefaultDocumentColorProvider(editorWorkerService)));\n\t}\n}\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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Color, RGBA } from '../../../../base/common/color.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { DocumentColorProvider, IColor, IColorInformation, IColorPresentation } from '../../../common/languages.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { IEditorWorkerService } from '../../../common/services/editorWorker.js';\n\nexport class DefaultDocumentColorProvider implements DocumentColorProvider {\n\n\tconstructor(\n\t\t@IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService,\n\t) { }\n\n\tasync provideDocumentColors(model: ITextModel, _token: CancellationToken): Promise<IColorInformation[] | null> {\n\t\treturn this._editorWorkerService.computeDefaultDocumentColors(model.uri);\n\t}\n\n\tprovideColorPresentations(_model: ITextModel, colorInfo: IColorInformation, _token: CancellationToken): IColorPresentation[] {\n\t\tconst range = colorInfo.range;\n\t\tconst colorFromInfo: IColor = colorInfo.color;\n\t\tconst color = new Color(new RGBA(Math.round(255 * colorFromInfo.red), Math.round(255 * colorFromInfo.green), Math.round(255 * colorFromInfo.blue), colorFromInfo.alpha));\n\n\t\tconst rgb = Color.Format.CSS.formatRGB(color);\n\t\tconst hsl = Color.Format.CSS.formatHSL(color);\n\t\tconst hex = Color.Format.CSS.formatHexA(color, true);\n\n\t\tconst colorPresentations: IColorPresentation[] = [];\n\t\tcolorPresentations.push({ label: rgb, textEdit: { range: range, text: rgb } });\n\t\tcolorPresentations.push({ label: hsl, textEdit: { range: range, text: hsl } });\n\t\tcolorPresentations.push({ label: hex, textEdit: { range: range, text: hex } });\n\t\treturn colorPresentations;\n\t}\n}\n\nexport class DefaultDocumentColorProviderFeature extends Disposable {\n\tconstructor(\n\t\t@ILanguageFeaturesService _languageFeaturesService: ILanguageFeaturesService,\n\t\t@IEditorWorkerService editorWorkerService: IEditorWorkerService,\n\t) {\n\t\tsuper();\n\t\tthis._register(_languageFeaturesService.colorProvider.register('*', new DefaultDocumentColorProvider(editorWorkerService)));\n\t}\n}\n\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "monaco-editor-core",
3
3
  "private": false,
4
- "version": "0.56.0-dev-20251223",
4
+ "version": "0.56.0-dev-20251225",
5
5
  "description": "A browser based code editor",
6
6
  "author": "Microsoft Corporation",
7
7
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "bugs": {
15
15
  "url": "https://github.com/microsoft/vscode/issues"
16
16
  },
17
- "vscodeCommitId": "e90ece8f4d188e9a931f8d74c596700670b26e6f",
17
+ "vscodeCommitId": "83f180cca394337d21374b4a4544fb6504bcf88e",
18
18
  "dependencies": {
19
19
  "marked": "14.0.0",
20
20
  "dompurify": "3.2.7"