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AhiB,KAAK6iB,UAAUlW,IAAIlL,EAAO6c,2BAA0Bjd,IAC3C4D,GAAU,qBAAuBA,EAAO5D,EAAEyC,WAC3C9D,KAAKuK,QACT,KAGI,EAARyX,GACAhiB,KAAK6iB,UAAUlW,IAAIlL,EAAOqhB,4BAA2BzhB,IAC5C4D,GAAU,kBAAoBA,EAAO5D,EAAExB,YACxCG,KAAKuK,QACT,KAGI,EAARyX,GACAhiB,KAAK6iB,UAAUlW,IAAIlL,EAAOshB,mBAAkBzM,GAAKtW,KAAKuK,YAE9C,EAARyX,IACAhiB,KAAK6iB,UAAUlW,IAAIlL,EAAO4e,kBAAiB/J,GAAKtW,KAAKuK,YACrDvK,KAAK6iB,UAAUlW,IAAIlL,EAAO6e,yBAAwBhK,GAAKtW,KAAKuK,YAEpE,CACA,OAAAhF,GACIvF,KAAK6iB,UAAUtd,UACf7D,MAAM6D,SACV,EAKG,MAAMyd,UAAyC,KAClD,WAAApjB,CAAYO,EAAOwH,GACfjG,MAAMiG,GACN3H,KAAK6iB,UAAY1iB,EAAM8iB,oBAAmB,IAAMjjB,KAAKuK,UACzD,CACA,OAAAhF,GACIvF,KAAK6iB,UAAUtd,UACf7D,MAAM6D,SACV,E","sources":["file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dnd/browser/dragAndDropCommand.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dnd/browser/dnd.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/browser/documentSymbols.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/browser/outlineModel.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/edit.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/editorState/browser/editorState.js"],"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 { Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nexport class DragAndDropCommand {\n constructor(selection, targetPosition, copy) {\n this.selection = selection;\n this.targetPosition = targetPosition;\n this.copy = copy;\n this.targetSelection = null;\n }\n getEditOperations(model, builder) {\n const text = model.getValueInRange(this.selection);\n if (!this.copy) {\n builder.addEditOperation(this.selection, null);\n }\n builder.addEditOperation(new Range(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column), text);\n if (this.selection.containsPosition(this.targetPosition) && !(this.copy && (this.selection.getEndPosition().equals(this.targetPosition) || this.selection.getStartPosition().equals(this.targetPosition)) // we allow users to paste content beside the selection\n )) {\n this.targetSelection = this.selection;\n return;\n }\n if (this.copy) {\n this.targetSelection = new Selection(this.targetPosition.lineNumber, this.targetPosition.column, this.selection.endLineNumber - this.selection.startLineNumber + this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ?\n this.targetPosition.column + this.selection.endColumn - this.selection.startColumn :\n this.selection.endColumn);\n return;\n }\n if (this.targetPosition.lineNumber > this.selection.endLineNumber) {\n // Drag the selection downwards\n this.targetSelection = new Selection(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ?\n this.targetPosition.column + this.selection.endColumn - this.selection.startColumn :\n this.selection.endColumn);\n return;\n }\n if (this.targetPosition.lineNumber < this.selection.endLineNumber) {\n // Drag the selection upwards\n this.targetSelection = new Selection(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber + this.selection.endLineNumber - this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ?\n this.targetPosition.column + this.selection.endColumn - this.selection.startColumn :\n this.selection.endColumn);\n return;\n }\n // The target position is at the same line as the selection's end position.\n if (this.selection.endColumn <= this.targetPosition.column) {\n // The target position is after the selection's end position\n this.targetSelection = new Selection(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ?\n this.targetPosition.column - this.selection.endColumn + this.selection.startColumn :\n this.targetPosition.column - this.selection.endColumn + this.selection.startColumn, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ?\n this.targetPosition.column :\n this.selection.endColumn);\n }\n else {\n // The target position is before the selection's end position. Since the selection doesn't contain the target position, the selection is one-line and target position is before this selection.\n this.targetSelection = new Selection(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column + this.selection.endColumn - this.selection.startColumn);\n }\n }\n computeCursorState(model, helper) {\n return this.targetSelection;\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 *--------------------------------------------------------------------------------------------*/\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { isMacintosh } from '../../../../base/common/platform.js';\nimport './dnd.css';\nimport { registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { DragAndDropCommand } from './dragAndDropCommand.js';\nfunction hasTriggerModifier(e) {\n if (isMacintosh) {\n return e.altKey;\n }\n else {\n return e.ctrlKey;\n }\n}\nexport class DragAndDropController extends Disposable {\n constructor(editor) {\n super();\n this._editor = editor;\n this._dndDecorationIds = this._editor.createDecorationsCollection();\n this._register(this._editor.onMouseDown((e) => this._onEditorMouseDown(e)));\n this._register(this._editor.onMouseUp((e) => this._onEditorMouseUp(e)));\n this._register(this._editor.onMouseDrag((e) => this._onEditorMouseDrag(e)));\n this._register(this._editor.onMouseDrop((e) => this._onEditorMouseDrop(e)));\n this._register(this._editor.onMouseDropCanceled(() => this._onEditorMouseDropCanceled()));\n this._register(this._editor.onKeyDown((e) => this.onEditorKeyDown(e)));\n this._register(this._editor.onKeyUp((e) => this.onEditorKeyUp(e)));\n this._register(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur()));\n this._register(this._editor.onDidBlurEditorText(() => this.onEditorBlur()));\n this._mouseDown = false;\n this._modifierPressed = false;\n this._dragSelection = null;\n }\n onEditorBlur() {\n this._removeDecoration();\n this._dragSelection = null;\n this._mouseDown = false;\n this._modifierPressed = false;\n }\n onEditorKeyDown(e) {\n if (!this._editor.getOption(35 /* EditorOption.dragAndDrop */) || this._editor.getOption(22 /* EditorOption.columnSelection */)) {\n return;\n }\n if (hasTriggerModifier(e)) {\n this._modifierPressed = true;\n }\n if (this._mouseDown && hasTriggerModifier(e)) {\n this._editor.updateOptions({\n mouseStyle: 'copy'\n });\n }\n }\n onEditorKeyUp(e) {\n if (!this._editor.getOption(35 /* EditorOption.dragAndDrop */) || this._editor.getOption(22 /* EditorOption.columnSelection */)) {\n return;\n }\n if (hasTriggerModifier(e)) {\n this._modifierPressed = false;\n }\n if (this._mouseDown && e.keyCode === DragAndDropController.TRIGGER_KEY_VALUE) {\n this._editor.updateOptions({\n mouseStyle: 'default'\n });\n }\n }\n _onEditorMouseDown(mouseEvent) {\n this._mouseDown = true;\n }\n _onEditorMouseUp(mouseEvent) {\n this._mouseDown = false;\n // Whenever users release the mouse, the drag and drop operation should finish and the cursor should revert to text.\n this._editor.updateOptions({\n mouseStyle: 'text'\n });\n }\n _onEditorMouseDrag(mouseEvent) {\n const target = mouseEvent.target;\n if (this._dragSelection === null) {\n const selections = this._editor.getSelections() || [];\n const possibleSelections = selections.filter(selection => target.position && selection.containsPosition(target.position));\n if (possibleSelections.length === 1) {\n this._dragSelection = possibleSelections[0];\n }\n else {\n return;\n }\n }\n if (hasTriggerModifier(mouseEvent.event)) {\n this._editor.updateOptions({\n mouseStyle: 'copy'\n });\n }\n else {\n this._editor.updateOptions({\n mouseStyle: 'default'\n });\n }\n if (target.position) {\n if (this._dragSelection.containsPosition(target.position)) {\n this._removeDecoration();\n }\n else {\n this.showAt(target.position);\n }\n }\n }\n _onEditorMouseDropCanceled() {\n this._editor.updateOptions({\n mouseStyle: 'text'\n });\n this._removeDecoration();\n this._dragSelection = null;\n this._mouseDown = false;\n }\n _onEditorMouseDrop(mouseEvent) {\n if (mouseEvent.target && (this._hitContent(mouseEvent.target) || this._hitMargin(mouseEvent.target)) && mouseEvent.target.position) {\n const newCursorPosition = new Position(mouseEvent.target.position.lineNumber, mouseEvent.target.position.column);\n if (this._dragSelection === null) {\n let newSelections = null;\n if (mouseEvent.event.shiftKey) {\n const primarySelection = this._editor.getSelection();\n if (primarySelection) {\n const { selectionStartLineNumber, selectionStartColumn } = primarySelection;\n newSelections = [new Selection(selectionStartLineNumber, selectionStartColumn, newCursorPosition.lineNumber, newCursorPosition.column)];\n }\n }\n else {\n newSelections = (this._editor.getSelections() || []).map(selection => {\n if (selection.containsPosition(newCursorPosition)) {\n return new Selection(newCursorPosition.lineNumber, newCursorPosition.column, newCursorPosition.lineNumber, newCursorPosition.column);\n }\n else {\n return selection;\n }\n });\n }\n // Use `mouse` as the source instead of `api` and setting the reason to explicit (to behave like any other mouse operation).\n this._editor.setSelections(newSelections || [], 'mouse', 3 /* CursorChangeReason.Explicit */);\n }\n else if (!this._dragSelection.containsPosition(newCursorPosition) ||\n ((hasTriggerModifier(mouseEvent.event) ||\n this._modifierPressed) && (this._dragSelection.getEndPosition().equals(newCursorPosition) || this._dragSelection.getStartPosition().equals(newCursorPosition)) // we allow users to paste content beside the selection\n )) {\n this._editor.pushUndoStop();\n this._editor.executeCommand(DragAndDropController.ID, new DragAndDropCommand(this._dragSelection, newCursorPosition, hasTriggerModifier(mouseEvent.event) || this._modifierPressed));\n this._editor.pushUndoStop();\n }\n }\n this._editor.updateOptions({\n mouseStyle: 'text'\n });\n this._removeDecoration();\n this._dragSelection = null;\n this._mouseDown = false;\n }\n showAt(position) {\n this._dndDecorationIds.set([{\n range: new Range(position.lineNumber, position.column, position.lineNumber, position.column),\n options: DragAndDropController._DECORATION_OPTIONS\n }]);\n this._editor.revealPosition(position, 1 /* ScrollType.Immediate */);\n }\n _removeDecoration() {\n this._dndDecorationIds.clear();\n }\n _hitContent(target) {\n return target.type === 6 /* MouseTargetType.CONTENT_TEXT */ ||\n target.type === 7 /* MouseTargetType.CONTENT_EMPTY */;\n }\n _hitMargin(target) {\n return target.type === 2 /* MouseTargetType.GUTTER_GLYPH_MARGIN */ ||\n target.type === 3 /* MouseTargetType.GUTTER_LINE_NUMBERS */ ||\n target.type === 4 /* MouseTargetType.GUTTER_LINE_DECORATIONS */;\n }\n dispose() {\n this._removeDecoration();\n this._dragSelection = null;\n this._mouseDown = false;\n this._modifierPressed = false;\n super.dispose();\n }\n}\nDragAndDropController.ID = 'editor.contrib.dragAndDrop';\nDragAndDropController.TRIGGER_KEY_VALUE = isMacintosh ? 6 /* KeyCode.Alt */ : 5 /* KeyCode.Ctrl */;\nDragAndDropController._DECORATION_OPTIONS = ModelDecorationOptions.register({\n description: 'dnd-target',\n className: 'dnd-target'\n});\nregisterEditorContribution(DragAndDropController.ID, DragAndDropController, 2 /* EditorContributionInstantiation.BeforeFirstInteraction */);\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 { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { assertType } from '../../../../base/common/types.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { ITextModelService } from '../../../common/services/resolverService.js';\nimport { IOutlineModelService } from './outlineModel.js';\nimport { CommandsRegistry } from '../../../../platform/commands/common/commands.js';\nCommandsRegistry.registerCommand('_executeDocumentSymbolProvider', async function (accessor, ...args) {\n const [resource] = args;\n assertType(URI.isUri(resource));\n const outlineService = accessor.get(IOutlineModelService);\n const modelService = accessor.get(ITextModelService);\n const reference = await modelService.createModelReference(resource);\n try {\n return (await outlineService.getOrCreate(reference.object.textEditorModel, CancellationToken.None)).getTopLevelSymbols();\n }\n finally {\n reference.dispose();\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 *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { equals } from '../../../../base/common/arrays.js';\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { onUnexpectedExternalError } from '../../../../base/common/errors.js';\nimport { Iterable } from '../../../../base/common/iterator.js';\nimport { LRUCache } from '../../../../base/common/map.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';\nimport { registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { IModelService } from '../../../common/services/model.js';\nimport { DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nexport class TreeElement {\n remove() {\n var _a;\n (_a = this.parent) === null || _a === void 0 ? void 0 : _a.children.delete(this.id);\n }\n static findId(candidate, container) {\n // complex id-computation which contains the origin/extension,\n // the parent path, and some dedupe logic when names collide\n let candidateId;\n if (typeof candidate === 'string') {\n candidateId = `${container.id}/${candidate}`;\n }\n else {\n candidateId = `${container.id}/${candidate.name}`;\n if (container.children.get(candidateId) !== undefined) {\n candidateId = `${container.id}/${candidate.name}_${candidate.range.startLineNumber}_${candidate.range.startColumn}`;\n }\n }\n let id = candidateId;\n for (let i = 0; container.children.get(id) !== undefined; i++) {\n id = `${candidateId}_${i}`;\n }\n return id;\n }\n static empty(element) {\n return element.children.size === 0;\n }\n}\nexport class OutlineElement extends TreeElement {\n constructor(id, parent, symbol) {\n super();\n this.id = id;\n this.parent = parent;\n this.symbol = symbol;\n this.children = new Map();\n }\n}\nexport class OutlineGroup extends TreeElement {\n constructor(id, parent, label, order) {\n super();\n this.id = id;\n this.parent = parent;\n this.label = label;\n this.order = order;\n this.children = new Map();\n }\n}\nexport class OutlineModel extends TreeElement {\n static create(registry, textModel, token) {\n const cts = new CancellationTokenSource(token);\n const result = new OutlineModel(textModel.uri);\n const provider = registry.ordered(textModel);\n const promises = provider.map((provider, index) => {\n var _a;\n const id = TreeElement.findId(`provider_${index}`, result);\n const group = new OutlineGroup(id, result, (_a = provider.displayName) !== null && _a !== void 0 ? _a : 'Unknown Outline Provider', index);\n return Promise.resolve(provider.provideDocumentSymbols(textModel, cts.token)).then(result => {\n for (const info of result || []) {\n OutlineModel._makeOutlineElement(info, group);\n }\n return group;\n }, err => {\n onUnexpectedExternalError(err);\n return group;\n }).then(group => {\n if (!TreeElement.empty(group)) {\n result._groups.set(id, group);\n }\n else {\n group.remove();\n }\n });\n });\n const listener = registry.onDidChange(() => {\n const newProvider = registry.ordered(textModel);\n if (!equals(newProvider, provider)) {\n cts.cancel();\n }\n });\n return Promise.all(promises).then(() => {\n if (cts.token.isCancellationRequested && !token.isCancellationRequested) {\n return OutlineModel.create(registry, textModel, token);\n }\n else {\n return result._compact();\n }\n }).finally(() => {\n cts.dispose();\n listener.dispose();\n cts.dispose();\n });\n }\n static _makeOutlineElement(info, container) {\n const id = TreeElement.findId(info, container);\n const res = new OutlineElement(id, container, info);\n if (info.children) {\n for (const childInfo of info.children) {\n OutlineModel._makeOutlineElement(childInfo, res);\n }\n }\n container.children.set(res.id, res);\n }\n constructor(uri) {\n super();\n this.uri = uri;\n this.id = 'root';\n this.parent = undefined;\n this._groups = new Map();\n this.children = new Map();\n this.id = 'root';\n this.parent = undefined;\n }\n _compact() {\n let count = 0;\n for (const [key, group] of this._groups) {\n if (group.children.size === 0) { // empty\n this._groups.delete(key);\n }\n else {\n count += 1;\n }\n }\n if (count !== 1) {\n //\n this.children = this._groups;\n }\n else {\n // adopt all elements of the first group\n const group = Iterable.first(this._groups.values());\n for (const [, child] of group.children) {\n child.parent = this;\n this.children.set(child.id, child);\n }\n }\n return this;\n }\n getTopLevelSymbols() {\n const roots = [];\n for (const child of this.children.values()) {\n if (child instanceof OutlineElement) {\n roots.push(child.symbol);\n }\n else {\n roots.push(...Iterable.map(child.children.values(), child => child.symbol));\n }\n }\n return roots.sort((a, b) => Range.compareRangesUsingStarts(a.range, b.range));\n }\n asListOfDocumentSymbols() {\n const roots = this.getTopLevelSymbols();\n const bucket = [];\n OutlineModel._flattenDocumentSymbols(bucket, roots, '');\n return bucket.sort((a, b) => Position.compare(Range.getStartPosition(a.range), Range.getStartPosition(b.range)) || Position.compare(Range.getEndPosition(b.range), Range.getEndPosition(a.range)));\n }\n static _flattenDocumentSymbols(bucket, entries, overrideContainerLabel) {\n for (const entry of entries) {\n bucket.push({\n kind: entry.kind,\n tags: entry.tags,\n name: entry.name,\n detail: entry.detail,\n containerName: entry.containerName || overrideContainerLabel,\n range: entry.range,\n selectionRange: entry.selectionRange,\n children: undefined, // we flatten it...\n });\n // Recurse over children\n if (entry.children) {\n OutlineModel._flattenDocumentSymbols(bucket, entry.children, entry.name);\n }\n }\n }\n}\nexport const IOutlineModelService = createDecorator('IOutlineModelService');\nlet OutlineModelService = class OutlineModelService {\n constructor(_languageFeaturesService, debounces, modelService) {\n this._languageFeaturesService = _languageFeaturesService;\n this._disposables = new DisposableStore();\n this._cache = new LRUCache(10, 0.7);\n this._debounceInformation = debounces.for(_languageFeaturesService.documentSymbolProvider, 'DocumentSymbols', { min: 350 });\n // don't cache outline models longer than their text model\n this._disposables.add(modelService.onModelRemoved(textModel => {\n this._cache.delete(textModel.id);\n }));\n }\n dispose() {\n this._disposables.dispose();\n }\n async getOrCreate(textModel, token) {\n const registry = this._languageFeaturesService.documentSymbolProvider;\n const provider = registry.ordered(textModel);\n let data = this._cache.get(textModel.id);\n if (!data || data.versionId !== textModel.getVersionId() || !equals(data.provider, provider)) {\n const source = new CancellationTokenSource();\n data = {\n versionId: textModel.getVersionId(),\n provider,\n promiseCnt: 0,\n source,\n promise: OutlineModel.create(registry, textModel, source.token),\n model: undefined,\n };\n this._cache.set(textModel.id, data);\n const now = Date.now();\n data.promise.then(outlineModel => {\n data.model = outlineModel;\n this._debounceInformation.update(textModel, Date.now() - now);\n }).catch(_err => {\n this._cache.delete(textModel.id);\n });\n }\n if (data.model) {\n // resolved -> return data\n return data.model;\n }\n // increase usage counter\n data.promiseCnt += 1;\n const listener = token.onCancellationRequested(() => {\n // last -> cancel provider request, remove cached promise\n if (--data.promiseCnt === 0) {\n data.source.cancel();\n this._cache.delete(textModel.id);\n }\n });\n try {\n return await data.promise;\n }\n finally {\n listener.dispose();\n }\n }\n};\nOutlineModelService = __decorate([\n __param(0, ILanguageFeaturesService),\n __param(1, ILanguageFeatureDebounceService),\n __param(2, IModelService)\n], OutlineModelService);\nexport { OutlineModelService };\nregisterSingleton(IOutlineModelService, OutlineModelService, 1 /* InstantiationType.Delayed */);\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 *--------------------------------------------------------------------------------------------*/\nvar _a;\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { registerEditorFeature } from '../../../common/editorFeatures.js';\nimport { CopyPasteController, changePasteTypeCommandId, pasteWidgetVisibleCtx } from './copyPasteController.js';\nimport { DefaultPasteProvidersFeature, DefaultTextPasteOrDropEditProvider } from './defaultProviders.js';\nimport * as nls from '../../../../nls.js';\nregisterEditorContribution(CopyPasteController.ID, CopyPasteController, 0 /* EditorContributionInstantiation.Eager */); // eager because it listens to events on the container dom node of the editor\nregisterEditorFeature(DefaultPasteProvidersFeature);\nregisterEditorCommand(new class extends EditorCommand {\n constructor() {\n super({\n id: changePasteTypeCommandId,\n precondition: pasteWidgetVisibleCtx,\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */,\n primary: 2048 /* KeyMod.CtrlCmd */ | 89 /* KeyCode.Period */,\n }\n });\n }\n runEditorCommand(_accessor, editor) {\n var _b;\n return (_b = CopyPasteController.get(editor)) === null || _b === void 0 ? void 0 : _b.changePasteType();\n }\n});\nregisterEditorCommand(new class extends EditorCommand {\n constructor() {\n super({\n id: 'editor.hidePasteWidget',\n precondition: pasteWidgetVisibleCtx,\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */,\n primary: 9 /* KeyCode.Escape */,\n }\n });\n }\n runEditorCommand(_accessor, editor) {\n var _b;\n (_b = CopyPasteController.get(editor)) === null || _b === void 0 ? void 0 : _b.clearWidgets();\n }\n});\nregisterEditorAction((_a = class PasteAsAction extends EditorAction {\n constructor() {\n super({\n id: 'editor.action.pasteAs',\n label: nls.localize('pasteAs', \"Paste As...\"),\n alias: 'Paste As...',\n precondition: EditorContextKeys.writable,\n metadata: {\n description: 'Paste as',\n args: [{\n name: 'args',\n schema: _a.argsSchema\n }]\n }\n });\n }\n run(_accessor, editor, args) {\n var _b;\n let kind = typeof (args === null || args === void 0 ? void 0 : args.kind) === 'string' ? args.kind : undefined;\n if (!kind && args) {\n // Support old id property\n // TODO: remove this in the future\n kind = typeof args.id === 'string' ? args.id : undefined;\n }\n return (_b = CopyPasteController.get(editor)) === null || _b === void 0 ? void 0 : _b.pasteAs(kind ? new HierarchicalKind(kind) : undefined);\n }\n },\n _a.argsSchema = {\n type: 'object',\n properties: {\n kind: {\n type: 'string',\n description: nls.localize('pasteAs.kind', \"The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.\"),\n }\n },\n },\n _a));\nregisterEditorAction(class extends EditorAction {\n constructor() {\n super({\n id: 'editor.action.pasteAsText',\n label: nls.localize('pasteAsText', \"Paste as Text\"),\n alias: 'Paste as Text',\n precondition: EditorContextKeys.writable,\n });\n }\n run(_accessor, editor) {\n var _b;\n return (_b = CopyPasteController.get(editor)) === null || _b === void 0 ? void 0 : _b.pasteAs({ providerId: DefaultTextPasteOrDropEditProvider.id });\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 *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar CopyPasteController_1;\nimport { addDisposableListener, getActiveDocument } from '../../../../base/browser/dom.js';\nimport { coalesce } from '../../../../base/common/arrays.js';\nimport { createCancelablePromise, raceCancellation } from '../../../../base/common/async.js';\nimport { UriList, createStringDataTransferItem, matchesMimeType } from '../../../../base/common/dataTransfer.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { Mimes } from '../../../../base/common/mime.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport { generateUuid } from '../../../../base/common/uuid.js';\nimport { ClipboardEventUtils } from '../../../browser/controller/textAreaInput.js';\nimport { toExternalVSDataTransfer, toVSDataTransfer } from '../../../browser/dnd.js';\nimport { IBulkEditService } from '../../../browser/services/bulkEditService.js';\nimport { Range } from '../../../common/core/range.js';\nimport { DocumentPasteTriggerKind } from '../../../common/languages.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { DefaultTextPasteOrDropEditProvider } from './defaultProviders.js';\nimport { createCombinedWorkspaceEdit, sortEditsByYieldTo } from './edit.js';\nimport { EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js';\nimport { InlineProgressManager } from '../../inlineProgress/browser/inlineProgress.js';\nimport { MessageController } from '../../message/browser/messageController.js';\nimport { localize } from '../../../../nls.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IProgressService } from '../../../../platform/progress/common/progress.js';\nimport { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js';\nimport { PostEditWidgetManager } from './postEditWidget.js';\nexport const changePasteTypeCommandId = 'editor.changePasteType';\nexport const pasteWidgetVisibleCtx = new RawContextKey('pasteWidgetVisible', false, localize('pasteWidgetVisible', \"Whether the paste widget is showing\"));\nconst vscodeClipboardMime = 'application/vnd.code.copyMetadata';\nlet CopyPasteController = CopyPasteController_1 = class CopyPasteController extends Disposable {\n static get(editor) {\n return editor.getContribution(CopyPasteController_1.ID);\n }\n constructor(editor, instantiationService, _bulkEditService, _clipboardService, _languageFeaturesService, _quickInputService, _progressService) {\n super();\n this._bulkEditService = _bulkEditService;\n this._clipboardService = _clipboardService;\n this._languageFeaturesService = _languageFeaturesService;\n this._quickInputService = _quickInputService;\n this._progressService = _progressService;\n this._editor = editor;\n const container = editor.getContainerDomNode();\n this._register(addDisposableListener(container, 'copy', e => this.handleCopy(e)));\n this._register(addDisposableListener(container, 'cut', e => this.handleCopy(e)));\n this._register(addDisposableListener(container, 'paste', e => this.handlePaste(e), true));\n this._pasteProgressManager = this._register(new InlineProgressManager('pasteIntoEditor', editor, instantiationService));\n this._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'pasteIntoEditor', editor, pasteWidgetVisibleCtx, { id: changePasteTypeCommandId, label: localize('postPasteWidgetTitle', \"Show paste options...\") }));\n }\n changePasteType() {\n this._postPasteWidgetManager.tryShowSelector();\n }\n pasteAs(preferred) {\n this._editor.focus();\n try {\n this._pasteAsActionContext = { preferred };\n getActiveDocument().execCommand('paste');\n }\n finally {\n this._pasteAsActionContext = undefined;\n }\n }\n clearWidgets() {\n this._postPasteWidgetManager.clear();\n }\n isPasteAsEnabled() {\n return this._editor.getOption(85 /* EditorOption.pasteAs */).enabled\n && !this._editor.getOption(91 /* EditorOption.readOnly */);\n }\n async finishedPaste() {\n await this._currentPasteOperation;\n }\n handleCopy(e) {\n var _a, _b;\n if (!this._editor.hasTextFocus()) {\n return;\n }\n if (platform.isWeb) {\n // Explicitly clear the web resources clipboard.\n // This is needed because on web, the browser clipboard is faked out using an in-memory store.\n // This means the resources clipboard is not properly updated when copying from the editor.\n this._clipboardService.writeResources([]);\n }\n if (!e.clipboardData || !this.isPasteAsEnabled()) {\n return;\n }\n const model = this._editor.getModel();\n const selections = this._editor.getSelections();\n if (!model || !(selections === null || selections === void 0 ? void 0 : selections.length)) {\n return;\n }\n const enableEmptySelectionClipboard = this._editor.getOption(37 /* EditorOption.emptySelectionClipboard */);\n let ranges = selections;\n const wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty();\n if (wasFromEmptySelection) {\n if (!enableEmptySelectionClipboard) {\n return;\n }\n ranges = [new Range(ranges[0].startLineNumber, 1, ranges[0].startLineNumber, 1 + model.getLineLength(ranges[0].startLineNumber))];\n }\n const toCopy = (_a = this._editor._getViewModel()) === null || _a === void 0 ? void 0 : _a.getPlainTextToCopy(selections, enableEmptySelectionClipboard, platform.isWindows);\n const multicursorText = Array.isArray(toCopy) ? toCopy : null;\n const defaultPastePayload = {\n multicursorText,\n pasteOnNewLine: wasFromEmptySelection,\n mode: null\n };\n const providers = this._languageFeaturesService.documentPasteEditProvider\n .ordered(model)\n .filter(x => !!x.prepareDocumentPaste);\n if (!providers.length) {\n this.setCopyMetadata(e.clipboardData, { defaultPastePayload });\n return;\n }\n const dataTransfer = toVSDataTransfer(e.clipboardData);\n const providerCopyMimeTypes = providers.flatMap(x => { var _a; return (_a = x.copyMimeTypes) !== null && _a !== void 0 ? _a : []; });\n // Save off a handle pointing to data that VS Code maintains.\n const handle = generateUuid();\n this.setCopyMetadata(e.clipboardData, {\n id: handle,\n providerCopyMimeTypes,\n defaultPastePayload\n });\n const promise = createCancelablePromise(async (token) => {\n const results = coalesce(await Promise.all(providers.map(async (provider) => {\n try {\n return await provider.prepareDocumentPaste(model, ranges, dataTransfer, token);\n }\n catch (err) {\n console.error(err);\n return undefined;\n }\n })));\n // Values from higher priority providers should overwrite values from lower priority ones.\n // Reverse the array to so that the calls to `replace` below will do this\n results.reverse();\n for (const result of results) {\n for (const [mime, value] of result) {\n dataTransfer.replace(mime, value);\n }\n }\n return dataTransfer;\n });\n (_b = CopyPasteController_1._currentCopyOperation) === null || _b === void 0 ? void 0 : _b.dataTransferPromise.cancel();\n CopyPasteController_1._currentCopyOperation = { handle: handle, dataTransferPromise: promise };\n }\n async handlePaste(e) {\n var _a, _b, _c, _d;\n if (!e.clipboardData || !this._editor.hasTextFocus()) {\n return;\n }\n (_a = MessageController.get(this._editor)) === null || _a === void 0 ? void 0 : _a.closeMessage();\n (_b = this._currentPasteOperation) === null || _b === void 0 ? void 0 : _b.cancel();\n this._currentPasteOperation = undefined;\n const model = this._editor.getModel();\n const selections = this._editor.getSelections();\n if (!(selections === null || selections === void 0 ? void 0 : selections.length) || !model) {\n return;\n }\n if (!this.isPasteAsEnabled()\n && !this._pasteAsActionContext // Still enable if paste as was explicitly requested\n ) {\n return;\n }\n const metadata = this.fetchCopyMetadata(e);\n const dataTransfer = toExternalVSDataTransfer(e.clipboardData);\n dataTransfer.delete(vscodeClipboardMime);\n const allPotentialMimeTypes = [\n ...e.clipboardData.types,\n ...(_c = metadata === null || metadata === void 0 ? void 0 : metadata.providerCopyMimeTypes) !== null && _c !== void 0 ? _c : [],\n // TODO: always adds `uri-list` because this get set if there are resources in the system clipboard.\n // However we can only check the system clipboard async. For this early check, just add it in.\n // We filter providers again once we have the final dataTransfer we will use.\n Mimes.uriList,\n ];\n const allProviders = this._languageFeaturesService.documentPasteEditProvider\n .ordered(model)\n .filter(provider => {\n var _a, _b;\n // Filter out providers that don't match the requested paste types\n const preference = (_a = this._pasteAsActionContext) === null || _a === void 0 ? void 0 : _a.preferred;\n if (preference) {\n if (provider.providedPasteEditKinds && !this.providerMatchesPreference(provider, preference)) {\n return false;\n }\n }\n // And providers that don't handle any of mime types in the clipboard\n return (_b = provider.pasteMimeTypes) === null || _b === void 0 ? void 0 : _b.some(type => matchesMimeType(type, allPotentialMimeTypes));\n });\n if (!allProviders.length) {\n if ((_d = this._pasteAsActionContext) === null || _d === void 0 ? void 0 : _d.preferred) {\n this.showPasteAsNoEditMessage(selections, this._pasteAsActionContext.preferred);\n }\n return;\n }\n // Prevent the editor's default paste handler from running.\n // Note that after this point, we are fully responsible for handling paste.\n // If we can't provider a paste for any reason, we need to explicitly delegate pasting back to the editor.\n e.preventDefault();\n e.stopImmediatePropagation();\n if (this._pasteAsActionContext) {\n this.showPasteAsPick(this._pasteAsActionContext.preferred, allProviders, selections, dataTransfer, metadata);\n }\n else {\n this.doPasteInline(allProviders, selections, dataTransfer, metadata, e);\n }\n }\n showPasteAsNoEditMessage(selections, preference) {\n var _a;\n (_a = MessageController.get(this._editor)) === null || _a === void 0 ? void 0 : _a.showMessage(localize('pasteAsError', \"No paste edits for '{0}' found\", preference instanceof HierarchicalKind ? preference.value : preference.providerId), selections[0].getStartPosition());\n }\n doPasteInline(allProviders, selections, dataTransfer, metadata, clipboardEvent) {\n const p = createCancelablePromise(async (token) => {\n const editor = this._editor;\n if (!editor.hasModel()) {\n return;\n }\n const model = editor.getModel();\n const tokenSource = new EditorStateCancellationTokenSource(editor, 1 /* CodeEditorStateFlag.Value */ | 2 /* CodeEditorStateFlag.Selection */, undefined, token);\n try {\n await this.mergeInDataFromCopy(dataTransfer, metadata, tokenSource.token);\n if (tokenSource.token.isCancellationRequested) {\n return;\n }\n const supportedProviders = allProviders.filter(provider => this.isSupportedPasteProvider(provider, dataTransfer));\n if (!supportedProviders.length\n || (supportedProviders.length === 1 && supportedProviders[0] instanceof DefaultTextPasteOrDropEditProvider) // Only our default text provider is active\n ) {\n return this.applyDefaultPasteHandler(dataTransfer, metadata, tokenSource.token, clipboardEvent);\n }\n const context = {\n triggerKind: DocumentPasteTriggerKind.Automatic,\n };\n const providerEdits = await this.getPasteEdits(supportedProviders, dataTransfer, model, selections, context, tokenSource.token);\n if (tokenSource.token.isCancellationRequested) {\n return;\n }\n // If the only edit returned is our default text edit, use the default paste handler\n if (providerEdits.length === 1 && providerEdits[0].provider instanceof DefaultTextPasteOrDropEditProvider) {\n return this.applyDefaultPasteHandler(dataTransfer, metadata, tokenSource.token, clipboardEvent);\n }\n if (providerEdits.length) {\n const canShowWidget = editor.getOption(85 /* EditorOption.pasteAs */).showPasteSelector === 'afterPaste';\n return this._postPasteWidgetManager.applyEditAndShowIfNeeded(selections, { activeEditIndex: 0, allEdits: providerEdits }, canShowWidget, async (edit, token) => {\n var _a, _b;\n const resolved = await ((_b = (_a = edit.provider).resolveDocumentPasteEdit) === null || _b === void 0 ? void 0 : _b.call(_a, edit, token));\n if (resolved) {\n edit.additionalEdit = resolved.additionalEdit;\n }\n return edit;\n }, tokenSource.token);\n }\n await this.applyDefaultPasteHandler(dataTransfer, metadata, tokenSource.token, clipboardEvent);\n }\n finally {\n tokenSource.dispose();\n if (this._currentPasteOperation === p) {\n this._currentPasteOperation = undefined;\n }\n }\n });\n this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize('pasteIntoEditorProgress', \"Running paste handlers. Click to cancel\"), p);\n this._currentPasteOperation = p;\n }\n showPasteAsPick(preference, allProviders, selections, dataTransfer, metadata) {\n const p = createCancelablePromise(async (token) => {\n const editor = this._editor;\n if (!editor.hasModel()) {\n return;\n }\n const model = editor.getModel();\n const tokenSource = new EditorStateCancellationTokenSource(editor, 1 /* CodeEditorStateFlag.Value */ | 2 /* CodeEditorStateFlag.Selection */, undefined, token);\n try {\n await this.mergeInDataFromCopy(dataTransfer, metadata, tokenSource.token);\n if (tokenSource.token.isCancellationRequested) {\n return;\n }\n // Filter out any providers the don't match the full data transfer we will send them.\n let supportedProviders = allProviders.filter(provider => this.isSupportedPasteProvider(provider, dataTransfer, preference));\n if (preference) {\n // We are looking for a specific edit\n supportedProviders = supportedProviders.filter(provider => this.providerMatchesPreference(provider, preference));\n }\n const context = {\n triggerKind: DocumentPasteTriggerKind.PasteAs,\n only: preference && preference instanceof HierarchicalKind ? preference : undefined,\n };\n let providerEdits = await this.getPasteEdits(supportedProviders, dataTransfer, model, selections, context, tokenSource.token);\n if (tokenSource.token.isCancellationRequested) {\n return;\n }\n // Filter out any edits that don't match the requested kind\n if (preference) {\n providerEdits = providerEdits.filter(edit => {\n if (preference instanceof HierarchicalKind) {\n return preference.contains(edit.kind);\n }\n else {\n return preference.providerId === edit.provider.id;\n }\n });\n }\n if (!providerEdits.length) {\n if (context.only) {\n this.showPasteAsNoEditMessage(selections, context.only);\n }\n return;\n }\n let pickedEdit;\n if (preference) {\n pickedEdit = providerEdits.at(0);\n }\n else {\n const selected = await this._quickInputService.pick(providerEdits.map((edit) => {\n var _a;\n return ({\n label: edit.title,\n description: (_a = edit.kind) === null || _a === void 0 ? void 0 : _a.value,\n edit,\n });\n }), {\n placeHolder: localize('pasteAsPickerPlaceholder', \"Select Paste Action\"),\n });\n pickedEdit = selected === null || selected === void 0 ? void 0 : selected.edit;\n }\n if (!pickedEdit) {\n return;\n }\n const combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, selections, pickedEdit);\n await this._bulkEditService.apply(combinedWorkspaceEdit, { editor: this._editor });\n }\n finally {\n tokenSource.dispose();\n if (this._currentPasteOperation === p) {\n this._currentPasteOperation = undefined;\n }\n }\n });\n this._progressService.withProgress({\n location: 10 /* ProgressLocation.Window */,\n title: localize('pasteAsProgress', \"Running paste handlers\"),\n }, () => p);\n }\n setCopyMetadata(dataTransfer, metadata) {\n dataTransfer.setData(vscodeClipboardMime, JSON.stringify(metadata));\n }\n fetchCopyMetadata(e) {\n var _a;\n if (!e.clipboardData) {\n return;\n }\n // Prefer using the clipboard data we saved off\n const rawMetadata = e.clipboardData.getData(vscodeClipboardMime);\n if (rawMetadata) {\n try {\n return JSON.parse(rawMetadata);\n }\n catch (_b) {\n return undefined;\n }\n }\n // Otherwise try to extract the generic text editor metadata\n const [_, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n if (metadata) {\n return {\n defaultPastePayload: {\n mode: metadata.mode,\n multicursorText: (_a = metadata.multicursorText) !== null && _a !== void 0 ? _a : null,\n pasteOnNewLine: !!metadata.isFromEmptySelection,\n },\n };\n }\n return undefined;\n }\n async mergeInDataFromCopy(dataTransfer, metadata, token) {\n var _a;\n if ((metadata === null || metadata === void 0 ? void 0 : metadata.id) && ((_a = CopyPasteController_1._currentCopyOperation) === null || _a === void 0 ? void 0 : _a.handle) === metadata.id) {\n const toMergeDataTransfer = await CopyPasteController_1._currentCopyOperation.dataTransferPromise;\n if (token.isCancellationRequested) {\n return;\n }\n for (const [key, value] of toMergeDataTransfer) {\n dataTransfer.replace(key, value);\n }\n }\n if (!dataTransfer.has(Mimes.uriList)) {\n const resources = await this._clipboardService.readResources();\n if (token.isCancellationRequested) {\n return;\n }\n if (resources.length) {\n dataTransfer.append(Mimes.uriList, createStringDataTransferItem(UriList.create(resources)));\n }\n }\n }\n async getPasteEdits(providers, dataTransfer, model, selections, context, token) {\n const results = await raceCancellation(Promise.all(providers.map(async (provider) => {\n var _a, _b;\n try {\n const edits = await ((_a = provider.provideDocumentPasteEdits) === null || _a === void 0 ? void 0 : _a.call(provider, model, selections, dataTransfer, context, token));\n // TODO: dispose of edits\n return (_b = edits === null || edits === void 0 ? void 0 : edits.edits) === null || _b === void 0 ? void 0 : _b.map(edit => ({ ...edit, provider }));\n }\n catch (err) {\n console.error(err);\n }\n return undefined;\n })), token);\n const edits = coalesce(results !== null && results !== void 0 ? results : []).flat().filter(edit => {\n return !context.only || context.only.contains(edit.kind);\n });\n return sortEditsByYieldTo(edits);\n }\n async applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent) {\n var _a, _b, _c, _d;\n const textDataTransfer = (_a = dataTransfer.get(Mimes.text)) !== null && _a !== void 0 ? _a : dataTransfer.get('text');\n const text = (_b = (await (textDataTransfer === null || textDataTransfer === void 0 ? void 0 : textDataTransfer.asString()))) !== null && _b !== void 0 ? _b : '';\n if (token.isCancellationRequested) {\n return;\n }\n const payload = {\n clipboardEvent,\n text,\n pasteOnNewLine: (_c = metadata === null || metadata === void 0 ? void 0 : metadata.defaultPastePayload.pasteOnNewLine) !== null && _c !== void 0 ? _c : false,\n multicursorText: (_d = metadata === null || metadata === void 0 ? void 0 : metadata.defaultPastePayload.multicursorText) !== null && _d !== void 0 ? _d : null,\n mode: null,\n };\n this._editor.trigger('keyboard', \"paste\" /* Handler.Paste */, payload);\n }\n /**\n * Filter out providers if they:\n * - Don't handle any of the data transfer types we have\n * - Don't match the preferred paste kind\n */\n isSupportedPasteProvider(provider, dataTransfer, preference) {\n var _a;\n if (!((_a = provider.pasteMimeTypes) === null || _a === void 0 ? void 0 : _a.some(type => dataTransfer.matches(type)))) {\n return false;\n }\n return !preference || this.providerMatchesPreference(provider, preference);\n }\n providerMatchesPreference(provider, preference) {\n if (preference instanceof HierarchicalKind) {\n if (!provider.providedPasteEditKinds) {\n return true;\n }\n return provider.providedPasteEditKinds.some(providedKind => preference.contains(providedKind));\n }\n else {\n return provider.id === preference.providerId;\n }\n }\n};\nCopyPasteController.ID = 'editor.contrib.copyPasteActionController';\nCopyPasteController = CopyPasteController_1 = __decorate([\n __param(1, IInstantiationService),\n __param(2, IBulkEditService),\n __param(3, IClipboardService),\n __param(4, ILanguageFeaturesService),\n __param(5, IQuickInputService),\n __param(6, IProgressService)\n], CopyPasteController);\nexport { CopyPasteController };\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 *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { coalesce } from '../../../../base/common/arrays.js';\nimport { UriList } from '../../../../base/common/dataTransfer.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { Mimes } from '../../../../base/common/mime.js';\nimport { Schemas } from '../../../../base/common/network.js';\nimport { relativePath } from '../../../../base/common/resources.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { DocumentPasteTriggerKind } from '../../../common/languages.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { localize } from '../../../../nls.js';\nimport { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js';\nclass SimplePasteAndDropProvider {\n async provideDocumentPasteEdits(_model, _ranges, dataTransfer, context, token) {\n const edit = await this.getEdit(dataTransfer, token);\n if (!edit) {\n return undefined;\n }\n return {\n dispose() { },\n edits: [{ insertText: edit.insertText, title: edit.title, kind: edit.kind, handledMimeType: edit.handledMimeType, yieldTo: edit.yieldTo }]\n };\n }\n async provideDocumentDropEdits(_model, _position, dataTransfer, token) {\n const edit = await this.getEdit(dataTransfer, token);\n return edit ? [{ insertText: edit.insertText, title: edit.title, kind: edit.kind, handledMimeType: edit.handledMimeType, yieldTo: edit.yieldTo }] : undefined;\n }\n}\nexport class DefaultTextPasteOrDropEditProvider extends SimplePasteAndDropProvider {\n constructor() {\n super(...arguments);\n this.kind = DefaultTextPasteOrDropEditProvider.kind;\n this.dropMimeTypes = [Mimes.text];\n this.pasteMimeTypes = [Mimes.text];\n }\n async getEdit(dataTransfer, _token) {\n const textEntry = dataTransfer.get(Mimes.text);\n if (!textEntry) {\n return;\n }\n // Suppress if there's also a uriList entry.\n // Typically the uri-list contains the same text as the text entry so showing both is confusing.\n if (dataTransfer.has(Mimes.uriList)) {\n return;\n }\n const insertText = await textEntry.asString();\n return {\n handledMimeType: Mimes.text,\n title: localize('text.label', \"Insert Plain Text\"),\n insertText,\n kind: this.kind,\n };\n }\n}\nDefaultTextPasteOrDropEditProvider.id = 'text';\nDefaultTextPasteOrDropEditProvider.kind = new HierarchicalKind('text.plain');\nclass PathProvider extends SimplePasteAndDropProvider {\n constructor() {\n super(...arguments);\n this.kind = new HierarchicalKind('uri.absolute');\n this.dropMimeTypes = [Mimes.uriList];\n this.pasteMimeTypes = [Mimes.uriList];\n }\n async getEdit(dataTransfer, token) {\n const entries = await extractUriList(dataTransfer);\n if (!entries.length || token.isCancellationRequested) {\n return;\n }\n let uriCount = 0;\n const insertText = entries\n .map(({ uri, originalText }) => {\n if (uri.scheme === Schemas.file) {\n return uri.fsPath;\n }\n else {\n uriCount++;\n return originalText;\n }\n })\n .join(' ');\n let label;\n if (uriCount > 0) {\n // Dropping at least one generic uri (such as https) so use most generic label\n label = entries.length > 1\n ? localize('defaultDropProvider.uriList.uris', \"Insert Uris\")\n : localize('defaultDropProvider.uriList.uri', \"Insert Uri\");\n }\n else {\n // All the paths are file paths\n label = entries.length > 1\n ? localize('defaultDropProvider.uriList.paths', \"Insert Paths\")\n : localize('defaultDropProvider.uriList.path', \"Insert Path\");\n }\n return {\n handledMimeType: Mimes.uriList,\n insertText,\n title: label,\n kind: this.kind,\n };\n }\n}\nlet RelativePathProvider = class RelativePathProvider extends SimplePasteAndDropProvider {\n constructor(_workspaceContextService) {\n super();\n this._workspaceContextService = _workspaceContextService;\n this.kind = new HierarchicalKind('uri.relative');\n this.dropMimeTypes = [Mimes.uriList];\n this.pasteMimeTypes = [Mimes.uriList];\n }\n async getEdit(dataTransfer, token) {\n const entries = await extractUriList(dataTransfer);\n if (!entries.length || token.isCancellationRequested) {\n return;\n }\n const relativeUris = coalesce(entries.map(({ uri }) => {\n const root = this._workspaceContextService.getWorkspaceFolder(uri);\n return root ? relativePath(root.uri, uri) : undefined;\n }));\n if (!relativeUris.length) {\n return;\n }\n return {\n handledMimeType: Mimes.uriList,\n insertText: relativeUris.join(' '),\n title: entries.length > 1\n ? localize('defaultDropProvider.uriList.relativePaths', \"Insert Relative Paths\")\n : localize('defaultDropProvider.uriList.relativePath', \"Insert Relative Path\"),\n kind: this.kind,\n };\n }\n};\nRelativePathProvider = __decorate([\n __param(0, IWorkspaceContextService)\n], RelativePathProvider);\nclass PasteHtmlProvider {\n constructor() {\n this.kind = new HierarchicalKind('html');\n this.pasteMimeTypes = ['text/html'];\n this._yieldTo = [{ mimeType: Mimes.text }];\n }\n async provideDocumentPasteEdits(_model, _ranges, dataTransfer, context, token) {\n var _a;\n if (context.triggerKind !== DocumentPasteTriggerKind.PasteAs && !((_a = context.only) === null || _a === void 0 ? void 0 : _a.contains(this.kind))) {\n return;\n }\n const entry = dataTransfer.get('text/html');\n const htmlText = await (entry === null || entry === void 0 ? void 0 : entry.asString());\n if (!htmlText || token.isCancellationRequested) {\n return;\n }\n return {\n dispose() { },\n edits: [{\n insertText: htmlText,\n yieldTo: this._yieldTo,\n title: localize('pasteHtmlLabel', 'Insert HTML'),\n kind: this.kind,\n }],\n };\n }\n}\nasync function extractUriList(dataTransfer) {\n const urlListEntry = dataTransfer.get(Mimes.uriList);\n if (!urlListEntry) {\n return [];\n }\n const strUriList = await urlListEntry.asString();\n const entries = [];\n for (const entry of UriList.parse(strUriList)) {\n try {\n entries.push({ uri: URI.parse(entry), originalText: entry });\n }\n catch (_a) {\n // noop\n }\n }\n return entries;\n}\nlet DefaultDropProvidersFeature = class DefaultDropProvidersFeature extends Disposable {\n constructor(languageFeaturesService, workspaceContextService) {\n super();\n this._register(languageFeaturesService.documentDropEditProvider.register('*', new DefaultTextPasteOrDropEditProvider()));\n this._register(languageFeaturesService.documentDropEditProvider.register('*', new PathProvider()));\n this._register(languageFeaturesService.documentDropEditProvider.register('*', new RelativePathProvider(workspaceContextService)));\n }\n};\nDefaultDropProvidersFeature = __decorate([\n __param(0, ILanguageFeaturesService),\n __param(1, IWorkspaceContextService)\n], DefaultDropProvidersFeature);\nexport { DefaultDropProvidersFeature };\nlet DefaultPasteProvidersFeature = class DefaultPasteProvidersFeature extends Disposable {\n constructor(languageFeaturesService, workspaceContextService) {\n super();\n this._register(languageFeaturesService.documentPasteEditProvider.register('*', new DefaultTextPasteOrDropEditProvider()));\n this._register(languageFeaturesService.documentPasteEditProvider.register('*', new PathProvider()));\n this._register(languageFeaturesService.documentPasteEditProvider.register('*', new RelativePathProvider(workspaceContextService)));\n this._register(languageFeaturesService.documentPasteEditProvider.register('*', new PasteHtmlProvider()));\n }\n};\nDefaultPasteProvidersFeature = __decorate([\n __param(0, ILanguageFeaturesService),\n __param(1, IWorkspaceContextService)\n], DefaultPasteProvidersFeature);\nexport { DefaultPasteProvidersFeature };\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 *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar DropIntoEditorController_1;\nimport { coalesce } from '../../../../base/common/arrays.js';\nimport { createCancelablePromise, raceCancellation } from '../../../../base/common/async.js';\nimport { VSDataTransfer, matchesMimeType } from '../../../../base/common/dataTransfer.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { toExternalVSDataTransfer } from '../../../browser/dnd.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { DraggedTreeItemsIdentifier } from '../../../common/services/treeViewsDnd.js';\nimport { ITreeViewsDnDService } from '../../../common/services/treeViewsDndService.js';\nimport { EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js';\nimport { InlineProgressManager } from '../../inlineProgress/browser/inlineProgress.js';\nimport { localize } from '../../../../nls.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { LocalSelectionTransfer } from '../../../../platform/dnd/browser/dnd.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { sortEditsByYieldTo } from './edit.js';\nimport { PostEditWidgetManager } from './postEditWidget.js';\nexport const defaultProviderConfig = 'editor.experimental.dropIntoEditor.defaultProvider';\nexport const changeDropTypeCommandId = 'editor.changeDropType';\nexport const dropWidgetVisibleCtx = new RawContextKey('dropWidgetVisible', false, localize('dropWidgetVisible', \"Whether the drop widget is showing\"));\nlet DropIntoEditorController = DropIntoEditorController_1 = class DropIntoEditorController extends Disposable {\n static get(editor) {\n return editor.getContribution(DropIntoEditorController_1.ID);\n }\n constructor(editor, instantiationService, _configService, _languageFeaturesService, _treeViewsDragAndDropService) {\n super();\n this._configService = _configService;\n this._languageFeaturesService = _languageFeaturesService;\n this._treeViewsDragAndDropService = _treeViewsDragAndDropService;\n this.treeItemsTransfer = LocalSelectionTransfer.getInstance();\n this._dropProgressManager = this._register(instantiationService.createInstance(InlineProgressManager, 'dropIntoEditor', editor));\n this._postDropWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, 'dropIntoEditor', editor, dropWidgetVisibleCtx, { id: changeDropTypeCommandId, label: localize('postDropWidgetTitle', \"Show drop options...\") }));\n this._register(editor.onDropIntoEditor(e => this.onDropIntoEditor(editor, e.position, e.event)));\n }\n clearWidgets() {\n this._postDropWidgetManager.clear();\n }\n changeDropType() {\n this._postDropWidgetManager.tryShowSelector();\n }\n async onDropIntoEditor(editor, position, dragEvent) {\n var _a;\n if (!dragEvent.dataTransfer || !editor.hasModel()) {\n return;\n }\n (_a = this._currentOperation) === null || _a === void 0 ? void 0 : _a.cancel();\n editor.focus();\n editor.setPosition(position);\n const p = createCancelablePromise(async (token) => {\n const tokenSource = new EditorStateCancellationTokenSource(editor, 1 /* CodeEditorStateFlag.Value */, undefined, token);\n try {\n const ourDataTransfer = await this.extractDataTransferData(dragEvent);\n if (ourDataTransfer.size === 0 || tokenSource.token.isCancellationRequested) {\n return;\n }\n const model = editor.getModel();\n if (!model) {\n return;\n }\n const providers = this._languageFeaturesService.documentDropEditProvider\n .ordered(model)\n .filter(provider => {\n if (!provider.dropMimeTypes) {\n // Keep all providers that don't specify mime types\n return true;\n }\n return provider.dropMimeTypes.some(mime => ourDataTransfer.matches(mime));\n });\n const edits = await this.getDropEdits(providers, model, position, ourDataTransfer, tokenSource);\n if (tokenSource.token.isCancellationRequested) {\n return;\n }\n if (edits.length) {\n const activeEditIndex = this.getInitialActiveEditIndex(model, edits);\n const canShowWidget = editor.getOption(36 /* EditorOption.dropIntoEditor */).showDropSelector === 'afterDrop';\n // Pass in the parent token here as it tracks cancelling the entire drop operation\n await this._postDropWidgetManager.applyEditAndShowIfNeeded([Range.fromPositions(position)], { activeEditIndex, allEdits: edits }, canShowWidget, async (edit) => edit, token);\n }\n }\n finally {\n tokenSource.dispose();\n if (this._currentOperation === p) {\n this._currentOperation = undefined;\n }\n }\n });\n this._dropProgressManager.showWhile(position, localize('dropIntoEditorProgress', \"Running drop handlers. Click to cancel\"), p);\n this._currentOperation = p;\n }\n async getDropEdits(providers, model, position, dataTransfer, tokenSource) {\n const results = await raceCancellation(Promise.all(providers.map(async (provider) => {\n try {\n const edits = await provider.provideDocumentDropEdits(model, position, dataTransfer, tokenSource.token);\n return edits === null || edits === void 0 ? void 0 : edits.map(edit => ({ ...edit, providerId: provider.id }));\n }\n catch (err) {\n console.error(err);\n }\n return undefined;\n })), tokenSource.token);\n const edits = coalesce(results !== null && results !== void 0 ? results : []).flat();\n return sortEditsByYieldTo(edits);\n }\n getInitialActiveEditIndex(model, edits) {\n const preferredProviders = this._configService.getValue(defaultProviderConfig, { resource: model.uri });\n for (const [configMime, desiredKindStr] of Object.entries(preferredProviders)) {\n const desiredKind = new HierarchicalKind(desiredKindStr);\n const editIndex = edits.findIndex(edit => desiredKind.value === edit.providerId\n && edit.handledMimeType && matchesMimeType(configMime, [edit.handledMimeType]));\n if (editIndex >= 0) {\n return editIndex;\n }\n }\n return 0;\n }\n async extractDataTransferData(dragEvent) {\n if (!dragEvent.dataTransfer) {\n return new VSDataTransfer();\n }\n const dataTransfer = toExternalVSDataTransfer(dragEvent.dataTransfer);\n if (this.treeItemsTransfer.hasData(DraggedTreeItemsIdentifier.prototype)) {\n const data = this.treeItemsTransfer.getData(DraggedTreeItemsIdentifier.prototype);\n if (Array.isArray(data)) {\n for (const id of data) {\n const treeDataTransfer = await this._treeViewsDragAndDropService.removeDragOperationTransfer(id.identifier);\n if (treeDataTransfer) {\n for (const [type, value] of treeDataTransfer) {\n dataTransfer.replace(type, value);\n }\n }\n }\n }\n }\n return dataTransfer;\n }\n};\nDropIntoEditorController.ID = 'editor.contrib.dropIntoEditorController';\nDropIntoEditorController = DropIntoEditorController_1 = __decorate([\n __param(1, IInstantiationService),\n __param(2, IConfigurationService),\n __param(3, ILanguageFeaturesService),\n __param(4, ITreeViewsDnDService)\n], DropIntoEditorController);\nexport { DropIntoEditorController };\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 { EditorCommand, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { editorConfigurationBaseNode } from '../../../common/config/editorConfigurationSchema.js';\nimport { registerEditorFeature } from '../../../common/editorFeatures.js';\nimport { DefaultDropProvidersFeature } from './defaultProviders.js';\nimport * as nls from '../../../../nls.js';\nimport { Extensions as ConfigurationExtensions } from '../../../../platform/configuration/common/configurationRegistry.js';\nimport { Registry } from '../../../../platform/registry/common/platform.js';\nimport { DropIntoEditorController, changeDropTypeCommandId, defaultProviderConfig, dropWidgetVisibleCtx } from './dropIntoEditorController.js';\nregisterEditorContribution(DropIntoEditorController.ID, DropIntoEditorController, 2 /* EditorContributionInstantiation.BeforeFirstInteraction */);\nregisterEditorFeature(DefaultDropProvidersFeature);\nregisterEditorCommand(new class extends EditorCommand {\n constructor() {\n super({\n id: changeDropTypeCommandId,\n precondition: dropWidgetVisibleCtx,\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */,\n primary: 2048 /* KeyMod.CtrlCmd */ | 89 /* KeyCode.Period */,\n }\n });\n }\n runEditorCommand(_accessor, editor, _args) {\n var _a;\n (_a = DropIntoEditorController.get(editor)) === null || _a === void 0 ? void 0 : _a.changeDropType();\n }\n});\nregisterEditorCommand(new class extends EditorCommand {\n constructor() {\n super({\n id: 'editor.hideDropWidget',\n precondition: dropWidgetVisibleCtx,\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */,\n primary: 9 /* KeyCode.Escape */,\n }\n });\n }\n runEditorCommand(_accessor, editor, _args) {\n var _a;\n (_a = DropIntoEditorController.get(editor)) === null || _a === void 0 ? void 0 : _a.clearWidgets();\n }\n});\nRegistry.as(ConfigurationExtensions.Configuration).registerConfiguration({\n ...editorConfigurationBaseNode,\n properties: {\n [defaultProviderConfig]: {\n type: 'object',\n scope: 5 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,\n description: nls.localize('defaultProviderDescription', \"Configures the default drop provider to use for content of a given mime type.\"),\n default: {},\n additionalProperties: {\n type: 'string',\n },\n },\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 *--------------------------------------------------------------------------------------------*/\nimport { ResourceTextEdit } from '../../../browser/services/bulkEditService.js';\nimport { SnippetParser } from '../../snippet/browser/snippetParser.js';\n/**\n * Given a {@link DropOrPasteEdit} and set of ranges, creates a {@link WorkspaceEdit} that applies the insert text from\n * the {@link DropOrPasteEdit} at each range plus any additional edits.\n */\nexport function createCombinedWorkspaceEdit(uri, ranges, edit) {\n var _a, _b, _c, _d;\n // If the edit insert text is empty, skip applying at each range\n if (typeof edit.insertText === 'string' ? edit.insertText === '' : edit.insertText.snippet === '') {\n return {\n edits: (_b = (_a = edit.additionalEdit) === null || _a === void 0 ? void 0 : _a.edits) !== null && _b !== void 0 ? _b : []\n };\n }\n return {\n edits: [\n ...ranges.map(range => new ResourceTextEdit(uri, { range, text: typeof edit.insertText === 'string' ? SnippetParser.escape(edit.insertText) + '$0' : edit.insertText.snippet, insertAsSnippet: true })),\n ...((_d = (_c = edit.additionalEdit) === null || _c === void 0 ? void 0 : _c.edits) !== null && _d !== void 0 ? _d : [])\n ]\n };\n}\nexport function sortEditsByYieldTo(edits) {\n var _a;\n function yieldsTo(yTo, other) {\n if ('mimeType' in yTo) {\n return yTo.mimeType === other.handledMimeType;\n }\n return !!other.kind && yTo.kind.contains(other.kind);\n }\n // Build list of nodes each node yields to\n const yieldsToMap = new Map();\n for (const edit of edits) {\n for (const yTo of (_a = edit.yieldTo) !== null && _a !== void 0 ? _a : []) {\n for (const other of edits) {\n if (other === edit) {\n continue;\n }\n if (yieldsTo(yTo, other)) {\n let arr = yieldsToMap.get(edit);\n if (!arr) {\n arr = [];\n yieldsToMap.set(edit, arr);\n }\n arr.push(other);\n }\n }\n }\n }\n if (!yieldsToMap.size) {\n return Array.from(edits);\n }\n // Topological sort\n const visited = new Set();\n const tempStack = [];\n function visit(nodes) {\n if (!nodes.length) {\n return [];\n }\n const node = nodes[0];\n if (tempStack.includes(node)) {\n console.warn('Yield to cycle detected', node);\n return nodes;\n }\n if (visited.has(node)) {\n return visit(nodes.slice(1));\n }\n let pre = [];\n const yTo = yieldsToMap.get(node);\n if (yTo) {\n tempStack.push(node);\n pre = visit(yTo);\n tempStack.pop();\n }\n visited.add(node);\n return [...pre, node, ...visit(nodes.slice(1))];\n }\n return visit(Array.from(edits));\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 *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar PostEditWidget_1;\nimport * as dom from '../../../../base/browser/dom.js';\nimport { Button } from '../../../../base/browser/ui/button/button.js';\nimport { toAction } from '../../../../base/common/actions.js';\nimport { toErrorMessage } from '../../../../base/common/errorMessage.js';\nimport { isCancellationError } from '../../../../base/common/errors.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { Disposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport './postEditWidget.css';\nimport { IBulkEditService } from '../../../browser/services/bulkEditService.js';\nimport { createCombinedWorkspaceEdit } from './edit.js';\nimport { localize } from '../../../../nls.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { INotificationService } from '../../../../platform/notification/common/notification.js';\nlet PostEditWidget = PostEditWidget_1 = class PostEditWidget extends Disposable {\n constructor(typeId, editor, visibleContext, showCommand, range, edits, onSelectNewEdit, _contextMenuService, contextKeyService, _keybindingService) {\n super();\n this.typeId = typeId;\n this.editor = editor;\n this.showCommand = showCommand;\n this.range = range;\n this.edits = edits;\n this.onSelectNewEdit = onSelectNewEdit;\n this._contextMenuService = _contextMenuService;\n this._keybindingService = _keybindingService;\n this.allowEditorOverflow = true;\n this.suppressMouseDown = true;\n this.create();\n this.visibleContext = visibleContext.bindTo(contextKeyService);\n this.visibleContext.set(true);\n this._register(toDisposable(() => this.visibleContext.reset()));\n this.editor.addContentWidget(this);\n this.editor.layoutContentWidget(this);\n this._register(toDisposable((() => this.editor.removeContentWidget(this))));\n this._register(this.editor.onDidChangeCursorPosition(e => {\n if (!range.containsPosition(e.position)) {\n this.dispose();\n }\n }));\n this._register(Event.runAndSubscribe(_keybindingService.onDidUpdateKeybindings, () => {\n this._updateButtonTitle();\n }));\n }\n _updateButtonTitle() {\n var _a;\n const binding = (_a = this._keybindingService.lookupKeybinding(this.showCommand.id)) === null || _a === void 0 ? void 0 : _a.getLabel();\n this.button.element.title = this.showCommand.label + (binding ? ` (${binding})` : '');\n }\n create() {\n this.domNode = dom.$('.post-edit-widget');\n this.button = this._register(new Button(this.domNode, {\n supportIcons: true,\n }));\n this.button.label = '$(insert)';\n this._register(dom.addDisposableListener(this.domNode, dom.EventType.CLICK, () => this.showSelector()));\n }\n getId() {\n return PostEditWidget_1.baseId + '.' + this.typeId;\n }\n getDomNode() {\n return this.domNode;\n }\n getPosition() {\n return {\n position: this.range.getEndPosition(),\n preference: [2 /* ContentWidgetPositionPreference.BELOW */]\n };\n }\n showSelector() {\n this._contextMenuService.showContextMenu({\n getAnchor: () => {\n const pos = dom.getDomNodePagePosition(this.button.element);\n return { x: pos.left + pos.width, y: pos.top + pos.height };\n },\n getActions: () => {\n return this.edits.allEdits.map((edit, i) => toAction({\n id: '',\n label: edit.title,\n checked: i === this.edits.activeEditIndex,\n run: () => {\n if (i !== this.edits.activeEditIndex) {\n return this.onSelectNewEdit(i);\n }\n },\n }));\n }\n });\n }\n};\nPostEditWidget.baseId = 'editor.widget.postEditWidget';\nPostEditWidget = PostEditWidget_1 = __decorate([\n __param(7, IContextMenuService),\n __param(8, IContextKeyService),\n __param(9, IKeybindingService)\n], PostEditWidget);\nlet PostEditWidgetManager = class PostEditWidgetManager extends Disposable {\n constructor(_id, _editor, _visibleContext, _showCommand, _instantiationService, _bulkEditService, _notificationService) {\n super();\n this._id = _id;\n this._editor = _editor;\n this._visibleContext = _visibleContext;\n this._showCommand = _showCommand;\n this._instantiationService = _instantiationService;\n this._bulkEditService = _bulkEditService;\n this._notificationService = _notificationService;\n this._currentWidget = this._register(new MutableDisposable());\n this._register(Event.any(_editor.onDidChangeModel, _editor.onDidChangeModelContent)(() => this.clear()));\n }\n async applyEditAndShowIfNeeded(ranges, edits, canShowWidget, resolve, token) {\n const model = this._editor.getModel();\n if (!model || !ranges.length) {\n return;\n }\n const edit = edits.allEdits.at(edits.activeEditIndex);\n if (!edit) {\n return;\n }\n const onDidSelectEdit = async (newEditIndex) => {\n const model = this._editor.getModel();\n if (!model) {\n return;\n }\n await model.undo();\n this.applyEditAndShowIfNeeded(ranges, { activeEditIndex: newEditIndex, allEdits: edits.allEdits }, canShowWidget, resolve, token);\n };\n const handleError = (e, message) => {\n if (isCancellationError(e)) {\n return;\n }\n this._notificationService.error(message);\n if (canShowWidget) {\n this.show(ranges[0], edits, onDidSelectEdit);\n }\n };\n let resolvedEdit;\n try {\n resolvedEdit = await resolve(edit, token);\n }\n catch (e) {\n return handleError(e, localize('resolveError', \"Error resolving edit '{0}':\\n{1}\", edit.title, toErrorMessage(e)));\n }\n if (token.isCancellationRequested) {\n return;\n }\n const combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, ranges, resolvedEdit);\n // Use a decoration to track edits around the trigger range\n const primaryRange = ranges[0];\n const editTrackingDecoration = model.deltaDecorations([], [{\n range: primaryRange,\n options: { description: 'paste-line-suffix', stickiness: 0 /* TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */ }\n }]);\n this._editor.focus();\n let editResult;\n let editRange;\n try {\n editResult = await this._bulkEditService.apply(combinedWorkspaceEdit, { editor: this._editor, token });\n editRange = model.getDecorationRange(editTrackingDecoration[0]);\n }\n catch (e) {\n return handleError(e, localize('applyError', \"Error applying edit '{0}':\\n{1}\", edit.title, toErrorMessage(e)));\n }\n finally {\n model.deltaDecorations(editTrackingDecoration, []);\n }\n if (token.isCancellationRequested) {\n return;\n }\n if (canShowWidget && editResult.isApplied && edits.allEdits.length > 1) {\n this.show(editRange !== null && editRange !== void 0 ? editRange : primaryRange, edits, onDidSelectEdit);\n }\n }\n show(range, edits, onDidSelectEdit) {\n this.clear();\n if (this._editor.hasModel()) {\n this._currentWidget.value = this._instantiationService.createInstance((PostEditWidget), this._id, this._editor, this._visibleContext, this._showCommand, range, edits, onDidSelectEdit);\n }\n }\n clear() {\n this._currentWidget.clear();\n }\n tryShowSelector() {\n var _a;\n (_a = this._currentWidget.value) === null || _a === void 0 ? void 0 : _a.showSelector();\n }\n};\nPostEditWidgetManager = __decorate([\n __param(4, IInstantiationService),\n __param(5, IBulkEditService),\n __param(6, INotificationService)\n], PostEditWidgetManager);\nexport { PostEditWidgetManager };\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 { EditorCommand, registerEditorCommand } from '../../../browser/editorExtensions.js';\nimport { IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { LinkedList } from '../../../../base/common/linkedList.js';\nimport { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';\nimport { registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { localize } from '../../../../nls.js';\nconst IEditorCancellationTokens = createDecorator('IEditorCancelService');\nconst ctxCancellableOperation = new RawContextKey('cancellableOperation', false, localize('cancellableOperation', 'Whether the editor runs a cancellable operation, e.g. like \\'Peek References\\''));\nregisterSingleton(IEditorCancellationTokens, class {\n constructor() {\n this._tokens = new WeakMap();\n }\n add(editor, cts) {\n let data = this._tokens.get(editor);\n if (!data) {\n data = editor.invokeWithinContext(accessor => {\n const key = ctxCancellableOperation.bindTo(accessor.get(IContextKeyService));\n const tokens = new LinkedList();\n return { key, tokens };\n });\n this._tokens.set(editor, data);\n }\n let removeFn;\n data.key.set(true);\n removeFn = data.tokens.push(cts);\n return () => {\n // remove w/o cancellation\n if (removeFn) {\n removeFn();\n data.key.set(!data.tokens.isEmpty());\n removeFn = undefined;\n }\n };\n }\n cancel(editor) {\n const data = this._tokens.get(editor);\n if (!data) {\n return;\n }\n // remove with cancellation\n const cts = data.tokens.pop();\n if (cts) {\n cts.cancel();\n data.key.set(!data.tokens.isEmpty());\n }\n }\n}, 1 /* InstantiationType.Delayed */);\nexport class EditorKeybindingCancellationTokenSource extends CancellationTokenSource {\n constructor(editor, parent) {\n super(parent);\n this.editor = editor;\n this._unregister = editor.invokeWithinContext(accessor => accessor.get(IEditorCancellationTokens).add(editor, this));\n }\n dispose() {\n this._unregister();\n super.dispose();\n }\n}\nregisterEditorCommand(new class extends EditorCommand {\n constructor() {\n super({\n id: 'editor.cancelOperation',\n kbOpts: {\n weight: 100 /* KeybindingWeight.EditorContrib */,\n primary: 9 /* KeyCode.Escape */\n },\n precondition: ctxCancellableOperation\n });\n }\n runEditorCommand(accessor, editor) {\n accessor.get(IEditorCancellationTokens).cancel(editor);\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 *--------------------------------------------------------------------------------------------*/\nimport * as strings from '../../../../base/common/strings.js';\nimport { Range } from '../../../common/core/range.js';\nimport { CancellationTokenSource } from '../../../../base/common/cancellation.js';\nimport { DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { EditorKeybindingCancellationTokenSource } from './keybindingCancellation.js';\nexport class EditorState {\n constructor(editor, flags) {\n this.flags = flags;\n if ((this.flags & 1 /* CodeEditorStateFlag.Value */) !== 0) {\n const model = editor.getModel();\n this.modelVersionId = model ? strings.format('{0}#{1}', model.uri.toString(), model.getVersionId()) : null;\n }\n else {\n this.modelVersionId = null;\n }\n if ((this.flags & 4 /* CodeEditorStateFlag.Position */) !== 0) {\n this.position = editor.getPosition();\n }\n else {\n this.position = null;\n }\n if ((this.flags & 2 /* CodeEditorStateFlag.Selection */) !== 0) {\n this.selection = editor.getSelection();\n }\n else {\n this.selection = null;\n }\n if ((this.flags & 8 /* CodeEditorStateFlag.Scroll */) !== 0) {\n this.scrollLeft = editor.getScrollLeft();\n this.scrollTop = editor.getScrollTop();\n }\n else {\n this.scrollLeft = -1;\n this.scrollTop = -1;\n }\n }\n _equals(other) {\n if (!(other instanceof EditorState)) {\n return false;\n }\n const state = other;\n if (this.modelVersionId !== state.modelVersionId) {\n return false;\n }\n if (this.scrollLeft !== state.scrollLeft || this.scrollTop !== state.scrollTop) {\n return false;\n }\n if (!this.position && state.position || this.position && !state.position || this.position && state.position && !this.position.equals(state.position)) {\n return false;\n }\n if (!this.selection && state.selection || this.selection && !state.selection || this.selection && state.selection && !this.selection.equalsRange(state.selection)) {\n return false;\n }\n return true;\n }\n validate(editor) {\n return this._equals(new EditorState(editor, this.flags));\n }\n}\n/**\n * A cancellation token source that cancels when the editor changes as expressed\n * by the provided flags\n * @param range If provided, changes in position and selection within this range will not trigger cancellation\n */\nexport class EditorStateCancellationTokenSource extends EditorKeybindingCancellationTokenSource {\n constructor(editor, flags, range, parent) {\n super(editor, parent);\n this._listener = new DisposableStore();\n if (flags & 4 /* CodeEditorStateFlag.Position */) {\n this._listener.add(editor.onDidChangeCursorPosition(e => {\n if (!range || !Range.containsPosition(range, e.position)) {\n this.cancel();\n }\n }));\n }\n if (flags & 2 /* CodeEditorStateFlag.Selection */) {\n this._listener.add(editor.onDidChangeCursorSelection(e => {\n if (!range || !Range.containsRange(range, e.selection)) {\n this.cancel();\n }\n }));\n }\n if (flags & 8 /* CodeEditorStateFlag.Scroll */) {\n this._listener.add(editor.onDidScrollChange(_ => this.cancel()));\n }\n if (flags & 1 /* CodeEditorStateFlag.Value */) {\n this._listener.add(editor.onDidChangeModel(_ => this.cancel()));\n this._listener.add(editor.onDidChangeModelContent(_ => this.cancel()));\n }\n }\n dispose() {\n this._listener.dispose();\n super.dispose();\n }\n}\n/**\n * A cancellation token source that cancels when the provided model changes\n */\nexport class TextModelCancellationTokenSource extends CancellationTokenSource {\n constructor(model, parent) {\n super(parent);\n this._listener = model.onDidChangeContent(() => this.cancel());\n }\n dispose() {\n this._listener.dispose();\n super.dispose();\n }\n}\n"],"names":["DragAndDropCommand","constructor","selection","targetPosition","copy","this","targetSelection","getEditOperations","model","builder","text","getValueInRange","addEditOperation","lineNumber","column","containsPosition","getEndPosition","equals","getStartPosition","endLineNumber","startLineNumber","endColumn","startColumn","computeCursorState","helper","hasTriggerModifier","e","altKey","ctrlKey","DragAndDropController","editor","super","_editor","_dndDecorationIds","createDecorationsCollection","_register","onMouseDown","_onEditorMouseDown","onMouseUp","_onEditorMouseUp","onMouseDrag","_onEditorMouseDrag","onMouseDrop","_onEditorMouseDrop","onMouseDropCanceled","_onEditorMouseDropCanceled","onKeyDown","onEditorKeyDown","onKeyUp","onEditorKeyUp","onDidBlurEditorWidget","onEditorBlur","onDidBlurEditorText","_mouseDown","_modifierPressed","_dragSelection","_removeDecoration","getOption","updateOptions","mouseStyle","keyCode","TRIGGER_KEY_VALUE","mouseEvent","target","possibleSelections","getSelections","filter","position","length","event","showAt","_hitContent","_hitMargin","newCursorPosition","newSelections","shiftKey","primarySelection","getSelection","selectionStartLineNumber","selectionStartColumn","map","setSelections","pushUndoStop","executeCommand","ID","set","range","options","_DECORATION_OPTIONS","revealPosition","clear","type","dispose","description","className","async","accessor","args","resource","outlineService","get","modelService","reference","createModelReference","getOrCreate","object","textEditorModel","getTopLevelSymbols","__decorate","decorators","key","desc","d","c","arguments","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__param","paramIndex","decorator","TreeElement","remove","_a","parent","children","delete","id","findId","candidate","container","candidateId","name","undefined","empty","element","size","OutlineElement","symbol","Map","OutlineGroup","label","order","OutlineModel","create","registry","textModel","token","cts","result","uri","provider","ordered","promises","index","group","displayName","Promise","resolve","provideDocumentSymbols","then","info","_makeOutlineElement","err","_groups","listener","onDidChange","newProvider","cancel","all","isCancellationRequested","_compact","finally","res","childInfo","count","values","child","roots","push","sort","a","b","asListOfDocumentSymbols","bucket","_flattenDocumentSymbols","entries","overrideContainerLabel","entry","kind","tags","detail","containerName","selectionRange","IOutlineModelService","OutlineModelService","_languageFeaturesService","debounces","_disposables","_cache","_debounceInformation","for","documentSymbolProvider","min","add","onModelRemoved","data","versionId","getVersionId","source","promiseCnt","promise","now","Date","outlineModel","update","catch","_err","onCancellationRequested","precondition","kbOpts","weight","primary","runEditorCommand","_accessor","_b","changePasteType","clearWidgets","alias","metadata","schema","argsSchema","run","pasteAs","properties","providerId","CopyPasteController_1","changePasteTypeCommandId","pasteWidgetVisibleCtx","vscodeClipboardMime","CopyPasteController","getContribution","instantiationService","_bulkEditService","_clipboardService","_quickInputService","_progressService","getContainerDomNode","handleCopy","handlePaste","_pasteProgressManager","_postPasteWidgetManager","createInstance","tryShowSelector","preferred","focus","_pasteAsActionContext","execCommand","isPasteAsEnabled","enabled","finishedPaste","_currentPasteOperation","hasTextFocus","writeResources","clipboardData","getModel","selections","enableEmptySelectionClipboard","ranges","wasFromEmptySelection","isEmpty","getLineLength","toCopy","_getViewModel","getPlainTextToCopy","defaultPastePayload","multicursorText","Array","isArray","pasteOnNewLine","mode","providers","documentPasteEditProvider","x","prepareDocumentPaste","setCopyMetadata","dataTransfer","providerCopyMimeTypes","flatMap","copyMimeTypes","handle","results","console","error","reverse","mime","value","replace","_currentCopyOperation","dataTransferPromise","_c","_d","closeMessage","fetchCopyMetadata","allPotentialMimeTypes","types","allProviders","preference","providedPasteEditKinds","providerMatchesPreference","pasteMimeTypes","some","preventDefault","stopImmediatePropagation","showPasteAsPick","doPasteInline","showPasteAsNoEditMessage","showMessage","clipboardEvent","p","hasModel","tokenSource","mergeInDataFromCopy","supportedProviders","isSupportedPasteProvider","applyDefaultPasteHandler","context","triggerKind","providerEdits","getPasteEdits","canShowWidget","showPasteSelector","applyEditAndShowIfNeeded","activeEditIndex","allEdits","edit","resolved","resolveDocumentPasteEdit","call","additionalEdit","showWhile","only","pickedEdit","contains","at","selected","pick","title","placeHolder","combinedWorkspaceEdit","apply","withProgress","location","setData","JSON","stringify","rawMetadata","getData","parse","_","isFromEmptySelection","toMergeDataTransfer","has","resources","readResources","append","edits","provideDocumentPasteEdits","flat","textDataTransfer","asString","payload","trigger","matches","providedKind","SimplePasteAndDropProvider","_model","_ranges","getEdit","insertText","handledMimeType","yieldTo","provideDocumentDropEdits","_position","DefaultTextPasteOrDropEditProvider","dropMimeTypes","_token","textEntry","PathProvider","extractUriList","uriCount","originalText","scheme","fsPath","join","RelativePathProvider","_workspaceContextService","relativeUris","root","getWorkspaceFolder","PasteHtmlProvider","_yieldTo","mimeType","htmlText","urlListEntry","strUriList","DefaultDropProvidersFeature","languageFeaturesService","workspaceContextService","documentDropEditProvider","register","DefaultPasteProvidersFeature","DropIntoEditorController_1","defaultProviderConfig","changeDropTypeCommandId","dropWidgetVisibleCtx","DropIntoEditorController","_configService","_treeViewsDragAndDropService","treeItemsTransfer","_dropProgressManager","_postDropWidgetManager","onDropIntoEditor","changeDropType","dragEvent","_currentOperation","setPosition","ourDataTransfer","extractDataTransferData","getDropEdits","getInitialActiveEditIndex","showDropSelector","preferredProviders","getValue","configMime","desiredKindStr","desiredKind","editIndex","findIndex","hasData","treeDataTransfer","removeDragOperationTransfer","identifier","_args","Configuration","registerConfiguration","scope","nls","default","additionalProperties","createCombinedWorkspaceEdit","snippet","insertAsSnippet","sortEditsByYieldTo","yieldsTo","yTo","other","yieldsToMap","arr","from","visited","Set","tempStack","visit","nodes","node","includes","warn","slice","pre","pop","PostEditWidget_1","PostEditWidget","typeId","visibleContext","showCommand","onSelectNewEdit","_contextMenuService","contextKeyService","_keybindingService","allowEditorOverflow","suppressMouseDown","bindTo","reset","addContentWidget","layoutContentWidget","removeContentWidget","onDidChangeCursorPosition","onDidUpdateKeybindings","_updateButtonTitle","binding","lookupKeybinding","getLabel","button","domNode","supportIcons","showSelector","getId","baseId","getDomNode","getPosition","showContextMenu","getAnchor","pos","left","width","y","top","height","getActions","checked","PostEditWidgetManager","_id","_visibleContext","_showCommand","_instantiationService","_notificationService","_currentWidget","onDidChangeModel","onDidChangeModelContent","onDidSelectEdit","newEditIndex","undo","handleError","message","show","resolvedEdit","primaryRange","editTrackingDecoration","deltaDecorations","stickiness","editResult","editRange","getDecorationRange","isApplied","IEditorCancellationTokens","ctxCancellableOperation","_tokens","WeakMap","removeFn","invokeWithinContext","tokens","EditorKeybindingCancellationTokenSource","_unregister","EditorState","flags","modelVersionId","strings","toString","scrollLeft","getScrollLeft","scrollTop","getScrollTop","_equals","state","equalsRange","validate","EditorStateCancellationTokenSource","_listener","onDidChangeCursorSelection","onDidScrollChange","TextModelCancellationTokenSource","onDidChangeContent"],"sourceRoot":""}