monaco-editor-core 0.56.0-dev-20260119 → 0.56.0-dev-20260121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.messages.cs.js +1 -1
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/browser/dom.js +8 -0
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +1 -0
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +4 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.css +8 -5
- package/esm/vs/base/browser/ui/contextview/contextview.js +1 -1
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/list/list.js +1 -0
- package/esm/vs/base/browser/ui/list/list.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +62 -5
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +0 -4
- package/esm/vs/base/common/defaultAccount.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +81 -35
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/editContext.js +11 -0
- package/esm/vs/editor/browser/controller/editContext/editContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +38 -18
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +4 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +39 -16
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/view.js +21 -1
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +18 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js +3 -3
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +7 -5
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +21 -17
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -1
- package/esm/vs/editor/common/model.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js +11 -4
- package/esm/vs/editor/common/viewModel/viewModelDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +25 -14
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/common/viewModel.js.map +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +3 -3
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +28 -64
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +27 -20
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +37 -10
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.css +7 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +22 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +19 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +5 -1
- package/esm/vs/platform/actionWidget/browser/actionList.js +46 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +8 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js +2 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +1 -0
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/product/common/product.js +16 -1
- package/esm/vs/platform/product/common/product.js.map +1 -1
- package/monaco.d.ts +5 -1
- package/package.json +2 -2
- package/version.txt +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/viewModel/viewModelDecorations.ts","vs/editor/common/viewModel/viewModelDecorations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIzC,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAqBhF,MAAM,OAAO,oBAAoB;IAahC,YAAY,QAAgB,EAAE,KAAiB,EAAE,aAAmC,EAAE,eAAgC,EAAE,oBAA2C;QAClK,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;QAClD,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,+BAA+B,GAAG,IAAI,CAAC;QAC5C,IAAI,CAAC,wCAAwC,GAAG,IAAI,CAAC;IACtD,CAAC;IAEO,oCAAoC;QAC3C,IAAI,CAAC,+BAA+B,GAAG,IAAI,CAAC;QAC5C,IAAI,CAAC,wCAAwC,GAAG,IAAI,CAAC;IACtD,CAAC;IA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CAAC,gBAAgB,CAAC,CAAC;gBACvF,CAAC;YACF,CAAC;YACD,IAAI,iBAAiB,CAAC,qBAAqB,EAAE,CAAC;gBAC7C,IAAI,eAAe,IAAI,SAAS,CAAC,aAAa,IAAI,SAAS,CAAC,aAAa,IAAI,aAAa,EAAE,CAAC;oBAC5F,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAC5C,IAAI,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,EACrG,iBAAiB,CAAC,qBAAqB,qCAEvC,CAAC;oBACF,iBAAiB,CAAC,SAAS,CAAC,aAAa,GAAG,eAAe,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;gBACrF,CAAC;YACF,CAAC;YACD,IAAI,iBAAiB,CAAC,WAAW,EAAE,CAAC;gBACnC,gBAAgB,GAAG,IAAI,CAAC;YACzB,CAAC;QACF,CAAC;QAED,OAAO;YACN,WAAW,EAAE,qBAAqB;YAClC,iBAAiB,EAAE,iBAAiB;YACpC,gBAAgB;SAChB,CAAC;IACH,CAAC;CACD","file":"viewModelDecorations.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IDisposable } from '../../../base/common/lifecycle.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { IEditorConfiguration } from '../config/editorConfiguration.js';\nimport { IModelDecoration, ITextModel, PositionAffinity } from '../model.js';\nimport { IViewModelLines } from './viewModelLines.js';\nimport { filterFontDecorations, filterValidationDecorations } from '../config/editorOptions.js';\nimport { isModelDecorationVisible, ViewModelDecoration } from './viewModelDecoration.js';\nimport { InlineDecoration, InlineDecorationType } from './inlineDecorations.js';\nimport { ICoordinatesConverter } from '../coordinatesConverter.js';\n\n/**\n * A collection of decorations in a range of lines.\n */\nexport interface IViewDecorationsCollection {\n\t/**\n\t * decorations in the range of lines (ungrouped).\n\t */\n\treadonly decorations: ViewModelDecoration[];\n\t/**\n\t * inline decorations (grouped by each line in the range of lines).\n\t */\n\treadonly inlineDecorations: InlineDecoration[][];\n\t/**\n\t * Whether the decorations affect the fonts.\n\t */\n\treadonly hasVariableFonts: boolean;\n}\n\nexport class ViewModelDecorations implements IDisposable {\n\n\tprivate readonly editorId: number;\n\tprivate readonly model: ITextModel;\n\tprivate readonly configuration: IEditorConfiguration;\n\tprivate readonly _linesCollection: IViewModelLines;\n\tprivate readonly _coordinatesConverter: ICoordinatesConverter;\n\n\tprivate _decorationsCache: { [decorationId: string]: ViewModelDecoration };\n\n\tprivate _cachedModelDecorationsResolver: IViewDecorationsCollection | null;\n\tprivate _cachedModelDecorationsResolverViewRange: Range | null;\n\n\tconstructor(editorId: number, model: ITextModel, configuration: IEditorConfiguration, linesCollection: IViewModelLines, coordinatesConverter: ICoordinatesConverter) {\n\t\tthis.editorId = editorId;\n\t\tthis.model = model;\n\t\tthis.configuration = configuration;\n\t\tthis._linesCollection = linesCollection;\n\t\tthis._coordinatesConverter = coordinatesConverter;\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tprivate _clearCachedModelDecorationsResolver(): void {\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic reset(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onModelDecorationsChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onLineMappingChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tprivate _getOrCreateViewModelDecoration(modelDecoration: IModelDecoration): ViewModelDecoration {\n\t\tconst id = modelDecoration.id;\n\t\tlet r = this._decorationsCache[id];\n\t\tif (!r) {\n\t\t\tconst modelRange = modelDecoration.range;\n\t\t\tconst options = modelDecoration.options;\n\t\t\tlet viewRange: Range;\n\t\t\tif (options.isWholeLine) {\n\t\t\t\tconst start = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.startLineNumber, 1), PositionAffinity.Left, false, true);\n\t\t\t\tconst end = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber)), PositionAffinity.Right);\n\t\t\t\tviewRange = new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t\t\t} else {\n\t\t\t\t// For backwards compatibility reasons, we want injected text before any decoration.\n\t\t\t\t// Thus, move decorations to the right.\n\t\t\t\tviewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange, PositionAffinity.Right);\n\t\t\t}\n\t\t\tr = new ViewModelDecoration(viewRange, options);\n\t\t\tthis._decorationsCache[id] = r;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic getMinimapDecorationsInRange(range: Range): ViewModelDecoration[] {\n\t\treturn this._getDecorationsInRange(range, true, false).decorations;\n\t}\n\n\tpublic getDecorationsViewportData(viewRange: Range): IViewDecorationsCollection {\n\t\tlet cacheIsValid = (this._cachedModelDecorationsResolver !== null);\n\t\tcacheIsValid = cacheIsValid && (viewRange.equalsRange(this._cachedModelDecorationsResolverViewRange));\n\t\tif (!cacheIsValid) {\n\t\t\tthis._cachedModelDecorationsResolver = this._getDecorationsInRange(viewRange, false, false);\n\t\t\tthis._cachedModelDecorationsResolverViewRange = viewRange;\n\t\t}\n\t\treturn this._cachedModelDecorationsResolver!;\n\t}\n\n\tpublic getDecorationsOnLine(lineNumber: number, onlyMinimapDecorations: boolean = false, onlyMarginDecorations: boolean = false): IViewDecorationsCollection {\n\t\tconst range = new Range(lineNumber, this._linesCollection.getViewLineMinColumn(lineNumber), lineNumber, this._linesCollection.getViewLineMaxColumn(lineNumber));\n\t\treturn this._getDecorationsInRange(range, onlyMinimapDecorations, onlyMarginDecorations);\n\t}\n\n\tprivate _getDecorationsInRange(viewRange: Range, onlyMinimapDecorations: boolean, onlyMarginDecorations: boolean): IViewDecorationsCollection {\n\t\tconst modelDecorations = this._linesCollection.getDecorationsInRange(viewRange, this.editorId, filterValidationDecorations(this.configuration.options), filterFontDecorations(this.configuration.options), onlyMinimapDecorations, onlyMarginDecorations);\n\t\tconst startLineNumber = viewRange.startLineNumber;\n\t\tconst endLineNumber = viewRange.endLineNumber;\n\n\t\tconst decorationsInViewport: ViewModelDecoration[] = [];\n\t\tlet decorationsInViewportLen = 0;\n\t\tconst inlineDecorations: InlineDecoration[][] = [];\n\t\tfor (let j = startLineNumber; j <= endLineNumber; j++) {\n\t\t\tinlineDecorations[j - startLineNumber] = [];\n\t\t}\n\n\t\tlet hasVariableFonts = false;\n\t\tfor (let i = 0, len = modelDecorations.length; i < len; i++) {\n\t\t\tconst modelDecoration = modelDecorations[i];\n\t\t\tconst decorationOptions = modelDecoration.options;\n\n\t\t\tif (!isModelDecorationVisible(this.model, modelDecoration)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration);\n\t\t\tconst viewRange = viewModelDecoration.range;\n\n\t\t\tdecorationsInViewport[decorationsInViewportLen++] = viewModelDecoration;\n\n\t\t\tif (decorationOptions.inlineClassName) {\n\t\t\t\tconst inlineDecoration = new InlineDecoration(viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? InlineDecorationType.RegularAffectingLetterSpacing : InlineDecorationType.Regular);\n\t\t\t\tconst intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber);\n\t\t\t\tconst intersectedEndLineNumber = Math.min(endLineNumber, viewRange.endLineNumber);\n\t\t\t\tfor (let j = intersectedStartLineNumber; j <= intersectedEndLineNumber; j++) {\n\t\t\t\t\tinlineDecorations[j - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.beforeContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.startLineNumber && viewRange.startLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.startLineNumber, viewRange.startColumn, viewRange.startLineNumber, viewRange.startColumn),\n\t\t\t\t\t\tdecorationOptions.beforeContentClassName,\n\t\t\t\t\t\tInlineDecorationType.Before\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.startLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.afterContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.endLineNumber && viewRange.endLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.endLineNumber, viewRange.endColumn, viewRange.endLineNumber, viewRange.endColumn),\n\t\t\t\t\t\tdecorationOptions.afterContentClassName,\n\t\t\t\t\t\tInlineDecorationType.After\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.affectsFont) {\n\t\t\t\thasVariableFonts = true;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdecorations: decorationsInViewport,\n\t\t\tinlineDecorations: inlineDecorations,\n\t\t\thasVariableFonts\n\t\t};\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IDisposable } from '../../../base/common/lifecycle.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { IEditorConfiguration } from '../config/editorConfiguration.js';\nimport { IModelDecoration, ITextModel, PositionAffinity } from '../model.js';\nimport { IViewModelLines } from './viewModelLines.js';\nimport { filterFontDecorations, filterValidationDecorations } from '../config/editorOptions.js';\nimport { isModelDecorationVisible, ViewModelDecoration } from './viewModelDecoration.js';\nimport { InlineDecoration, InlineDecorationType } from './inlineDecorations.js';\nimport { ICoordinatesConverter } from '../coordinatesConverter.js';\n\n/**\n * A collection of decorations in a range of lines.\n */\nexport interface IViewDecorationsCollection {\n\t/**\n\t * decorations in the range of lines (ungrouped).\n\t */\n\treadonly decorations: ViewModelDecoration[];\n\t/**\n\t * inline decorations (grouped by each line in the range of lines).\n\t */\n\treadonly inlineDecorations: InlineDecoration[][];\n\t/**\n\t * Whether the decorations affect the fonts.\n\t */\n\treadonly hasVariableFonts: boolean;\n}\n\nexport class ViewModelDecorations implements IDisposable {\n\n\tprivate readonly editorId: number;\n\tprivate readonly model: ITextModel;\n\tprivate readonly configuration: IEditorConfiguration;\n\tprivate readonly _linesCollection: IViewModelLines;\n\tprivate readonly _coordinatesConverter: ICoordinatesConverter;\n\n\tprivate _decorationsCache: { [decorationId: string]: ViewModelDecoration };\n\n\tprivate _cachedModelDecorationsResolver: IViewDecorationsCollection | null;\n\tprivate _cachedModelDecorationsResolverViewRange: Range | null;\n\n\tconstructor(editorId: number, model: ITextModel, configuration: IEditorConfiguration, linesCollection: IViewModelLines, coordinatesConverter: ICoordinatesConverter) {\n\t\tthis.editorId = editorId;\n\t\tthis.model = model;\n\t\tthis.configuration = configuration;\n\t\tthis._linesCollection = linesCollection;\n\t\tthis._coordinatesConverter = coordinatesConverter;\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tprivate _clearCachedModelDecorationsResolver(): void {\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic reset(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onModelDecorationsChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onLineMappingChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tprivate _getOrCreateViewModelDecoration(modelDecoration: IModelDecoration): ViewModelDecoration {\n\t\tconst id = modelDecoration.id;\n\t\tlet r = this._decorationsCache[id];\n\t\tif (!r) {\n\t\t\tconst modelRange = modelDecoration.range;\n\t\t\tconst options = modelDecoration.options;\n\t\t\tlet viewRange: Range;\n\t\t\tif (options.isWholeLine) {\n\t\t\t\tconst start = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.startLineNumber, 1), PositionAffinity.Left, false, true);\n\t\t\t\tconst end = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber)), PositionAffinity.Right);\n\t\t\t\tviewRange = new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t\t\t} else {\n\t\t\t\t// For backwards compatibility reasons, we want injected text before any decoration.\n\t\t\t\t// Thus, move decorations to the right.\n\t\t\t\tviewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange, PositionAffinity.Right);\n\t\t\t}\n\t\t\tr = new ViewModelDecoration(viewRange, options);\n\t\t\tthis._decorationsCache[id] = r;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic getMinimapDecorationsInRange(range: Range): ViewModelDecoration[] {\n\t\treturn this._getDecorationsInRange(range, true, false).decorations;\n\t}\n\n\tpublic getDecorationsViewportData(viewRange: Range): IViewDecorationsCollection {\n\t\tlet cacheIsValid = (this._cachedModelDecorationsResolver !== null);\n\t\tcacheIsValid = cacheIsValid && (viewRange.equalsRange(this._cachedModelDecorationsResolverViewRange));\n\t\tif (!cacheIsValid) {\n\t\t\tthis._cachedModelDecorationsResolver = this._getDecorationsInRange(viewRange, false, false);\n\t\t\tthis._cachedModelDecorationsResolverViewRange = viewRange;\n\t\t}\n\t\treturn this._cachedModelDecorationsResolver!;\n\t}\n\n\tpublic getDecorationsOnLine(lineNumber: number, onlyMinimapDecorations: boolean = false, onlyMarginDecorations: boolean = false): IViewDecorationsCollection {\n\t\tconst range = new Range(lineNumber, this._linesCollection.getViewLineMinColumn(lineNumber), lineNumber, this._linesCollection.getViewLineMaxColumn(lineNumber));\n\t\treturn this._getDecorationsInRange(range, onlyMinimapDecorations, onlyMarginDecorations);\n\t}\n\n\tprivate _getDecorationsInRange(viewRange: Range, onlyMinimapDecorations: boolean, onlyMarginDecorations: boolean): IViewDecorationsCollection {\n\t\tconst modelDecorations = this._linesCollection.getDecorationsInRange(viewRange, this.editorId, filterValidationDecorations(this.configuration.options), filterFontDecorations(this.configuration.options), onlyMinimapDecorations, onlyMarginDecorations);\n\t\tconst startLineNumber = viewRange.startLineNumber;\n\t\tconst endLineNumber = viewRange.endLineNumber;\n\n\t\tconst decorationsInViewport: ViewModelDecoration[] = [];\n\t\tlet decorationsInViewportLen = 0;\n\t\tconst inlineDecorations: InlineDecoration[][] = [];\n\t\tfor (let j = startLineNumber; j <= endLineNumber; j++) {\n\t\t\tinlineDecorations[j - startLineNumber] = [];\n\t\t}\n\n\t\tlet hasVariableFonts = false;\n\t\tfor (let i = 0, len = modelDecorations.length; i < len; i++) {\n\t\t\tconst modelDecoration = modelDecorations[i];\n\t\t\tconst decorationOptions = modelDecoration.options;\n\n\t\t\tif (!isModelDecorationVisible(this.model, modelDecoration)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration);\n\t\t\tconst viewRange = viewModelDecoration.range;\n\n\t\t\tdecorationsInViewport[decorationsInViewportLen++] = viewModelDecoration;\n\n\t\t\tif (decorationOptions.inlineClassName) {\n\t\t\t\tconst inlineDecoration = new InlineDecoration(viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? InlineDecorationType.RegularAffectingLetterSpacing : InlineDecorationType.Regular);\n\t\t\t\tconst intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber);\n\t\t\t\tconst intersectedEndLineNumber = Math.min(endLineNumber, viewRange.endLineNumber);\n\t\t\t\tfor (let j = intersectedStartLineNumber; j <= intersectedEndLineNumber; j++) {\n\t\t\t\t\tinlineDecorations[j - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.beforeContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.startLineNumber && viewRange.startLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.startLineNumber, viewRange.startColumn, viewRange.startLineNumber, viewRange.startColumn),\n\t\t\t\t\t\tdecorationOptions.beforeContentClassName,\n\t\t\t\t\t\tInlineDecorationType.Before\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.startLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.afterContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.endLineNumber && viewRange.endLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.endLineNumber, viewRange.endColumn, viewRange.endLineNumber, viewRange.endColumn),\n\t\t\t\t\t\tdecorationOptions.afterContentClassName,\n\t\t\t\t\t\tInlineDecorationType.After\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.affectsFont) {\n\t\t\t\thasVariableFonts = true;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdecorations: decorationsInViewport,\n\t\t\tinlineDecorations: inlineDecorations,\n\t\t\thasVariableFonts\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/viewModel/viewModelDecorations.ts","vs/editor/common/viewModel/viewModelDecorations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIzC,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAqBhF,MAAM,OAAO,oBAAoB;IAahC,YAAY,QAAgB,EAAE,KAAiB,EAAE,aAAmC,EAAE,eAAgC,EAAE,oBAA2C;QAClK,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;QAClD,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,+BAA+B,GAAG,IAAI,CAAC;QAC5C,IAAI,CAAC,wCAAwC,GAAG,IAAI,CAAC;IACtD,CAAC;IAEO,oCAAoC;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work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IDisposable } from '../../../base/common/lifecycle.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { IEditorConfiguration } from '../config/editorConfiguration.js';\nimport { IModelDecoration, ITextModel, PositionAffinity } from '../model.js';\nimport { IViewModelLines } from './viewModelLines.js';\nimport { filterFontDecorations, filterValidationDecorations } from '../config/editorOptions.js';\nimport { isModelDecorationVisible, ViewModelDecoration } from './viewModelDecoration.js';\nimport { InlineDecoration, InlineDecorationType } from './inlineDecorations.js';\nimport { ICoordinatesConverter } from '../coordinatesConverter.js';\n\n/**\n * A collection of decorations in a range of lines.\n */\nexport interface IViewDecorationsCollection {\n\t/**\n\t * decorations in the range of lines (ungrouped).\n\t */\n\treadonly decorations: ViewModelDecoration[];\n\t/**\n\t * inline decorations (grouped by each line in the range of lines).\n\t */\n\treadonly inlineDecorations: InlineDecoration[][];\n\t/**\n\t * Whether the decorations affect the fonts.\n\t */\n\treadonly hasVariableFonts: boolean[];\n}\n\nexport class ViewModelDecorations implements IDisposable {\n\n\tprivate readonly editorId: number;\n\tprivate readonly model: ITextModel;\n\tprivate readonly configuration: IEditorConfiguration;\n\tprivate readonly _linesCollection: IViewModelLines;\n\tprivate readonly _coordinatesConverter: ICoordinatesConverter;\n\n\tprivate _decorationsCache: { [decorationId: string]: ViewModelDecoration };\n\n\tprivate _cachedModelDecorationsResolver: IViewDecorationsCollection | null;\n\tprivate _cachedModelDecorationsResolverViewRange: Range | null;\n\n\tconstructor(editorId: number, model: ITextModel, configuration: IEditorConfiguration, linesCollection: IViewModelLines, coordinatesConverter: ICoordinatesConverter) {\n\t\tthis.editorId = editorId;\n\t\tthis.model = model;\n\t\tthis.configuration = configuration;\n\t\tthis._linesCollection = linesCollection;\n\t\tthis._coordinatesConverter = coordinatesConverter;\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tprivate _clearCachedModelDecorationsResolver(): void {\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic reset(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onModelDecorationsChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onLineMappingChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tprivate _getOrCreateViewModelDecoration(modelDecoration: IModelDecoration): ViewModelDecoration {\n\t\tconst id = modelDecoration.id;\n\t\tlet r = this._decorationsCache[id];\n\t\tif (!r) {\n\t\t\tconst modelRange = modelDecoration.range;\n\t\t\tconst options = modelDecoration.options;\n\t\t\tlet viewRange: Range;\n\t\t\tif (options.isWholeLine) {\n\t\t\t\tconst start = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.startLineNumber, 1), PositionAffinity.Left, false, true);\n\t\t\t\tconst end = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber)), PositionAffinity.Right);\n\t\t\t\tviewRange = new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t\t\t} else {\n\t\t\t\t// For backwards compatibility reasons, we want injected text before any decoration.\n\t\t\t\t// Thus, move decorations to the right.\n\t\t\t\tviewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange, PositionAffinity.Right);\n\t\t\t}\n\t\t\tr = new ViewModelDecoration(viewRange, options);\n\t\t\tthis._decorationsCache[id] = r;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic getMinimapDecorationsInRange(range: Range): ViewModelDecoration[] {\n\t\treturn this._getDecorationsInRange(range, true, false).decorations;\n\t}\n\n\tpublic getDecorationsViewportData(viewRange: Range): IViewDecorationsCollection {\n\t\tlet cacheIsValid = (this._cachedModelDecorationsResolver !== null);\n\t\tcacheIsValid = cacheIsValid && (viewRange.equalsRange(this._cachedModelDecorationsResolverViewRange));\n\t\tif (!cacheIsValid) {\n\t\t\tthis._cachedModelDecorationsResolver = this._getDecorationsInRange(viewRange, false, false);\n\t\t\tthis._cachedModelDecorationsResolverViewRange = viewRange;\n\t\t}\n\t\treturn this._cachedModelDecorationsResolver!;\n\t}\n\n\tpublic getDecorationsOnLine(lineNumber: number, onlyMinimapDecorations: boolean = false, onlyMarginDecorations: boolean = false): IViewDecorationsCollection {\n\t\tconst range = new Range(lineNumber, this._linesCollection.getViewLineMinColumn(lineNumber), lineNumber, this._linesCollection.getViewLineMaxColumn(lineNumber));\n\t\treturn this._getDecorationsInRange(range, onlyMinimapDecorations, onlyMarginDecorations);\n\t}\n\n\tprivate _getDecorationsInRange(viewRange: Range, onlyMinimapDecorations: boolean, onlyMarginDecorations: boolean): IViewDecorationsCollection {\n\t\tconst modelDecorations = this._linesCollection.getDecorationsInRange(viewRange, this.editorId, filterValidationDecorations(this.configuration.options), filterFontDecorations(this.configuration.options), onlyMinimapDecorations, onlyMarginDecorations);\n\t\tconst startLineNumber = viewRange.startLineNumber;\n\t\tconst endLineNumber = viewRange.endLineNumber;\n\n\t\tconst decorationsInViewport: ViewModelDecoration[] = [];\n\t\tlet decorationsInViewportLen = 0;\n\t\tconst inlineDecorations: InlineDecoration[][] = [];\n\t\tconst hasVariableFonts: boolean[] = [];\n\t\tfor (let j = startLineNumber; j <= endLineNumber; j++) {\n\t\t\tinlineDecorations[j - startLineNumber] = [];\n\t\t\thasVariableFonts[j - startLineNumber] = false;\n\t\t}\n\n\t\tfor (let i = 0, len = modelDecorations.length; i < len; i++) {\n\t\t\tconst modelDecoration = modelDecorations[i];\n\t\t\tconst decorationOptions = modelDecoration.options;\n\n\t\t\tif (!isModelDecorationVisible(this.model, modelDecoration)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration);\n\t\t\tconst viewRange = viewModelDecoration.range;\n\n\t\t\tdecorationsInViewport[decorationsInViewportLen++] = viewModelDecoration;\n\n\t\t\tif (decorationOptions.inlineClassName) {\n\t\t\t\tconst inlineDecoration = new InlineDecoration(viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? InlineDecorationType.RegularAffectingLetterSpacing : InlineDecorationType.Regular);\n\t\t\t\tconst intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber);\n\t\t\t\tconst intersectedEndLineNumber = Math.min(endLineNumber, viewRange.endLineNumber);\n\t\t\t\tfor (let j = intersectedStartLineNumber; j <= intersectedEndLineNumber; j++) {\n\t\t\t\t\tinlineDecorations[j - startLineNumber].push(inlineDecoration);\n\t\t\t\t\tif (decorationOptions.affectsFont) {\n\t\t\t\t\t\thasVariableFonts[j - startLineNumber] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.beforeContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.startLineNumber && viewRange.startLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.startLineNumber, viewRange.startColumn, viewRange.startLineNumber, viewRange.startColumn),\n\t\t\t\t\t\tdecorationOptions.beforeContentClassName,\n\t\t\t\t\t\tInlineDecorationType.Before\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.startLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t\tif (decorationOptions.affectsFont) {\n\t\t\t\t\t\thasVariableFonts[viewRange.startLineNumber - startLineNumber] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.afterContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.endLineNumber && viewRange.endLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.endLineNumber, viewRange.endColumn, viewRange.endLineNumber, viewRange.endColumn),\n\t\t\t\t\t\tdecorationOptions.afterContentClassName,\n\t\t\t\t\t\tInlineDecorationType.After\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t\tif (decorationOptions.affectsFont) {\n\t\t\t\t\t\thasVariableFonts[viewRange.endLineNumber - startLineNumber] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdecorations: decorationsInViewport,\n\t\t\tinlineDecorations: inlineDecorations,\n\t\t\thasVariableFonts\n\t\t};\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IDisposable } from '../../../base/common/lifecycle.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { IEditorConfiguration } from '../config/editorConfiguration.js';\nimport { IModelDecoration, ITextModel, PositionAffinity } from '../model.js';\nimport { IViewModelLines } from './viewModelLines.js';\nimport { filterFontDecorations, filterValidationDecorations } from '../config/editorOptions.js';\nimport { isModelDecorationVisible, ViewModelDecoration } from './viewModelDecoration.js';\nimport { InlineDecoration, InlineDecorationType } from './inlineDecorations.js';\nimport { ICoordinatesConverter } from '../coordinatesConverter.js';\n\n/**\n * A collection of decorations in a range of lines.\n */\nexport interface IViewDecorationsCollection {\n\t/**\n\t * decorations in the range of lines (ungrouped).\n\t */\n\treadonly decorations: ViewModelDecoration[];\n\t/**\n\t * inline decorations (grouped by each line in the range of lines).\n\t */\n\treadonly inlineDecorations: InlineDecoration[][];\n\t/**\n\t * Whether the decorations affect the fonts.\n\t */\n\treadonly hasVariableFonts: boolean[];\n}\n\nexport class ViewModelDecorations implements IDisposable {\n\n\tprivate readonly editorId: number;\n\tprivate readonly model: ITextModel;\n\tprivate readonly configuration: IEditorConfiguration;\n\tprivate readonly _linesCollection: IViewModelLines;\n\tprivate readonly _coordinatesConverter: ICoordinatesConverter;\n\n\tprivate _decorationsCache: { [decorationId: string]: ViewModelDecoration };\n\n\tprivate _cachedModelDecorationsResolver: IViewDecorationsCollection | null;\n\tprivate _cachedModelDecorationsResolverViewRange: Range | null;\n\n\tconstructor(editorId: number, model: ITextModel, configuration: IEditorConfiguration, linesCollection: IViewModelLines, coordinatesConverter: ICoordinatesConverter) {\n\t\tthis.editorId = editorId;\n\t\tthis.model = model;\n\t\tthis.configuration = configuration;\n\t\tthis._linesCollection = linesCollection;\n\t\tthis._coordinatesConverter = coordinatesConverter;\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tprivate _clearCachedModelDecorationsResolver(): void {\n\t\tthis._cachedModelDecorationsResolver = null;\n\t\tthis._cachedModelDecorationsResolverViewRange = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic reset(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onModelDecorationsChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tpublic onLineMappingChanged(): void {\n\t\tthis._decorationsCache = Object.create(null);\n\n\t\tthis._clearCachedModelDecorationsResolver();\n\t}\n\n\tprivate _getOrCreateViewModelDecoration(modelDecoration: IModelDecoration): ViewModelDecoration {\n\t\tconst id = modelDecoration.id;\n\t\tlet r = this._decorationsCache[id];\n\t\tif (!r) {\n\t\t\tconst modelRange = modelDecoration.range;\n\t\t\tconst options = modelDecoration.options;\n\t\t\tlet viewRange: Range;\n\t\t\tif (options.isWholeLine) {\n\t\t\t\tconst start = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.startLineNumber, 1), PositionAffinity.Left, false, true);\n\t\t\t\tconst end = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber)), PositionAffinity.Right);\n\t\t\t\tviewRange = new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t\t\t} else {\n\t\t\t\t// For backwards compatibility reasons, we want injected text before any decoration.\n\t\t\t\t// Thus, move decorations to the right.\n\t\t\t\tviewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange, PositionAffinity.Right);\n\t\t\t}\n\t\t\tr = new ViewModelDecoration(viewRange, options);\n\t\t\tthis._decorationsCache[id] = r;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic getMinimapDecorationsInRange(range: Range): ViewModelDecoration[] {\n\t\treturn this._getDecorationsInRange(range, true, false).decorations;\n\t}\n\n\tpublic getDecorationsViewportData(viewRange: Range): IViewDecorationsCollection {\n\t\tlet cacheIsValid = (this._cachedModelDecorationsResolver !== null);\n\t\tcacheIsValid = cacheIsValid && (viewRange.equalsRange(this._cachedModelDecorationsResolverViewRange));\n\t\tif (!cacheIsValid) {\n\t\t\tthis._cachedModelDecorationsResolver = this._getDecorationsInRange(viewRange, false, false);\n\t\t\tthis._cachedModelDecorationsResolverViewRange = viewRange;\n\t\t}\n\t\treturn this._cachedModelDecorationsResolver!;\n\t}\n\n\tpublic getDecorationsOnLine(lineNumber: number, onlyMinimapDecorations: boolean = false, onlyMarginDecorations: boolean = false): IViewDecorationsCollection {\n\t\tconst range = new Range(lineNumber, this._linesCollection.getViewLineMinColumn(lineNumber), lineNumber, this._linesCollection.getViewLineMaxColumn(lineNumber));\n\t\treturn this._getDecorationsInRange(range, onlyMinimapDecorations, onlyMarginDecorations);\n\t}\n\n\tprivate _getDecorationsInRange(viewRange: Range, onlyMinimapDecorations: boolean, onlyMarginDecorations: boolean): IViewDecorationsCollection {\n\t\tconst modelDecorations = this._linesCollection.getDecorationsInRange(viewRange, this.editorId, filterValidationDecorations(this.configuration.options), filterFontDecorations(this.configuration.options), onlyMinimapDecorations, onlyMarginDecorations);\n\t\tconst startLineNumber = viewRange.startLineNumber;\n\t\tconst endLineNumber = viewRange.endLineNumber;\n\n\t\tconst decorationsInViewport: ViewModelDecoration[] = [];\n\t\tlet decorationsInViewportLen = 0;\n\t\tconst inlineDecorations: InlineDecoration[][] = [];\n\t\tconst hasVariableFonts: boolean[] = [];\n\t\tfor (let j = startLineNumber; j <= endLineNumber; j++) {\n\t\t\tinlineDecorations[j - startLineNumber] = [];\n\t\t\thasVariableFonts[j - startLineNumber] = false;\n\t\t}\n\n\t\tfor (let i = 0, len = modelDecorations.length; i < len; i++) {\n\t\t\tconst modelDecoration = modelDecorations[i];\n\t\t\tconst decorationOptions = modelDecoration.options;\n\n\t\t\tif (!isModelDecorationVisible(this.model, modelDecoration)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration);\n\t\t\tconst viewRange = viewModelDecoration.range;\n\n\t\t\tdecorationsInViewport[decorationsInViewportLen++] = viewModelDecoration;\n\n\t\t\tif (decorationOptions.inlineClassName) {\n\t\t\t\tconst inlineDecoration = new InlineDecoration(viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? InlineDecorationType.RegularAffectingLetterSpacing : InlineDecorationType.Regular);\n\t\t\t\tconst intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber);\n\t\t\t\tconst intersectedEndLineNumber = Math.min(endLineNumber, viewRange.endLineNumber);\n\t\t\t\tfor (let j = intersectedStartLineNumber; j <= intersectedEndLineNumber; j++) {\n\t\t\t\t\tinlineDecorations[j - startLineNumber].push(inlineDecoration);\n\t\t\t\t\tif (decorationOptions.affectsFont) {\n\t\t\t\t\t\thasVariableFonts[j - startLineNumber] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.beforeContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.startLineNumber && viewRange.startLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.startLineNumber, viewRange.startColumn, viewRange.startLineNumber, viewRange.startColumn),\n\t\t\t\t\t\tdecorationOptions.beforeContentClassName,\n\t\t\t\t\t\tInlineDecorationType.Before\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.startLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t\tif (decorationOptions.affectsFont) {\n\t\t\t\t\t\thasVariableFonts[viewRange.startLineNumber - startLineNumber] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (decorationOptions.afterContentClassName) {\n\t\t\t\tif (startLineNumber <= viewRange.endLineNumber && viewRange.endLineNumber <= endLineNumber) {\n\t\t\t\t\tconst inlineDecoration = new InlineDecoration(\n\t\t\t\t\t\tnew Range(viewRange.endLineNumber, viewRange.endColumn, viewRange.endLineNumber, viewRange.endColumn),\n\t\t\t\t\t\tdecorationOptions.afterContentClassName,\n\t\t\t\t\t\tInlineDecorationType.After\n\t\t\t\t\t);\n\t\t\t\t\tinlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration);\n\t\t\t\t\tif (decorationOptions.affectsFont) {\n\t\t\t\t\t\thasVariableFonts[viewRange.endLineNumber - startLineNumber] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdecorations: decorationsInViewport,\n\t\t\tinlineDecorations: inlineDecorations,\n\t\t\thasVariableFonts\n\t\t};\n\t}\n}\n"]}
|
|
@@ -105,6 +105,9 @@ export class ViewModel extends Disposable {
|
|
|
105
105
|
this._viewportStart.dispose();
|
|
106
106
|
this._eventDispatcher.dispose();
|
|
107
107
|
}
|
|
108
|
+
getEditorOption(id) {
|
|
109
|
+
return this._configuration.options.get(id);
|
|
110
|
+
}
|
|
108
111
|
createLineBreaksComputer() {
|
|
109
112
|
return this._lines.createLineBreaksComputer();
|
|
110
113
|
}
|
|
@@ -119,6 +122,7 @@ export class ViewModel extends Disposable {
|
|
|
119
122
|
if (!allowVariableLineHeights) {
|
|
120
123
|
return [];
|
|
121
124
|
}
|
|
125
|
+
const defaultLineHeight = this._configuration.options.get(75 /* EditorOption.lineHeight */);
|
|
122
126
|
const decorations = this.model.getCustomLineHeightsDecorations(this._editorId);
|
|
123
127
|
return decorations.map((d) => {
|
|
124
128
|
const lineNumber = d.range.startLineNumber;
|
|
@@ -127,7 +131,7 @@ export class ViewModel extends Disposable {
|
|
|
127
131
|
decorationId: d.id,
|
|
128
132
|
startLineNumber: viewRange.startLineNumber,
|
|
129
133
|
endLineNumber: viewRange.endLineNumber,
|
|
130
|
-
lineHeight: d.options.lineHeight
|
|
134
|
+
lineHeight: d.options.lineHeight ? d.options.lineHeight * defaultLineHeight : 0
|
|
131
135
|
};
|
|
132
136
|
});
|
|
133
137
|
}
|
|
@@ -665,12 +669,14 @@ export class ViewModel extends Disposable {
|
|
|
665
669
|
}
|
|
666
670
|
getViewportViewLineRenderingData(visibleRange, lineNumber) {
|
|
667
671
|
const viewportDecorationsCollection = this._decorations.getDecorationsViewportData(visibleRange);
|
|
668
|
-
const
|
|
669
|
-
|
|
672
|
+
const relativeLineNumber = lineNumber - visibleRange.startLineNumber;
|
|
673
|
+
const inlineDecorations = viewportDecorationsCollection.inlineDecorations[relativeLineNumber];
|
|
674
|
+
const hasVariableFonts = viewportDecorationsCollection.hasVariableFonts[relativeLineNumber];
|
|
675
|
+
return this._getViewLineRenderingData(lineNumber, inlineDecorations, hasVariableFonts, viewportDecorationsCollection.decorations);
|
|
670
676
|
}
|
|
671
677
|
getViewLineRenderingData(lineNumber) {
|
|
672
678
|
const decorationsCollection = this._decorations.getDecorationsOnLine(lineNumber);
|
|
673
|
-
return this._getViewLineRenderingData(lineNumber, decorationsCollection.inlineDecorations[0], decorationsCollection.hasVariableFonts, decorationsCollection.decorations);
|
|
679
|
+
return this._getViewLineRenderingData(lineNumber, decorationsCollection.inlineDecorations[0], decorationsCollection.hasVariableFonts[0], decorationsCollection.decorations);
|
|
674
680
|
}
|
|
675
681
|
_getViewLineRenderingData(lineNumber, inlineDecorations, hasVariableFonts, decorations) {
|
|
676
682
|
const mightContainRTL = this.model.mightContainRTL();
|
|
@@ -765,33 +771,38 @@ export class ViewModel extends Disposable {
|
|
|
765
771
|
}
|
|
766
772
|
if (!hasNonEmptyRange && !emptySelectionClipboard) {
|
|
767
773
|
// all ranges are empty
|
|
768
|
-
return '';
|
|
774
|
+
return { sourceRanges: [], sourceText: '' };
|
|
769
775
|
}
|
|
776
|
+
const ranges = [];
|
|
777
|
+
const result = [];
|
|
778
|
+
const pushRange = (modelRange, append = '') => {
|
|
779
|
+
ranges.push(modelRange);
|
|
780
|
+
result.push(this.model.getValueInRange(modelRange, forceCRLF ? 2 /* EndOfLinePreference.CRLF */ : 0 /* EndOfLinePreference.TextDefined */) + append);
|
|
781
|
+
};
|
|
770
782
|
if (hasEmptyRange && emptySelectionClipboard) {
|
|
771
783
|
// some (maybe all) empty selections
|
|
772
|
-
const result = [];
|
|
773
784
|
let prevModelLineNumber = 0;
|
|
774
785
|
for (const modelRange of modelRanges) {
|
|
775
786
|
const modelLineNumber = modelRange.startLineNumber;
|
|
776
787
|
if (modelRange.isEmpty()) {
|
|
777
788
|
if (modelLineNumber !== prevModelLineNumber) {
|
|
778
|
-
|
|
789
|
+
pushRange(new Range(modelLineNumber, this.model.getLineMinColumn(modelLineNumber), modelLineNumber, this.model.getLineMaxColumn(modelLineNumber)), newLineCharacter);
|
|
779
790
|
}
|
|
780
791
|
}
|
|
781
792
|
else {
|
|
782
|
-
|
|
793
|
+
pushRange(modelRange);
|
|
783
794
|
}
|
|
784
795
|
prevModelLineNumber = modelLineNumber;
|
|
785
796
|
}
|
|
786
|
-
return result.length === 1 ? result[0] : result;
|
|
787
797
|
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
798
|
+
else {
|
|
799
|
+
for (const modelRange of modelRanges) {
|
|
800
|
+
if (!modelRange.isEmpty()) {
|
|
801
|
+
pushRange(modelRange);
|
|
802
|
+
}
|
|
792
803
|
}
|
|
793
804
|
}
|
|
794
|
-
return result.length === 1 ? result[0] : result;
|
|
805
|
+
return { sourceRanges: ranges, sourceText: result.length === 1 ? result[0] : result };
|
|
795
806
|
}
|
|
796
807
|
getRichTextToCopy(modelRanges, emptySelectionClipboard) {
|
|
797
808
|
const languageId = this.model.getLanguageId();
|