monaco-editor-core 0.56.0-dev-20260131 → 0.56.0-dev-20260202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260131(e740ab4da3fac226afe362703507aba5af3f0ba9)
3
+ * Version: 0.56.0-dev-20260202(e740ab4da3fac226afe362703507aba5af3f0ba9)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -104,6 +104,9 @@ export class FullFileRenderStrategy extends BaseRenderStrategy {
104
104
  return true;
105
105
  }
106
106
  onScrollChanged(e) {
107
+ if (this._store.isDisposed) {
108
+ return false;
109
+ }
107
110
  const dpr = getActiveWindow().devicePixelRatio;
108
111
  this._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;
109
112
  this._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/gpu/renderStrategy/fullFileRenderStrategy.ts","vs/editor/browser/gpu/renderStrategy/fullFileRenderStrategy.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAQtE,OAAO,EAAE,sBAAsB,EAA0B,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAyB7D;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAE7D;;OAEG;aACa,sBAAiB,GAAG,IAAH,AAAO,CAAC;IA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,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;;AAGF,SAAS,kBAAkB,CAAC,KAAa;IACxC,QAAQ,KAAK,EAAE,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ,CAAC,CAAC,OAAO,GAAG,CAAC;QAC1B,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC;IACzB,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACrC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAC/D,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;QAClC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC","file":"fullFileRenderStrategy.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 { getActiveWindow } from '../../../../base/browser/dom.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { IViewLineTokens } from '../../../common/tokens/lineTokens.js';\nimport { ViewEventType, type ViewConfigurationChangedEvent, type ViewDecorationsChangedEvent, type ViewLineMappingChangedEvent, type ViewLinesChangedEvent, type ViewLinesDeletedEvent, type ViewLinesInsertedEvent, type ViewScrollChangedEvent, type ViewThemeChangedEvent, type ViewTokensChangedEvent, type ViewZonesChangedEvent } from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineRenderingData } from '../../../common/viewModel.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ViewLineOptions } from '../../viewParts/viewLines/viewLineOptions.js';\nimport { ITextureAtlasPageGlyph } from '../atlas/atlas.js';\nimport { createContentSegmenter, type IContentSegmenter } from '../contentSegmenter.js';\nimport { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js';\nimport { BindingId } from '../gpu.js';\nimport { GPULifecycle } from '../gpuDisposable.js';\nimport { quadVertices } from '../gpuUtils.js';\nimport { GlyphRasterizer } from '../raster/glyphRasterizer.js';\nimport { ViewGpuContext } from '../viewGpuContext.js';\nimport { BaseRenderStrategy } from './baseRenderStrategy.js';\nimport { InlineDecoration } from '../../../common/viewModel/inlineDecorations.js';\n\nconst enum Constants {\n\tIndicesPerCell = 6,\n}\n\nconst enum CellBufferInfo {\n\tFloatsPerEntry = 6,\n\tBytesPerEntry = CellBufferInfo.FloatsPerEntry * 4,\n\tOffset_X = 0,\n\tOffset_Y = 1,\n\tOffset_Unused1 = 2,\n\tOffset_Unused2 = 3,\n\tGlyphIndex = 4,\n\tTextureIndex = 5,\n}\n\ntype QueuedBufferEvent = (\n\tViewConfigurationChangedEvent |\n\tViewLineMappingChangedEvent |\n\tViewLinesDeletedEvent |\n\tViewZonesChangedEvent\n);\n\n/**\n * A render strategy that tracks a large buffer, uploading only dirty lines as they change and\n * leveraging heavy caching. This is the most performant strategy but has limitations around long\n * lines and too many lines.\n */\nexport class FullFileRenderStrategy extends BaseRenderStrategy {\n\n\t/**\n\t * The hard cap for line count that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedLines = 3000;\n\n\t/**\n\t * The hard cap for line columns that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedColumns = 200;\n\n\treadonly type = 'fullfile';\n\treadonly wgsl: string = fullFileRenderStrategyWgsl;\n\n\tprivate _cellBindBuffer!: GPUBuffer;\n\n\t/**\n\t * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that\n\t * the thread doesn't block when one is being uploaded to the GPU.\n\t */\n\tprivate _cellValueBuffers!: [ArrayBuffer, ArrayBuffer];\n\tprivate _activeDoubleBufferIndex: 0 | 1 = 0;\n\n\tprivate readonly _upToDateLines: [Set<number>, Set<number>] = [new Set(), new Set()];\n\tprivate _visibleObjectCount: number = 0;\n\tprivate _finalRenderedLine: number = 0;\n\n\tprivate _scrollOffsetBindBuffer: GPUBuffer;\n\tprivate _scrollOffsetValueBuffer: Float32Array;\n\tprivate _scrollInitialized: boolean = false;\n\n\tprivate readonly _queuedBufferUpdates: [QueuedBufferEvent[], QueuedBufferEvent[]] = [[], []];\n\n\tget bindGroupEntries(): GPUBindGroupEntry[] {\n\t\treturn [\n\t\t\t{ binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } },\n\t\t\t{ binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }\n\t\t];\n\t}\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewGpuContext: ViewGpuContext,\n\t\tdevice: GPUDevice,\n\t\tglyphRasterizer: { value: GlyphRasterizer },\n\t) {\n\t\tsuper(context, viewGpuContext, device, glyphRasterizer);\n\n\t\tconst bufferSize = FullFileRenderStrategy.maxSupportedLines * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT;\n\t\tthis._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco full file cell buffer',\n\t\t\tsize: bufferSize,\n\t\t\tusage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._cellValueBuffers = [\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t];\n\n\t\tconst scrollOffsetBufferSize = 2;\n\t\tthis._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco scroll offset buffer',\n\t\t\tsize: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT,\n\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize);\n\t}\n\n\t// #region Event handlers\n\n\t// The primary job of these handlers is to:\n\t// 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when\n\t// it's _within the viewport_.\n\t// 2. Pass relevant events on to the render function so it can force certain line ranges to be\n\t// re-rendered even if they're not in the viewport. For example when a view zone is added,\n\t// there are lines that used to be visible but are no longer, so those ranges must be\n\t// cleared and uploaded to the GPU.\n\n\tpublic override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: ViewDecorationsChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\treturn true;\n\t}\n\n\tpublic override onTokensChanged(e: ViewTokensChangedEvent): boolean {\n\t\t// TODO: This currently fires for the entire viewport whenever scrolling stops\n\t\t// https://github.com/microsoft/vscode/issues/233942\n\t\tfor (const range of e.ranges) {\n\t\t\tthis._invalidateLineRange(range.fromLineNumber, range.toLineNumber);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic override onLinesDeleted(e: ViewLinesDeletedEvent): boolean {\n\t\t// TODO: This currently invalidates everything after the deleted line, it could shift the\n\t\t// line data up to retain some up to date lines\n\t\t// TODO: This does not invalidate lines that are no longer in the file\n\t\tthis._invalidateLinesFrom(e.fromLineNumber);\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: ViewLinesInsertedEvent): boolean {\n\t\t// TODO: This currently invalidates everything after the deleted line, it could shift the\n\t\t// line data up to retain some up to date lines\n\t\tthis._invalidateLinesFrom(e.fromLineNumber);\n\t\treturn true;\n\t}\n\n\tpublic override onLinesChanged(e: ViewLinesChangedEvent): boolean {\n\t\tthis._invalidateLineRange(e.fromLineNumber, e.fromLineNumber + e.count);\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e?: ViewScrollChangedEvent): boolean {\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tthis._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;\n\t\tthis._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;\n\t\tthis._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer as Float32Array<ArrayBuffer>);\n\t\treturn true;\n\t}\n\n\tpublic override onThemeChanged(e: ViewThemeChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: ViewLineMappingChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onZonesChanged(e: ViewZonesChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\n\t\treturn true;\n\t}\n\n\t// #endregion\n\n\tprivate _invalidateAllLines(): void {\n\t\tthis._upToDateLines[0].clear();\n\t\tthis._upToDateLines[1].clear();\n\t}\n\n\tprivate _invalidateLinesFrom(lineNumber: number): void {\n\t\tfor (const i of [0, 1]) {\n\t\t\tconst upToDateLines = this._upToDateLines[i];\n\t\t\tfor (const upToDateLine of upToDateLines) {\n\t\t\t\tif (upToDateLine >= lineNumber) {\n\t\t\t\t\tupToDateLines.delete(upToDateLine);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _invalidateLineRange(fromLineNumber: number, toLineNumber: number): void {\n\t\tfor (let i = fromLineNumber; i <= toLineNumber; i++) {\n\t\t\tthis._upToDateLines[0].delete(i);\n\t\t\tthis._upToDateLines[1].delete(i);\n\t\t}\n\t}\n\n\treset() {\n\t\tthis._invalidateAllLines();\n\t\tfor (const bufferIndex of [0, 1]) {\n\t\t\t// Zero out buffer and upload to GPU to prevent stale rows from rendering\n\t\t\tconst buffer = new Float32Array(this._cellValueBuffers[bufferIndex]);\n\t\t\tbuffer.fill(0, 0, buffer.length);\n\t\t\tthis._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength);\n\t\t}\n\t\tthis._finalRenderedLine = 0;\n\t}\n\n\tupdate(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number {\n\t\t// IMPORTANT: This is a hot function. Variables are pre-allocated and shared within the\n\t\t// loop. This is done so we don't need to trust the JIT compiler to do this optimization to\n\t\t// avoid potential additional blocking time in garbage collector which is a common cause of\n\t\t// dropped frames.\n\n\t\tlet chars = '';\n\t\tlet segment: string | undefined;\n\t\tlet charWidth = 0;\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tlet absoluteOffsetX = 0;\n\t\tlet absoluteOffsetY = 0;\n\t\tlet tabXOffset = 0;\n\t\tlet glyph: Readonly<ITextureAtlasPageGlyph>;\n\t\tlet cellIndex = 0;\n\n\t\tlet tokenStartIndex = 0;\n\t\tlet tokenEndIndex = 0;\n\t\tlet tokenMetadata = 0;\n\n\t\tlet decorationStyleSetBold: boolean | undefined;\n\t\tlet decorationStyleSetColor: number | undefined;\n\t\tlet decorationStyleSetOpacity: number | undefined;\n\t\tlet decorationStyleSetStrikethrough: boolean | undefined;\n\t\tlet decorationStyleSetStrikethroughThickness: number | undefined;\n\t\tlet decorationStyleSetStrikethroughColor: number | undefined;\n\n\t\tlet lineData: ViewLineRenderingData;\n\t\tlet decoration: InlineDecoration;\n\t\tlet fillStartIndex = 0;\n\t\tlet fillEndIndex = 0;\n\n\t\tlet tokens: IViewLineTokens;\n\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tlet contentSegmenter: IContentSegmenter;\n\n\t\tif (!this._scrollInitialized) {\n\t\t\tthis.onScrollChanged();\n\t\t\tthis._scrollInitialized = true;\n\t\t}\n\n\t\t// Update cell data\n\t\tconst cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);\n\t\tconst lineIndexCount = FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\n\t\tconst upToDateLines = this._upToDateLines[this._activeDoubleBufferIndex];\n\t\tlet dirtyLineStart = 3000;\n\t\tlet dirtyLineEnd = 0;\n\n\t\t// Handle any queued buffer updates\n\t\tconst queuedBufferUpdates = this._queuedBufferUpdates[this._activeDoubleBufferIndex];\n\t\twhile (queuedBufferUpdates.length) {\n\t\t\tconst e = queuedBufferUpdates.shift()!;\n\t\t\tswitch (e.type) {\n\t\t\t\t// TODO: Refine these cases so we're not throwing away everything\n\t\t\t\tcase ViewEventType.ViewConfigurationChanged:\n\t\t\t\tcase ViewEventType.ViewLineMappingChanged:\n\t\t\t\tcase ViewEventType.ViewZonesChanged: {\n\t\t\t\t\tcellBuffer.fill(0);\n\n\t\t\t\t\tdirtyLineStart = 1;\n\t\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, this._finalRenderedLine);\n\t\t\t\t\tthis._finalRenderedLine = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase ViewEventType.ViewLinesDeleted: {\n\t\t\t\t\t// Shift content below deleted line up\n\t\t\t\t\tconst deletedLineContentStartIndex = (e.fromLineNumber - 1) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tconst deletedLineContentEndIndex = (e.toLineNumber) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tconst nullContentStartIndex = (this._finalRenderedLine - (e.toLineNumber - e.fromLineNumber + 1)) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer.set(cellBuffer.subarray(deletedLineContentEndIndex), deletedLineContentStartIndex);\n\n\t\t\t\t\t// Zero out content on lines that are no longer valid\n\t\t\t\t\tcellBuffer.fill(0, nullContentStartIndex);\n\n\t\t\t\t\t// Update dirty lines and final rendered line\n\t\t\t\t\tdirtyLineStart = Math.min(dirtyLineStart, e.fromLineNumber);\n\t\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, this._finalRenderedLine);\n\t\t\t\t\tthis._finalRenderedLine -= e.toLineNumber - e.fromLineNumber + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) {\n\n\t\t\t// Only attempt to render lines that the GPU renderer can handle\n\t\t\tif (!this._viewGpuContext.canRender(viewLineOptions, viewportData, y)) {\n\t\t\t\tfillStartIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\t\tfillEndIndex = (y * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\n\t\t\t\tdirtyLineStart = Math.min(dirtyLineStart, y);\n\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, y);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip updating the line if it's already up to date\n\t\t\tif (upToDateLines.has(y)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdirtyLineStart = Math.min(dirtyLineStart, y);\n\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, y);\n\n\t\t\tlineData = viewportData.getViewLineRenderingData(y);\n\t\t\ttabXOffset = 0;\n\n\t\t\tcontentSegmenter = createContentSegmenter(lineData, viewLineOptions);\n\t\t\tcharWidth = viewLineOptions.spaceWidth * dpr;\n\t\t\tabsoluteOffsetX = (lineData.minColumn - 1) * charWidth;\n\n\t\t\ttokens = lineData.tokens;\n\t\t\ttokenStartIndex = lineData.minColumn - 1;\n\t\t\ttokenEndIndex = 0;\n\t\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\t\ttokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\t\tif (tokenEndIndex <= tokenStartIndex) {\n\t\t\t\t\t// The faux indent part of the line should have no token type\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttokenMetadata = tokens.getMetadata(tokenIndex);\n\n\t\t\t\tfor (x = tokenStartIndex; x < tokenEndIndex; x++) {\n\t\t\t\t\t// Only render lines that do not exceed maximum columns\n\t\t\t\t\tif (x > FullFileRenderStrategy.maxSupportedColumns) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegment = contentSegmenter.getSegmentAtIndex(x);\n\t\t\t\t\tif (segment === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tchars = segment;\n\n\t\t\t\t\tif (!(lineData.isBasicASCII && viewLineOptions.useMonospaceOptimizations)) {\n\t\t\t\t\t\tcharWidth = this.glyphRasterizer.getTextMetrics(chars).width;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorationStyleSetColor = undefined;\n\t\t\t\t\tdecorationStyleSetBold = undefined;\n\t\t\t\t\tdecorationStyleSetOpacity = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethrough = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughThickness = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughColor = undefined;\n\n\t\t\t\t\t// Apply supported inline decoration styles to the cell metadata\n\t\t\t\t\tfor (decoration of lineData.inlineDecorations) {\n\t\t\t\t\t\t// This is Range.strictContainsPosition except it works at the cell level,\n\t\t\t\t\t\t// it's also inlined to avoid overhead.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(y < decoration.range.startLineNumber || y > decoration.range.endLineNumber) ||\n\t\t\t\t\t\t\t(y === decoration.range.startLineNumber && x < decoration.range.startColumn - 1) ||\n\t\t\t\t\t\t\t(y === decoration.range.endLineNumber && x >= decoration.range.endColumn - 1)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst rules = ViewGpuContext.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, decoration.inlineClassName);\n\t\t\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\t\t\tconst value = rule.styleMap.get(r)?.toString() ?? '';\n\t\t\t\t\t\t\t\tswitch (r) {\n\t\t\t\t\t\t\t\t\tcase 'color': {\n\t\t\t\t\t\t\t\t\t\t// TODO: This parsing and error handling should move into canRender so fallback\n\t\t\t\t\t\t\t\t\t\t// to DOM works\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(value);\n\t\t\t\t\t\t\t\t\t\tif (!parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new BugIndicatingError('Invalid color format ' + value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'font-weight': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssFontWeight(value);\n\t\t\t\t\t\t\t\t\t\tif (parsedValue >= 400) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = true;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set bold (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = false;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set normal (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'opacity': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssOpacity(value);\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetOpacity = parsedValue;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration':\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-line': {\n\t\t\t\t\t\t\t\t\t\tif (value === 'line-through') {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethrough = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-thickness': {\n\t\t\t\t\t\t\t\t\t\tconst match = value.match(/^(\\d+(?:\\.\\d+)?)px$/);\n\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughThickness = parseFloat(match[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-color': {\n\t\t\t\t\t\t\t\t\t\tlet colorValue = value;\n\t\t\t\t\t\t\t\t\t\tconst varMatch = value.match(/^var\\((--[^,]+),\\s*(?:initial|inherit)\\)$/);\n\t\t\t\t\t\t\t\t\t\tif (varMatch) {\n\t\t\t\t\t\t\t\t\t\t\tcolorValue = ViewGpuContext.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode, varMatch[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(colorValue);\n\t\t\t\t\t\t\t\t\t\tif (parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-style': {\n\t\t\t\t\t\t\t\t\t\t// These are validated in canRender and use default behavior\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new BugIndicatingError('Unexpected inline decoration style');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chars === ' ' || chars === '\\t') {\n\t\t\t\t\t\t// Zero out glyph to ensure it doesn't get rendered\n\t\t\t\t\t\tcellIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\t\tcellBuffer.fill(0, cellIndex, cellIndex + CellBufferInfo.FloatsPerEntry);\n\t\t\t\t\t\t// Adjust xOffset for tab stops\n\t\t\t\t\t\tif (chars === '\\t') {\n\t\t\t\t\t\t\t// Find the pixel offset between the current position and the next tab stop\n\t\t\t\t\t\t\tconst offsetBefore = x + tabXOffset;\n\t\t\t\t\t\t\ttabXOffset = CursorColumns.nextRenderTabStop(x + tabXOffset, lineData.tabSize);\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth * (tabXOffset - offsetBefore);\n\t\t\t\t\t\t\t// Convert back to offset excluding x and the current character\n\t\t\t\t\t\t\ttabXOffset -= x + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst decorationStyleSetId = ViewGpuContext.decorationStyleCache.getOrCreateEntry(decorationStyleSetColor, decorationStyleSetBold, decorationStyleSetOpacity, decorationStyleSetStrikethrough, decorationStyleSetStrikethroughThickness, decorationStyleSetStrikethroughColor);\n\t\t\t\t\tglyph = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, chars, tokenMetadata, decorationStyleSetId, absoluteOffsetX);\n\n\t\t\t\t\tabsoluteOffsetY = Math.round(\n\t\t\t\t\t\t// Top of layout box (includes line height)\n\t\t\t\t\t\tviewportData.relativeVerticalOffset[y - viewportData.startLineNumber] * dpr +\n\n\t\t\t\t\t\t// Delta from top of layout box (includes line height) to top of the inline box (no line height)\n\t\t\t\t\t\tMath.floor((viewportData.lineHeight * dpr - (glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent)) / 2) +\n\n\t\t\t\t\t\t// Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn\n\t\t\t\t\t\t// with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical\n\t\t\t\t\t\t// baseline.\n\t\t\t\t\t\tglyph.fontBoundingBoxAscent\n\t\t\t\t\t);\n\n\t\t\t\t\tcellIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_X] = Math.floor(absoluteOffsetX);\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_Y] = absoluteOffsetY;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex;\n\n\t\t\t\t\t// Adjust the x pixel offset for the next character\n\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t}\n\n\t\t\t\ttokenStartIndex = tokenEndIndex;\n\t\t\t}\n\n\t\t\t// Clear to end of line\n\t\t\tfillStartIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + tokenEndIndex) * Constants.IndicesPerCell;\n\t\t\tfillEndIndex = (y * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\n\t\t\tupToDateLines.add(y);\n\t\t}\n\n\t\tconst visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount;\n\n\t\t// Only write when there is changed data\n\t\tdirtyLineStart = Math.min(dirtyLineStart, FullFileRenderStrategy.maxSupportedLines);\n\t\tdirtyLineEnd = Math.min(dirtyLineEnd, FullFileRenderStrategy.maxSupportedLines);\n\t\tif (dirtyLineStart <= dirtyLineEnd) {\n\t\t\t// Write buffer and swap it out to unblock writes\n\t\t\tthis._device.queue.writeBuffer(\n\t\t\t\tthis._cellBindBuffer,\n\t\t\t\t(dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\tcellBuffer.buffer,\n\t\t\t\t(dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\t(dirtyLineEnd - dirtyLineStart + 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT\n\t\t\t);\n\t\t}\n\n\t\tthis._finalRenderedLine = Math.max(this._finalRenderedLine, dirtyLineEnd);\n\n\t\tthis._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1;\n\n\t\tthis._visibleObjectCount = visibleObjectCount;\n\n\t\treturn visibleObjectCount;\n\t}\n\n\tdraw(pass: GPURenderPassEncoder, viewportData: ViewportData): void {\n\t\tif (this._visibleObjectCount <= 0) {\n\t\t\tthrow new BugIndicatingError('Attempt to draw 0 objects');\n\t\t}\n\t\tpass.draw(\n\t\t\tquadVertices.length / 2,\n\t\t\tthis._visibleObjectCount,\n\t\t\tundefined,\n\t\t\t(viewportData.startLineNumber - 1) * FullFileRenderStrategy.maxSupportedColumns\n\t\t);\n\t}\n\n\t/**\n\t * Queue updates that need to happen on the active buffer, not just the cache. This will be\n\t * deferred to when the actual cell buffer is changed since the active buffer could be locked by\n\t * the GPU which would block the main thread.\n\t */\n\tprivate _queueBufferUpdate(e: QueuedBufferEvent) {\n\t\tthis._queuedBufferUpdates[0].push(e);\n\t\tthis._queuedBufferUpdates[1].push(e);\n\t}\n}\n\nfunction parseCssFontWeight(value: string) {\n\tswitch (value) {\n\t\tcase 'lighter':\n\t\tcase 'normal': return 400;\n\t\tcase 'bolder':\n\t\tcase 'bold': return 700;\n\t}\n\treturn parseInt(value);\n}\n\nfunction parseCssOpacity(value: string): number {\n\tif (value.endsWith('%')) {\n\t\treturn parseFloat(value.substring(0, value.length - 1)) / 100;\n\t}\n\tif (value.match(/^\\d+(?:\\.\\d*)/)) {\n\t\treturn parseFloat(value);\n\t}\n\treturn 1;\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 { getActiveWindow } from '../../../../base/browser/dom.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { IViewLineTokens } from '../../../common/tokens/lineTokens.js';\nimport { ViewEventType, type ViewConfigurationChangedEvent, type ViewDecorationsChangedEvent, type ViewLineMappingChangedEvent, type ViewLinesChangedEvent, type ViewLinesDeletedEvent, type ViewLinesInsertedEvent, type ViewScrollChangedEvent, type ViewThemeChangedEvent, type ViewTokensChangedEvent, type ViewZonesChangedEvent } from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineRenderingData } from '../../../common/viewModel.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ViewLineOptions } from '../../viewParts/viewLines/viewLineOptions.js';\nimport { ITextureAtlasPageGlyph } from '../atlas/atlas.js';\nimport { createContentSegmenter, type IContentSegmenter } from '../contentSegmenter.js';\nimport { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js';\nimport { BindingId } from '../gpu.js';\nimport { GPULifecycle } from '../gpuDisposable.js';\nimport { quadVertices } from '../gpuUtils.js';\nimport { GlyphRasterizer } from '../raster/glyphRasterizer.js';\nimport { ViewGpuContext } from '../viewGpuContext.js';\nimport { BaseRenderStrategy } from './baseRenderStrategy.js';\nimport { InlineDecoration } from '../../../common/viewModel/inlineDecorations.js';\n\nconst enum Constants {\n\tIndicesPerCell = 6,\n}\n\nconst enum CellBufferInfo {\n\tFloatsPerEntry = 6,\n\tBytesPerEntry = CellBufferInfo.FloatsPerEntry * 4,\n\tOffset_X = 0,\n\tOffset_Y = 1,\n\tOffset_Unused1 = 2,\n\tOffset_Unused2 = 3,\n\tGlyphIndex = 4,\n\tTextureIndex = 5,\n}\n\ntype QueuedBufferEvent = (\n\tViewConfigurationChangedEvent |\n\tViewLineMappingChangedEvent |\n\tViewLinesDeletedEvent |\n\tViewZonesChangedEvent\n);\n\n/**\n * A render strategy that tracks a large buffer, uploading only dirty lines as they change and\n * leveraging heavy caching. This is the most performant strategy but has limitations around long\n * lines and too many lines.\n */\nexport class FullFileRenderStrategy extends BaseRenderStrategy {\n\n\t/**\n\t * The hard cap for line count that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedLines = 3000;\n\n\t/**\n\t * The hard cap for line columns that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedColumns = 200;\n\n\treadonly type = 'fullfile';\n\treadonly wgsl: string = fullFileRenderStrategyWgsl;\n\n\tprivate _cellBindBuffer!: GPUBuffer;\n\n\t/**\n\t * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that\n\t * the thread doesn't block when one is being uploaded to the GPU.\n\t */\n\tprivate _cellValueBuffers!: [ArrayBuffer, ArrayBuffer];\n\tprivate _activeDoubleBufferIndex: 0 | 1 = 0;\n\n\tprivate readonly _upToDateLines: [Set<number>, Set<number>] = [new Set(), new Set()];\n\tprivate _visibleObjectCount: number = 0;\n\tprivate _finalRenderedLine: number = 0;\n\n\tprivate _scrollOffsetBindBuffer: GPUBuffer;\n\tprivate _scrollOffsetValueBuffer: Float32Array;\n\tprivate _scrollInitialized: boolean = false;\n\n\tprivate readonly _queuedBufferUpdates: [QueuedBufferEvent[], QueuedBufferEvent[]] = [[], []];\n\n\tget bindGroupEntries(): GPUBindGroupEntry[] {\n\t\treturn [\n\t\t\t{ binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } },\n\t\t\t{ binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }\n\t\t];\n\t}\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewGpuContext: ViewGpuContext,\n\t\tdevice: GPUDevice,\n\t\tglyphRasterizer: { value: GlyphRasterizer },\n\t) {\n\t\tsuper(context, viewGpuContext, device, glyphRasterizer);\n\n\t\tconst bufferSize = FullFileRenderStrategy.maxSupportedLines * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT;\n\t\tthis._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco full file cell buffer',\n\t\t\tsize: bufferSize,\n\t\t\tusage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._cellValueBuffers = [\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t];\n\n\t\tconst scrollOffsetBufferSize = 2;\n\t\tthis._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco scroll offset buffer',\n\t\t\tsize: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT,\n\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize);\n\t}\n\n\t// #region Event handlers\n\n\t// The primary job of these handlers is to:\n\t// 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when\n\t// it's _within the viewport_.\n\t// 2. Pass relevant events on to the render function so it can force certain line ranges to be\n\t// re-rendered even if they're not in the viewport. For example when a view zone is added,\n\t// there are lines that used to be visible but are no longer, so those ranges must be\n\t// cleared and uploaded to the GPU.\n\n\tpublic override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: ViewDecorationsChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\treturn true;\n\t}\n\n\tpublic override onTokensChanged(e: ViewTokensChangedEvent): boolean {\n\t\t// TODO: This currently fires for the entire viewport whenever scrolling stops\n\t\t// https://github.com/microsoft/vscode/issues/233942\n\t\tfor (const range of e.ranges) {\n\t\t\tthis._invalidateLineRange(range.fromLineNumber, range.toLineNumber);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic override onLinesDeleted(e: ViewLinesDeletedEvent): boolean {\n\t\t// TODO: This currently invalidates everything after the deleted line, it could shift the\n\t\t// line data up to retain some up to date lines\n\t\t// TODO: This does not invalidate lines that are no longer in the file\n\t\tthis._invalidateLinesFrom(e.fromLineNumber);\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: ViewLinesInsertedEvent): boolean {\n\t\t// TODO: This currently invalidates everything after the deleted line, it could shift the\n\t\t// line data up to retain some up to date lines\n\t\tthis._invalidateLinesFrom(e.fromLineNumber);\n\t\treturn true;\n\t}\n\n\tpublic override onLinesChanged(e: ViewLinesChangedEvent): boolean {\n\t\tthis._invalidateLineRange(e.fromLineNumber, e.fromLineNumber + e.count);\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e?: ViewScrollChangedEvent): boolean {\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tthis._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;\n\t\tthis._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;\n\t\tthis._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer as Float32Array<ArrayBuffer>);\n\t\treturn true;\n\t}\n\n\tpublic override onThemeChanged(e: ViewThemeChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: ViewLineMappingChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onZonesChanged(e: ViewZonesChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\n\t\treturn true;\n\t}\n\n\t// #endregion\n\n\tprivate _invalidateAllLines(): void {\n\t\tthis._upToDateLines[0].clear();\n\t\tthis._upToDateLines[1].clear();\n\t}\n\n\tprivate _invalidateLinesFrom(lineNumber: number): void {\n\t\tfor (const i of [0, 1]) {\n\t\t\tconst upToDateLines = this._upToDateLines[i];\n\t\t\tfor (const upToDateLine of upToDateLines) {\n\t\t\t\tif (upToDateLine >= lineNumber) {\n\t\t\t\t\tupToDateLines.delete(upToDateLine);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _invalidateLineRange(fromLineNumber: number, toLineNumber: number): void {\n\t\tfor (let i = fromLineNumber; i <= toLineNumber; i++) {\n\t\t\tthis._upToDateLines[0].delete(i);\n\t\t\tthis._upToDateLines[1].delete(i);\n\t\t}\n\t}\n\n\treset() {\n\t\tthis._invalidateAllLines();\n\t\tfor (const bufferIndex of [0, 1]) {\n\t\t\t// Zero out buffer and upload to GPU to prevent stale rows from rendering\n\t\t\tconst buffer = new Float32Array(this._cellValueBuffers[bufferIndex]);\n\t\t\tbuffer.fill(0, 0, buffer.length);\n\t\t\tthis._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength);\n\t\t}\n\t\tthis._finalRenderedLine = 0;\n\t}\n\n\tupdate(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number {\n\t\t// IMPORTANT: This is a hot function. Variables are pre-allocated and shared within the\n\t\t// loop. This is done so we don't need to trust the JIT compiler to do this optimization to\n\t\t// avoid potential additional blocking time in garbage collector which is a common cause of\n\t\t// dropped frames.\n\n\t\tlet chars = '';\n\t\tlet segment: string | undefined;\n\t\tlet charWidth = 0;\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tlet absoluteOffsetX = 0;\n\t\tlet absoluteOffsetY = 0;\n\t\tlet tabXOffset = 0;\n\t\tlet glyph: Readonly<ITextureAtlasPageGlyph>;\n\t\tlet cellIndex = 0;\n\n\t\tlet tokenStartIndex = 0;\n\t\tlet tokenEndIndex = 0;\n\t\tlet tokenMetadata = 0;\n\n\t\tlet decorationStyleSetBold: boolean | undefined;\n\t\tlet decorationStyleSetColor: number | undefined;\n\t\tlet decorationStyleSetOpacity: number | undefined;\n\t\tlet decorationStyleSetStrikethrough: boolean | undefined;\n\t\tlet decorationStyleSetStrikethroughThickness: number | undefined;\n\t\tlet decorationStyleSetStrikethroughColor: number | undefined;\n\n\t\tlet lineData: ViewLineRenderingData;\n\t\tlet decoration: InlineDecoration;\n\t\tlet fillStartIndex = 0;\n\t\tlet fillEndIndex = 0;\n\n\t\tlet tokens: IViewLineTokens;\n\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tlet contentSegmenter: IContentSegmenter;\n\n\t\tif (!this._scrollInitialized) {\n\t\t\tthis.onScrollChanged();\n\t\t\tthis._scrollInitialized = true;\n\t\t}\n\n\t\t// Update cell data\n\t\tconst cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);\n\t\tconst lineIndexCount = FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\n\t\tconst upToDateLines = this._upToDateLines[this._activeDoubleBufferIndex];\n\t\tlet dirtyLineStart = 3000;\n\t\tlet dirtyLineEnd = 0;\n\n\t\t// Handle any queued buffer updates\n\t\tconst queuedBufferUpdates = this._queuedBufferUpdates[this._activeDoubleBufferIndex];\n\t\twhile (queuedBufferUpdates.length) {\n\t\t\tconst e = queuedBufferUpdates.shift()!;\n\t\t\tswitch (e.type) {\n\t\t\t\t// TODO: Refine these cases so we're not throwing away everything\n\t\t\t\tcase ViewEventType.ViewConfigurationChanged:\n\t\t\t\tcase ViewEventType.ViewLineMappingChanged:\n\t\t\t\tcase ViewEventType.ViewZonesChanged: {\n\t\t\t\t\tcellBuffer.fill(0);\n\n\t\t\t\t\tdirtyLineStart = 1;\n\t\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, this._finalRenderedLine);\n\t\t\t\t\tthis._finalRenderedLine = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase ViewEventType.ViewLinesDeleted: {\n\t\t\t\t\t// Shift content below deleted line up\n\t\t\t\t\tconst deletedLineContentStartIndex = (e.fromLineNumber - 1) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tconst deletedLineContentEndIndex = (e.toLineNumber) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tconst nullContentStartIndex = (this._finalRenderedLine - (e.toLineNumber - e.fromLineNumber + 1)) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer.set(cellBuffer.subarray(deletedLineContentEndIndex), deletedLineContentStartIndex);\n\n\t\t\t\t\t// Zero out content on lines that are no longer valid\n\t\t\t\t\tcellBuffer.fill(0, nullContentStartIndex);\n\n\t\t\t\t\t// Update dirty lines and final rendered line\n\t\t\t\t\tdirtyLineStart = Math.min(dirtyLineStart, e.fromLineNumber);\n\t\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, this._finalRenderedLine);\n\t\t\t\t\tthis._finalRenderedLine -= e.toLineNumber - e.fromLineNumber + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) {\n\n\t\t\t// Only attempt to render lines that the GPU renderer can handle\n\t\t\tif (!this._viewGpuContext.canRender(viewLineOptions, viewportData, y)) {\n\t\t\t\tfillStartIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\t\tfillEndIndex = (y * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\n\t\t\t\tdirtyLineStart = Math.min(dirtyLineStart, y);\n\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, y);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip updating the line if it's already up to date\n\t\t\tif (upToDateLines.has(y)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdirtyLineStart = Math.min(dirtyLineStart, y);\n\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, y);\n\n\t\t\tlineData = viewportData.getViewLineRenderingData(y);\n\t\t\ttabXOffset = 0;\n\n\t\t\tcontentSegmenter = createContentSegmenter(lineData, viewLineOptions);\n\t\t\tcharWidth = viewLineOptions.spaceWidth * dpr;\n\t\t\tabsoluteOffsetX = (lineData.minColumn - 1) * charWidth;\n\n\t\t\ttokens = lineData.tokens;\n\t\t\ttokenStartIndex = lineData.minColumn - 1;\n\t\t\ttokenEndIndex = 0;\n\t\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\t\ttokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\t\tif (tokenEndIndex <= tokenStartIndex) {\n\t\t\t\t\t// The faux indent part of the line should have no token type\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttokenMetadata = tokens.getMetadata(tokenIndex);\n\n\t\t\t\tfor (x = tokenStartIndex; x < tokenEndIndex; x++) {\n\t\t\t\t\t// Only render lines that do not exceed maximum columns\n\t\t\t\t\tif (x > FullFileRenderStrategy.maxSupportedColumns) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegment = contentSegmenter.getSegmentAtIndex(x);\n\t\t\t\t\tif (segment === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tchars = segment;\n\n\t\t\t\t\tif (!(lineData.isBasicASCII && viewLineOptions.useMonospaceOptimizations)) {\n\t\t\t\t\t\tcharWidth = this.glyphRasterizer.getTextMetrics(chars).width;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorationStyleSetColor = undefined;\n\t\t\t\t\tdecorationStyleSetBold = undefined;\n\t\t\t\t\tdecorationStyleSetOpacity = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethrough = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughThickness = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughColor = undefined;\n\n\t\t\t\t\t// Apply supported inline decoration styles to the cell metadata\n\t\t\t\t\tfor (decoration of lineData.inlineDecorations) {\n\t\t\t\t\t\t// This is Range.strictContainsPosition except it works at the cell level,\n\t\t\t\t\t\t// it's also inlined to avoid overhead.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(y < decoration.range.startLineNumber || y > decoration.range.endLineNumber) ||\n\t\t\t\t\t\t\t(y === decoration.range.startLineNumber && x < decoration.range.startColumn - 1) ||\n\t\t\t\t\t\t\t(y === decoration.range.endLineNumber && x >= decoration.range.endColumn - 1)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst rules = ViewGpuContext.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, decoration.inlineClassName);\n\t\t\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\t\t\tconst value = rule.styleMap.get(r)?.toString() ?? '';\n\t\t\t\t\t\t\t\tswitch (r) {\n\t\t\t\t\t\t\t\t\tcase 'color': {\n\t\t\t\t\t\t\t\t\t\t// TODO: This parsing and error handling should move into canRender so fallback\n\t\t\t\t\t\t\t\t\t\t// to DOM works\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(value);\n\t\t\t\t\t\t\t\t\t\tif (!parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new BugIndicatingError('Invalid color format ' + value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'font-weight': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssFontWeight(value);\n\t\t\t\t\t\t\t\t\t\tif (parsedValue >= 400) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = true;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set bold (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = false;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set normal (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'opacity': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssOpacity(value);\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetOpacity = parsedValue;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration':\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-line': {\n\t\t\t\t\t\t\t\t\t\tif (value === 'line-through') {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethrough = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-thickness': {\n\t\t\t\t\t\t\t\t\t\tconst match = value.match(/^(\\d+(?:\\.\\d+)?)px$/);\n\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughThickness = parseFloat(match[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-color': {\n\t\t\t\t\t\t\t\t\t\tlet colorValue = value;\n\t\t\t\t\t\t\t\t\t\tconst varMatch = value.match(/^var\\((--[^,]+),\\s*(?:initial|inherit)\\)$/);\n\t\t\t\t\t\t\t\t\t\tif (varMatch) {\n\t\t\t\t\t\t\t\t\t\t\tcolorValue = ViewGpuContext.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode, varMatch[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(colorValue);\n\t\t\t\t\t\t\t\t\t\tif (parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-style': {\n\t\t\t\t\t\t\t\t\t\t// These are validated in canRender and use default behavior\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new BugIndicatingError('Unexpected inline decoration style');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chars === ' ' || chars === '\\t') {\n\t\t\t\t\t\t// Zero out glyph to ensure it doesn't get rendered\n\t\t\t\t\t\tcellIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\t\tcellBuffer.fill(0, cellIndex, cellIndex + CellBufferInfo.FloatsPerEntry);\n\t\t\t\t\t\t// Adjust xOffset for tab stops\n\t\t\t\t\t\tif (chars === '\\t') {\n\t\t\t\t\t\t\t// Find the pixel offset between the current position and the next tab stop\n\t\t\t\t\t\t\tconst offsetBefore = x + tabXOffset;\n\t\t\t\t\t\t\ttabXOffset = CursorColumns.nextRenderTabStop(x + tabXOffset, lineData.tabSize);\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth * (tabXOffset - offsetBefore);\n\t\t\t\t\t\t\t// Convert back to offset excluding x and the current character\n\t\t\t\t\t\t\ttabXOffset -= x + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst decorationStyleSetId = ViewGpuContext.decorationStyleCache.getOrCreateEntry(decorationStyleSetColor, decorationStyleSetBold, decorationStyleSetOpacity, decorationStyleSetStrikethrough, decorationStyleSetStrikethroughThickness, decorationStyleSetStrikethroughColor);\n\t\t\t\t\tglyph = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, chars, tokenMetadata, decorationStyleSetId, absoluteOffsetX);\n\n\t\t\t\t\tabsoluteOffsetY = Math.round(\n\t\t\t\t\t\t// Top of layout box (includes line height)\n\t\t\t\t\t\tviewportData.relativeVerticalOffset[y - viewportData.startLineNumber] * dpr +\n\n\t\t\t\t\t\t// Delta from top of layout box (includes line height) to top of the inline box (no line height)\n\t\t\t\t\t\tMath.floor((viewportData.lineHeight * dpr - (glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent)) / 2) +\n\n\t\t\t\t\t\t// Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn\n\t\t\t\t\t\t// with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical\n\t\t\t\t\t\t// baseline.\n\t\t\t\t\t\tglyph.fontBoundingBoxAscent\n\t\t\t\t\t);\n\n\t\t\t\t\tcellIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_X] = Math.floor(absoluteOffsetX);\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_Y] = absoluteOffsetY;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex;\n\n\t\t\t\t\t// Adjust the x pixel offset for the next character\n\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t}\n\n\t\t\t\ttokenStartIndex = tokenEndIndex;\n\t\t\t}\n\n\t\t\t// Clear to end of line\n\t\t\tfillStartIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + tokenEndIndex) * Constants.IndicesPerCell;\n\t\t\tfillEndIndex = (y * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\n\t\t\tupToDateLines.add(y);\n\t\t}\n\n\t\tconst visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount;\n\n\t\t// Only write when there is changed data\n\t\tdirtyLineStart = Math.min(dirtyLineStart, FullFileRenderStrategy.maxSupportedLines);\n\t\tdirtyLineEnd = Math.min(dirtyLineEnd, FullFileRenderStrategy.maxSupportedLines);\n\t\tif (dirtyLineStart <= dirtyLineEnd) {\n\t\t\t// Write buffer and swap it out to unblock writes\n\t\t\tthis._device.queue.writeBuffer(\n\t\t\t\tthis._cellBindBuffer,\n\t\t\t\t(dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\tcellBuffer.buffer,\n\t\t\t\t(dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\t(dirtyLineEnd - dirtyLineStart + 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT\n\t\t\t);\n\t\t}\n\n\t\tthis._finalRenderedLine = Math.max(this._finalRenderedLine, dirtyLineEnd);\n\n\t\tthis._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1;\n\n\t\tthis._visibleObjectCount = visibleObjectCount;\n\n\t\treturn visibleObjectCount;\n\t}\n\n\tdraw(pass: GPURenderPassEncoder, viewportData: ViewportData): void {\n\t\tif (this._visibleObjectCount <= 0) {\n\t\t\tthrow new BugIndicatingError('Attempt to draw 0 objects');\n\t\t}\n\t\tpass.draw(\n\t\t\tquadVertices.length / 2,\n\t\t\tthis._visibleObjectCount,\n\t\t\tundefined,\n\t\t\t(viewportData.startLineNumber - 1) * FullFileRenderStrategy.maxSupportedColumns\n\t\t);\n\t}\n\n\t/**\n\t * Queue updates that need to happen on the active buffer, not just the cache. This will be\n\t * deferred to when the actual cell buffer is changed since the active buffer could be locked by\n\t * the GPU which would block the main thread.\n\t */\n\tprivate _queueBufferUpdate(e: QueuedBufferEvent) {\n\t\tthis._queuedBufferUpdates[0].push(e);\n\t\tthis._queuedBufferUpdates[1].push(e);\n\t}\n}\n\nfunction parseCssFontWeight(value: string) {\n\tswitch (value) {\n\t\tcase 'lighter':\n\t\tcase 'normal': return 400;\n\t\tcase 'bolder':\n\t\tcase 'bold': return 700;\n\t}\n\treturn parseInt(value);\n}\n\nfunction parseCssOpacity(value: string): number {\n\tif (value.endsWith('%')) {\n\t\treturn parseFloat(value.substring(0, value.length - 1)) / 100;\n\t}\n\tif (value.match(/^\\d+(?:\\.\\d*)/)) {\n\t\treturn parseFloat(value);\n\t}\n\treturn 1;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/gpu/renderStrategy/fullFileRenderStrategy.ts","vs/editor/browser/gpu/renderStrategy/fullFileRenderStrategy.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAQtE,OAAO,EAAE,sBAAsB,EAA0B,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAyB7D;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAE7D;;OAEG;aACa,sBAAiB,GAAG,IAAH,AAAO,CAAC;IAEzC;;OAEG;aACa,wBAAmB,GAAG,GAAH,AAAM,CAAC;IAwB1C,IAAI,gBAAgB;QACnB,OAAO;YACN,EAAE,OAAO,yBAAiB,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE;YACxE,EAAE,OAAO,gCAAwB,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,EAAE;SACvF,CAAC;IACH,CAAC;IAED,YACC,OAAoB,EACpB,cAA8B,EAC9B,MAAiB,EACjB,eAA2C;QAE3C,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,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ACxB,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACrC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAC/D,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;QAClC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC","file":"fullFileRenderStrategy.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 { getActiveWindow } from '../../../../base/browser/dom.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { IViewLineTokens } from '../../../common/tokens/lineTokens.js';\nimport { ViewEventType, type ViewConfigurationChangedEvent, type ViewDecorationsChangedEvent, type ViewLineMappingChangedEvent, type ViewLinesChangedEvent, type ViewLinesDeletedEvent, type ViewLinesInsertedEvent, type ViewScrollChangedEvent, type ViewThemeChangedEvent, type ViewTokensChangedEvent, type ViewZonesChangedEvent } from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineRenderingData } from '../../../common/viewModel.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ViewLineOptions } from '../../viewParts/viewLines/viewLineOptions.js';\nimport { ITextureAtlasPageGlyph } from '../atlas/atlas.js';\nimport { createContentSegmenter, type IContentSegmenter } from '../contentSegmenter.js';\nimport { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js';\nimport { BindingId } from '../gpu.js';\nimport { GPULifecycle } from '../gpuDisposable.js';\nimport { quadVertices } from '../gpuUtils.js';\nimport { GlyphRasterizer } from '../raster/glyphRasterizer.js';\nimport { ViewGpuContext } from '../viewGpuContext.js';\nimport { BaseRenderStrategy } from './baseRenderStrategy.js';\nimport { InlineDecoration } from '../../../common/viewModel/inlineDecorations.js';\n\nconst enum Constants {\n\tIndicesPerCell = 6,\n}\n\nconst enum CellBufferInfo {\n\tFloatsPerEntry = 6,\n\tBytesPerEntry = CellBufferInfo.FloatsPerEntry * 4,\n\tOffset_X = 0,\n\tOffset_Y = 1,\n\tOffset_Unused1 = 2,\n\tOffset_Unused2 = 3,\n\tGlyphIndex = 4,\n\tTextureIndex = 5,\n}\n\ntype QueuedBufferEvent = (\n\tViewConfigurationChangedEvent |\n\tViewLineMappingChangedEvent |\n\tViewLinesDeletedEvent |\n\tViewZonesChangedEvent\n);\n\n/**\n * A render strategy that tracks a large buffer, uploading only dirty lines as they change and\n * leveraging heavy caching. This is the most performant strategy but has limitations around long\n * lines and too many lines.\n */\nexport class FullFileRenderStrategy extends BaseRenderStrategy {\n\n\t/**\n\t * The hard cap for line count that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedLines = 3000;\n\n\t/**\n\t * The hard cap for line columns that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedColumns = 200;\n\n\treadonly type = 'fullfile';\n\treadonly wgsl: string = fullFileRenderStrategyWgsl;\n\n\tprivate _cellBindBuffer!: GPUBuffer;\n\n\t/**\n\t * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that\n\t * the thread doesn't block when one is being uploaded to the GPU.\n\t */\n\tprivate _cellValueBuffers!: [ArrayBuffer, ArrayBuffer];\n\tprivate _activeDoubleBufferIndex: 0 | 1 = 0;\n\n\tprivate readonly _upToDateLines: [Set<number>, Set<number>] = [new Set(), new Set()];\n\tprivate _visibleObjectCount: number = 0;\n\tprivate _finalRenderedLine: number = 0;\n\n\tprivate _scrollOffsetBindBuffer: GPUBuffer;\n\tprivate _scrollOffsetValueBuffer: Float32Array;\n\tprivate _scrollInitialized: boolean = false;\n\n\tprivate readonly _queuedBufferUpdates: [QueuedBufferEvent[], QueuedBufferEvent[]] = [[], []];\n\n\tget bindGroupEntries(): GPUBindGroupEntry[] {\n\t\treturn [\n\t\t\t{ binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } },\n\t\t\t{ binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }\n\t\t];\n\t}\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewGpuContext: ViewGpuContext,\n\t\tdevice: GPUDevice,\n\t\tglyphRasterizer: { value: GlyphRasterizer },\n\t) {\n\t\tsuper(context, viewGpuContext, device, glyphRasterizer);\n\n\t\tconst bufferSize = FullFileRenderStrategy.maxSupportedLines * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT;\n\t\tthis._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco full file cell buffer',\n\t\t\tsize: bufferSize,\n\t\t\tusage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._cellValueBuffers = [\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t];\n\n\t\tconst scrollOffsetBufferSize = 2;\n\t\tthis._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco scroll offset buffer',\n\t\t\tsize: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT,\n\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize);\n\t}\n\n\t// #region Event handlers\n\n\t// The primary job of these handlers is to:\n\t// 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when\n\t// it's _within the viewport_.\n\t// 2. Pass relevant events on to the render function so it can force certain line ranges to be\n\t// re-rendered even if they're not in the viewport. For example when a view zone is added,\n\t// there are lines that used to be visible but are no longer, so those ranges must be\n\t// cleared and uploaded to the GPU.\n\n\tpublic override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: ViewDecorationsChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\treturn true;\n\t}\n\n\tpublic override onTokensChanged(e: ViewTokensChangedEvent): boolean {\n\t\t// TODO: This currently fires for the entire viewport whenever scrolling stops\n\t\t// https://github.com/microsoft/vscode/issues/233942\n\t\tfor (const range of e.ranges) {\n\t\t\tthis._invalidateLineRange(range.fromLineNumber, range.toLineNumber);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic override onLinesDeleted(e: ViewLinesDeletedEvent): boolean {\n\t\t// TODO: This currently invalidates everything after the deleted line, it could shift the\n\t\t// line data up to retain some up to date lines\n\t\t// TODO: This does not invalidate lines that are no longer in the file\n\t\tthis._invalidateLinesFrom(e.fromLineNumber);\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: ViewLinesInsertedEvent): boolean {\n\t\t// TODO: This currently invalidates everything after the deleted line, it could shift the\n\t\t// line data up to retain some up to date lines\n\t\tthis._invalidateLinesFrom(e.fromLineNumber);\n\t\treturn true;\n\t}\n\n\tpublic override onLinesChanged(e: ViewLinesChangedEvent): boolean {\n\t\tthis._invalidateLineRange(e.fromLineNumber, e.fromLineNumber + e.count);\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e?: ViewScrollChangedEvent): boolean {\n\t\tif (this._store.isDisposed) {\n\t\t\treturn false;\n\t\t}\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tthis._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;\n\t\tthis._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;\n\t\tthis._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer as Float32Array<ArrayBuffer>);\n\t\treturn true;\n\t}\n\n\tpublic override onThemeChanged(e: ViewThemeChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: ViewLineMappingChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onZonesChanged(e: ViewZonesChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\n\t\treturn true;\n\t}\n\n\t// #endregion\n\n\tprivate _invalidateAllLines(): void {\n\t\tthis._upToDateLines[0].clear();\n\t\tthis._upToDateLines[1].clear();\n\t}\n\n\tprivate _invalidateLinesFrom(lineNumber: number): void {\n\t\tfor (const i of [0, 1]) {\n\t\t\tconst upToDateLines = this._upToDateLines[i];\n\t\t\tfor (const upToDateLine of upToDateLines) {\n\t\t\t\tif (upToDateLine >= lineNumber) {\n\t\t\t\t\tupToDateLines.delete(upToDateLine);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _invalidateLineRange(fromLineNumber: number, toLineNumber: number): void {\n\t\tfor (let i = fromLineNumber; i <= toLineNumber; i++) {\n\t\t\tthis._upToDateLines[0].delete(i);\n\t\t\tthis._upToDateLines[1].delete(i);\n\t\t}\n\t}\n\n\treset() {\n\t\tthis._invalidateAllLines();\n\t\tfor (const bufferIndex of [0, 1]) {\n\t\t\t// Zero out buffer and upload to GPU to prevent stale rows from rendering\n\t\t\tconst buffer = new Float32Array(this._cellValueBuffers[bufferIndex]);\n\t\t\tbuffer.fill(0, 0, buffer.length);\n\t\t\tthis._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength);\n\t\t}\n\t\tthis._finalRenderedLine = 0;\n\t}\n\n\tupdate(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number {\n\t\t// IMPORTANT: This is a hot function. Variables are pre-allocated and shared within the\n\t\t// loop. This is done so we don't need to trust the JIT compiler to do this optimization to\n\t\t// avoid potential additional blocking time in garbage collector which is a common cause of\n\t\t// dropped frames.\n\n\t\tlet chars = '';\n\t\tlet segment: string | undefined;\n\t\tlet charWidth = 0;\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tlet absoluteOffsetX = 0;\n\t\tlet absoluteOffsetY = 0;\n\t\tlet tabXOffset = 0;\n\t\tlet glyph: Readonly<ITextureAtlasPageGlyph>;\n\t\tlet cellIndex = 0;\n\n\t\tlet tokenStartIndex = 0;\n\t\tlet tokenEndIndex = 0;\n\t\tlet tokenMetadata = 0;\n\n\t\tlet decorationStyleSetBold: boolean | undefined;\n\t\tlet decorationStyleSetColor: number | undefined;\n\t\tlet decorationStyleSetOpacity: number | undefined;\n\t\tlet decorationStyleSetStrikethrough: boolean | undefined;\n\t\tlet decorationStyleSetStrikethroughThickness: number | undefined;\n\t\tlet decorationStyleSetStrikethroughColor: number | undefined;\n\n\t\tlet lineData: ViewLineRenderingData;\n\t\tlet decoration: InlineDecoration;\n\t\tlet fillStartIndex = 0;\n\t\tlet fillEndIndex = 0;\n\n\t\tlet tokens: IViewLineTokens;\n\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tlet contentSegmenter: IContentSegmenter;\n\n\t\tif (!this._scrollInitialized) {\n\t\t\tthis.onScrollChanged();\n\t\t\tthis._scrollInitialized = true;\n\t\t}\n\n\t\t// Update cell data\n\t\tconst cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);\n\t\tconst lineIndexCount = FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\n\t\tconst upToDateLines = this._upToDateLines[this._activeDoubleBufferIndex];\n\t\tlet dirtyLineStart = 3000;\n\t\tlet dirtyLineEnd = 0;\n\n\t\t// Handle any queued buffer updates\n\t\tconst queuedBufferUpdates = this._queuedBufferUpdates[this._activeDoubleBufferIndex];\n\t\twhile (queuedBufferUpdates.length) {\n\t\t\tconst e = queuedBufferUpdates.shift()!;\n\t\t\tswitch (e.type) {\n\t\t\t\t// TODO: Refine these cases so we're not throwing away everything\n\t\t\t\tcase ViewEventType.ViewConfigurationChanged:\n\t\t\t\tcase ViewEventType.ViewLineMappingChanged:\n\t\t\t\tcase ViewEventType.ViewZonesChanged: {\n\t\t\t\t\tcellBuffer.fill(0);\n\n\t\t\t\t\tdirtyLineStart = 1;\n\t\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, this._finalRenderedLine);\n\t\t\t\t\tthis._finalRenderedLine = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase ViewEventType.ViewLinesDeleted: {\n\t\t\t\t\t// Shift content below deleted line up\n\t\t\t\t\tconst deletedLineContentStartIndex = (e.fromLineNumber - 1) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tconst deletedLineContentEndIndex = (e.toLineNumber) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tconst nullContentStartIndex = (this._finalRenderedLine - (e.toLineNumber - e.fromLineNumber + 1)) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer.set(cellBuffer.subarray(deletedLineContentEndIndex), deletedLineContentStartIndex);\n\n\t\t\t\t\t// Zero out content on lines that are no longer valid\n\t\t\t\t\tcellBuffer.fill(0, nullContentStartIndex);\n\n\t\t\t\t\t// Update dirty lines and final rendered line\n\t\t\t\t\tdirtyLineStart = Math.min(dirtyLineStart, e.fromLineNumber);\n\t\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, this._finalRenderedLine);\n\t\t\t\t\tthis._finalRenderedLine -= e.toLineNumber - e.fromLineNumber + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) {\n\n\t\t\t// Only attempt to render lines that the GPU renderer can handle\n\t\t\tif (!this._viewGpuContext.canRender(viewLineOptions, viewportData, y)) {\n\t\t\t\tfillStartIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\t\tfillEndIndex = (y * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\n\t\t\t\tdirtyLineStart = Math.min(dirtyLineStart, y);\n\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, y);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip updating the line if it's already up to date\n\t\t\tif (upToDateLines.has(y)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdirtyLineStart = Math.min(dirtyLineStart, y);\n\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, y);\n\n\t\t\tlineData = viewportData.getViewLineRenderingData(y);\n\t\t\ttabXOffset = 0;\n\n\t\t\tcontentSegmenter = createContentSegmenter(lineData, viewLineOptions);\n\t\t\tcharWidth = viewLineOptions.spaceWidth * dpr;\n\t\t\tabsoluteOffsetX = (lineData.minColumn - 1) * charWidth;\n\n\t\t\ttokens = lineData.tokens;\n\t\t\ttokenStartIndex = lineData.minColumn - 1;\n\t\t\ttokenEndIndex = 0;\n\t\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\t\ttokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\t\tif (tokenEndIndex <= tokenStartIndex) {\n\t\t\t\t\t// The faux indent part of the line should have no token type\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttokenMetadata = tokens.getMetadata(tokenIndex);\n\n\t\t\t\tfor (x = tokenStartIndex; x < tokenEndIndex; x++) {\n\t\t\t\t\t// Only render lines that do not exceed maximum columns\n\t\t\t\t\tif (x > FullFileRenderStrategy.maxSupportedColumns) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegment = contentSegmenter.getSegmentAtIndex(x);\n\t\t\t\t\tif (segment === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tchars = segment;\n\n\t\t\t\t\tif (!(lineData.isBasicASCII && viewLineOptions.useMonospaceOptimizations)) {\n\t\t\t\t\t\tcharWidth = this.glyphRasterizer.getTextMetrics(chars).width;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorationStyleSetColor = undefined;\n\t\t\t\t\tdecorationStyleSetBold = undefined;\n\t\t\t\t\tdecorationStyleSetOpacity = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethrough = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughThickness = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughColor = undefined;\n\n\t\t\t\t\t// Apply supported inline decoration styles to the cell metadata\n\t\t\t\t\tfor (decoration of lineData.inlineDecorations) {\n\t\t\t\t\t\t// This is Range.strictContainsPosition except it works at the cell level,\n\t\t\t\t\t\t// it's also inlined to avoid overhead.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(y < decoration.range.startLineNumber || y > decoration.range.endLineNumber) ||\n\t\t\t\t\t\t\t(y === decoration.range.startLineNumber && x < decoration.range.startColumn - 1) ||\n\t\t\t\t\t\t\t(y === decoration.range.endLineNumber && x >= decoration.range.endColumn - 1)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst rules = ViewGpuContext.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, decoration.inlineClassName);\n\t\t\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\t\t\tconst value = rule.styleMap.get(r)?.toString() ?? '';\n\t\t\t\t\t\t\t\tswitch (r) {\n\t\t\t\t\t\t\t\t\tcase 'color': {\n\t\t\t\t\t\t\t\t\t\t// TODO: This parsing and error handling should move into canRender so fallback\n\t\t\t\t\t\t\t\t\t\t// to DOM works\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(value);\n\t\t\t\t\t\t\t\t\t\tif (!parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new BugIndicatingError('Invalid color format ' + value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'font-weight': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssFontWeight(value);\n\t\t\t\t\t\t\t\t\t\tif (parsedValue >= 400) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = true;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set bold (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = false;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set normal (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'opacity': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssOpacity(value);\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetOpacity = parsedValue;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration':\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-line': {\n\t\t\t\t\t\t\t\t\t\tif (value === 'line-through') {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethrough = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-thickness': {\n\t\t\t\t\t\t\t\t\t\tconst match = value.match(/^(\\d+(?:\\.\\d+)?)px$/);\n\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughThickness = parseFloat(match[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-color': {\n\t\t\t\t\t\t\t\t\t\tlet colorValue = value;\n\t\t\t\t\t\t\t\t\t\tconst varMatch = value.match(/^var\\((--[^,]+),\\s*(?:initial|inherit)\\)$/);\n\t\t\t\t\t\t\t\t\t\tif (varMatch) {\n\t\t\t\t\t\t\t\t\t\t\tcolorValue = ViewGpuContext.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode, varMatch[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(colorValue);\n\t\t\t\t\t\t\t\t\t\tif (parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-style': {\n\t\t\t\t\t\t\t\t\t\t// These are validated in canRender and use default behavior\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new BugIndicatingError('Unexpected inline decoration style');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chars === ' ' || chars === '\\t') {\n\t\t\t\t\t\t// Zero out glyph to ensure it doesn't get rendered\n\t\t\t\t\t\tcellIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\t\tcellBuffer.fill(0, cellIndex, cellIndex + CellBufferInfo.FloatsPerEntry);\n\t\t\t\t\t\t// Adjust xOffset for tab stops\n\t\t\t\t\t\tif (chars === '\\t') {\n\t\t\t\t\t\t\t// Find the pixel offset between the current position and the next tab stop\n\t\t\t\t\t\t\tconst offsetBefore = x + tabXOffset;\n\t\t\t\t\t\t\ttabXOffset = CursorColumns.nextRenderTabStop(x + tabXOffset, lineData.tabSize);\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth * (tabXOffset - offsetBefore);\n\t\t\t\t\t\t\t// Convert back to offset excluding x and the current character\n\t\t\t\t\t\t\ttabXOffset -= x + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst decorationStyleSetId = ViewGpuContext.decorationStyleCache.getOrCreateEntry(decorationStyleSetColor, decorationStyleSetBold, decorationStyleSetOpacity, decorationStyleSetStrikethrough, decorationStyleSetStrikethroughThickness, decorationStyleSetStrikethroughColor);\n\t\t\t\t\tglyph = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, chars, tokenMetadata, decorationStyleSetId, absoluteOffsetX);\n\n\t\t\t\t\tabsoluteOffsetY = Math.round(\n\t\t\t\t\t\t// Top of layout box (includes line height)\n\t\t\t\t\t\tviewportData.relativeVerticalOffset[y - viewportData.startLineNumber] * dpr +\n\n\t\t\t\t\t\t// Delta from top of layout box (includes line height) to top of the inline box (no line height)\n\t\t\t\t\t\tMath.floor((viewportData.lineHeight * dpr - (glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent)) / 2) +\n\n\t\t\t\t\t\t// Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn\n\t\t\t\t\t\t// with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical\n\t\t\t\t\t\t// baseline.\n\t\t\t\t\t\tglyph.fontBoundingBoxAscent\n\t\t\t\t\t);\n\n\t\t\t\t\tcellIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_X] = Math.floor(absoluteOffsetX);\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_Y] = absoluteOffsetY;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex;\n\n\t\t\t\t\t// Adjust the x pixel offset for the next character\n\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t}\n\n\t\t\t\ttokenStartIndex = tokenEndIndex;\n\t\t\t}\n\n\t\t\t// Clear to end of line\n\t\t\tfillStartIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + tokenEndIndex) * Constants.IndicesPerCell;\n\t\t\tfillEndIndex = (y * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\n\t\t\tupToDateLines.add(y);\n\t\t}\n\n\t\tconst visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount;\n\n\t\t// Only write when there is changed data\n\t\tdirtyLineStart = Math.min(dirtyLineStart, FullFileRenderStrategy.maxSupportedLines);\n\t\tdirtyLineEnd = Math.min(dirtyLineEnd, FullFileRenderStrategy.maxSupportedLines);\n\t\tif (dirtyLineStart <= dirtyLineEnd) {\n\t\t\t// Write buffer and swap it out to unblock writes\n\t\t\tthis._device.queue.writeBuffer(\n\t\t\t\tthis._cellBindBuffer,\n\t\t\t\t(dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\tcellBuffer.buffer,\n\t\t\t\t(dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\t(dirtyLineEnd - dirtyLineStart + 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT\n\t\t\t);\n\t\t}\n\n\t\tthis._finalRenderedLine = Math.max(this._finalRenderedLine, dirtyLineEnd);\n\n\t\tthis._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1;\n\n\t\tthis._visibleObjectCount = visibleObjectCount;\n\n\t\treturn visibleObjectCount;\n\t}\n\n\tdraw(pass: GPURenderPassEncoder, viewportData: ViewportData): void {\n\t\tif (this._visibleObjectCount <= 0) {\n\t\t\tthrow new BugIndicatingError('Attempt to draw 0 objects');\n\t\t}\n\t\tpass.draw(\n\t\t\tquadVertices.length / 2,\n\t\t\tthis._visibleObjectCount,\n\t\t\tundefined,\n\t\t\t(viewportData.startLineNumber - 1) * FullFileRenderStrategy.maxSupportedColumns\n\t\t);\n\t}\n\n\t/**\n\t * Queue updates that need to happen on the active buffer, not just the cache. This will be\n\t * deferred to when the actual cell buffer is changed since the active buffer could be locked by\n\t * the GPU which would block the main thread.\n\t */\n\tprivate _queueBufferUpdate(e: QueuedBufferEvent) {\n\t\tthis._queuedBufferUpdates[0].push(e);\n\t\tthis._queuedBufferUpdates[1].push(e);\n\t}\n}\n\nfunction parseCssFontWeight(value: string) {\n\tswitch (value) {\n\t\tcase 'lighter':\n\t\tcase 'normal': return 400;\n\t\tcase 'bolder':\n\t\tcase 'bold': return 700;\n\t}\n\treturn parseInt(value);\n}\n\nfunction parseCssOpacity(value: string): number {\n\tif (value.endsWith('%')) {\n\t\treturn parseFloat(value.substring(0, value.length - 1)) / 100;\n\t}\n\tif (value.match(/^\\d+(?:\\.\\d*)/)) {\n\t\treturn parseFloat(value);\n\t}\n\treturn 1;\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 { getActiveWindow } from '../../../../base/browser/dom.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { IViewLineTokens } from '../../../common/tokens/lineTokens.js';\nimport { ViewEventType, type ViewConfigurationChangedEvent, type ViewDecorationsChangedEvent, type ViewLineMappingChangedEvent, type ViewLinesChangedEvent, type ViewLinesDeletedEvent, type ViewLinesInsertedEvent, type ViewScrollChangedEvent, type ViewThemeChangedEvent, type ViewTokensChangedEvent, type ViewZonesChangedEvent } from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineRenderingData } from '../../../common/viewModel.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ViewLineOptions } from '../../viewParts/viewLines/viewLineOptions.js';\nimport { ITextureAtlasPageGlyph } from '../atlas/atlas.js';\nimport { createContentSegmenter, type IContentSegmenter } from '../contentSegmenter.js';\nimport { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js';\nimport { BindingId } from '../gpu.js';\nimport { GPULifecycle } from '../gpuDisposable.js';\nimport { quadVertices } from '../gpuUtils.js';\nimport { GlyphRasterizer } from '../raster/glyphRasterizer.js';\nimport { ViewGpuContext } from '../viewGpuContext.js';\nimport { BaseRenderStrategy } from './baseRenderStrategy.js';\nimport { InlineDecoration } from '../../../common/viewModel/inlineDecorations.js';\n\nconst enum Constants {\n\tIndicesPerCell = 6,\n}\n\nconst enum CellBufferInfo {\n\tFloatsPerEntry = 6,\n\tBytesPerEntry = CellBufferInfo.FloatsPerEntry * 4,\n\tOffset_X = 0,\n\tOffset_Y = 1,\n\tOffset_Unused1 = 2,\n\tOffset_Unused2 = 3,\n\tGlyphIndex = 4,\n\tTextureIndex = 5,\n}\n\ntype QueuedBufferEvent = (\n\tViewConfigurationChangedEvent |\n\tViewLineMappingChangedEvent |\n\tViewLinesDeletedEvent |\n\tViewZonesChangedEvent\n);\n\n/**\n * A render strategy that tracks a large buffer, uploading only dirty lines as they change and\n * leveraging heavy caching. This is the most performant strategy but has limitations around long\n * lines and too many lines.\n */\nexport class FullFileRenderStrategy extends BaseRenderStrategy {\n\n\t/**\n\t * The hard cap for line count that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedLines = 3000;\n\n\t/**\n\t * The hard cap for line columns that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedColumns = 200;\n\n\treadonly type = 'fullfile';\n\treadonly wgsl: string = fullFileRenderStrategyWgsl;\n\n\tprivate _cellBindBuffer!: GPUBuffer;\n\n\t/**\n\t * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that\n\t * the thread doesn't block when one is being uploaded to the GPU.\n\t */\n\tprivate _cellValueBuffers!: [ArrayBuffer, ArrayBuffer];\n\tprivate _activeDoubleBufferIndex: 0 | 1 = 0;\n\n\tprivate readonly _upToDateLines: [Set<number>, Set<number>] = [new Set(), new Set()];\n\tprivate _visibleObjectCount: number = 0;\n\tprivate _finalRenderedLine: number = 0;\n\n\tprivate _scrollOffsetBindBuffer: GPUBuffer;\n\tprivate _scrollOffsetValueBuffer: Float32Array;\n\tprivate _scrollInitialized: boolean = false;\n\n\tprivate readonly _queuedBufferUpdates: [QueuedBufferEvent[], QueuedBufferEvent[]] = [[], []];\n\n\tget bindGroupEntries(): GPUBindGroupEntry[] {\n\t\treturn [\n\t\t\t{ binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } },\n\t\t\t{ binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }\n\t\t];\n\t}\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewGpuContext: ViewGpuContext,\n\t\tdevice: GPUDevice,\n\t\tglyphRasterizer: { value: GlyphRasterizer },\n\t) {\n\t\tsuper(context, viewGpuContext, device, glyphRasterizer);\n\n\t\tconst bufferSize = FullFileRenderStrategy.maxSupportedLines * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT;\n\t\tthis._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco full file cell buffer',\n\t\t\tsize: bufferSize,\n\t\t\tusage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._cellValueBuffers = [\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t];\n\n\t\tconst scrollOffsetBufferSize = 2;\n\t\tthis._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco scroll offset buffer',\n\t\t\tsize: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT,\n\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize);\n\t}\n\n\t// #region Event handlers\n\n\t// The primary job of these handlers is to:\n\t// 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when\n\t// it's _within the viewport_.\n\t// 2. Pass relevant events on to the render function so it can force certain line ranges to be\n\t// re-rendered even if they're not in the viewport. For example when a view zone is added,\n\t// there are lines that used to be visible but are no longer, so those ranges must be\n\t// cleared and uploaded to the GPU.\n\n\tpublic override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: ViewDecorationsChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\treturn true;\n\t}\n\n\tpublic override onTokensChanged(e: ViewTokensChangedEvent): boolean {\n\t\t// TODO: This currently fires for the entire viewport whenever scrolling stops\n\t\t// https://github.com/microsoft/vscode/issues/233942\n\t\tfor (const range of e.ranges) {\n\t\t\tthis._invalidateLineRange(range.fromLineNumber, range.toLineNumber);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic override onLinesDeleted(e: ViewLinesDeletedEvent): boolean {\n\t\t// TODO: This currently invalidates everything after the deleted line, it could shift the\n\t\t// line data up to retain some up to date lines\n\t\t// TODO: This does not invalidate lines that are no longer in the file\n\t\tthis._invalidateLinesFrom(e.fromLineNumber);\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: ViewLinesInsertedEvent): boolean {\n\t\t// TODO: This currently invalidates everything after the deleted line, it could shift the\n\t\t// line data up to retain some up to date lines\n\t\tthis._invalidateLinesFrom(e.fromLineNumber);\n\t\treturn true;\n\t}\n\n\tpublic override onLinesChanged(e: ViewLinesChangedEvent): boolean {\n\t\tthis._invalidateLineRange(e.fromLineNumber, e.fromLineNumber + e.count);\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e?: ViewScrollChangedEvent): boolean {\n\t\tif (this._store.isDisposed) {\n\t\t\treturn false;\n\t\t}\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tthis._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;\n\t\tthis._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;\n\t\tthis._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer as Float32Array<ArrayBuffer>);\n\t\treturn true;\n\t}\n\n\tpublic override onThemeChanged(e: ViewThemeChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: ViewLineMappingChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\t\treturn true;\n\t}\n\n\tpublic override onZonesChanged(e: ViewZonesChangedEvent): boolean {\n\t\tthis._invalidateAllLines();\n\t\tthis._queueBufferUpdate(e);\n\n\t\treturn true;\n\t}\n\n\t// #endregion\n\n\tprivate _invalidateAllLines(): void {\n\t\tthis._upToDateLines[0].clear();\n\t\tthis._upToDateLines[1].clear();\n\t}\n\n\tprivate _invalidateLinesFrom(lineNumber: number): void {\n\t\tfor (const i of [0, 1]) {\n\t\t\tconst upToDateLines = this._upToDateLines[i];\n\t\t\tfor (const upToDateLine of upToDateLines) {\n\t\t\t\tif (upToDateLine >= lineNumber) {\n\t\t\t\t\tupToDateLines.delete(upToDateLine);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _invalidateLineRange(fromLineNumber: number, toLineNumber: number): void {\n\t\tfor (let i = fromLineNumber; i <= toLineNumber; i++) {\n\t\t\tthis._upToDateLines[0].delete(i);\n\t\t\tthis._upToDateLines[1].delete(i);\n\t\t}\n\t}\n\n\treset() {\n\t\tthis._invalidateAllLines();\n\t\tfor (const bufferIndex of [0, 1]) {\n\t\t\t// Zero out buffer and upload to GPU to prevent stale rows from rendering\n\t\t\tconst buffer = new Float32Array(this._cellValueBuffers[bufferIndex]);\n\t\t\tbuffer.fill(0, 0, buffer.length);\n\t\t\tthis._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength);\n\t\t}\n\t\tthis._finalRenderedLine = 0;\n\t}\n\n\tupdate(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number {\n\t\t// IMPORTANT: This is a hot function. Variables are pre-allocated and shared within the\n\t\t// loop. This is done so we don't need to trust the JIT compiler to do this optimization to\n\t\t// avoid potential additional blocking time in garbage collector which is a common cause of\n\t\t// dropped frames.\n\n\t\tlet chars = '';\n\t\tlet segment: string | undefined;\n\t\tlet charWidth = 0;\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tlet absoluteOffsetX = 0;\n\t\tlet absoluteOffsetY = 0;\n\t\tlet tabXOffset = 0;\n\t\tlet glyph: Readonly<ITextureAtlasPageGlyph>;\n\t\tlet cellIndex = 0;\n\n\t\tlet tokenStartIndex = 0;\n\t\tlet tokenEndIndex = 0;\n\t\tlet tokenMetadata = 0;\n\n\t\tlet decorationStyleSetBold: boolean | undefined;\n\t\tlet decorationStyleSetColor: number | undefined;\n\t\tlet decorationStyleSetOpacity: number | undefined;\n\t\tlet decorationStyleSetStrikethrough: boolean | undefined;\n\t\tlet decorationStyleSetStrikethroughThickness: number | undefined;\n\t\tlet decorationStyleSetStrikethroughColor: number | undefined;\n\n\t\tlet lineData: ViewLineRenderingData;\n\t\tlet decoration: InlineDecoration;\n\t\tlet fillStartIndex = 0;\n\t\tlet fillEndIndex = 0;\n\n\t\tlet tokens: IViewLineTokens;\n\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tlet contentSegmenter: IContentSegmenter;\n\n\t\tif (!this._scrollInitialized) {\n\t\t\tthis.onScrollChanged();\n\t\t\tthis._scrollInitialized = true;\n\t\t}\n\n\t\t// Update cell data\n\t\tconst cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);\n\t\tconst lineIndexCount = FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\n\t\tconst upToDateLines = this._upToDateLines[this._activeDoubleBufferIndex];\n\t\tlet dirtyLineStart = 3000;\n\t\tlet dirtyLineEnd = 0;\n\n\t\t// Handle any queued buffer updates\n\t\tconst queuedBufferUpdates = this._queuedBufferUpdates[this._activeDoubleBufferIndex];\n\t\twhile (queuedBufferUpdates.length) {\n\t\t\tconst e = queuedBufferUpdates.shift()!;\n\t\t\tswitch (e.type) {\n\t\t\t\t// TODO: Refine these cases so we're not throwing away everything\n\t\t\t\tcase ViewEventType.ViewConfigurationChanged:\n\t\t\t\tcase ViewEventType.ViewLineMappingChanged:\n\t\t\t\tcase ViewEventType.ViewZonesChanged: {\n\t\t\t\t\tcellBuffer.fill(0);\n\n\t\t\t\t\tdirtyLineStart = 1;\n\t\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, this._finalRenderedLine);\n\t\t\t\t\tthis._finalRenderedLine = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase ViewEventType.ViewLinesDeleted: {\n\t\t\t\t\t// Shift content below deleted line up\n\t\t\t\t\tconst deletedLineContentStartIndex = (e.fromLineNumber - 1) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tconst deletedLineContentEndIndex = (e.toLineNumber) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tconst nullContentStartIndex = (this._finalRenderedLine - (e.toLineNumber - e.fromLineNumber + 1)) * FullFileRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer.set(cellBuffer.subarray(deletedLineContentEndIndex), deletedLineContentStartIndex);\n\n\t\t\t\t\t// Zero out content on lines that are no longer valid\n\t\t\t\t\tcellBuffer.fill(0, nullContentStartIndex);\n\n\t\t\t\t\t// Update dirty lines and final rendered line\n\t\t\t\t\tdirtyLineStart = Math.min(dirtyLineStart, e.fromLineNumber);\n\t\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, this._finalRenderedLine);\n\t\t\t\t\tthis._finalRenderedLine -= e.toLineNumber - e.fromLineNumber + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) {\n\n\t\t\t// Only attempt to render lines that the GPU renderer can handle\n\t\t\tif (!this._viewGpuContext.canRender(viewLineOptions, viewportData, y)) {\n\t\t\t\tfillStartIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\t\tfillEndIndex = (y * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\n\t\t\t\tdirtyLineStart = Math.min(dirtyLineStart, y);\n\t\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, y);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip updating the line if it's already up to date\n\t\t\tif (upToDateLines.has(y)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdirtyLineStart = Math.min(dirtyLineStart, y);\n\t\t\tdirtyLineEnd = Math.max(dirtyLineEnd, y);\n\n\t\t\tlineData = viewportData.getViewLineRenderingData(y);\n\t\t\ttabXOffset = 0;\n\n\t\t\tcontentSegmenter = createContentSegmenter(lineData, viewLineOptions);\n\t\t\tcharWidth = viewLineOptions.spaceWidth * dpr;\n\t\t\tabsoluteOffsetX = (lineData.minColumn - 1) * charWidth;\n\n\t\t\ttokens = lineData.tokens;\n\t\t\ttokenStartIndex = lineData.minColumn - 1;\n\t\t\ttokenEndIndex = 0;\n\t\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\t\ttokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\t\tif (tokenEndIndex <= tokenStartIndex) {\n\t\t\t\t\t// The faux indent part of the line should have no token type\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttokenMetadata = tokens.getMetadata(tokenIndex);\n\n\t\t\t\tfor (x = tokenStartIndex; x < tokenEndIndex; x++) {\n\t\t\t\t\t// Only render lines that do not exceed maximum columns\n\t\t\t\t\tif (x > FullFileRenderStrategy.maxSupportedColumns) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegment = contentSegmenter.getSegmentAtIndex(x);\n\t\t\t\t\tif (segment === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tchars = segment;\n\n\t\t\t\t\tif (!(lineData.isBasicASCII && viewLineOptions.useMonospaceOptimizations)) {\n\t\t\t\t\t\tcharWidth = this.glyphRasterizer.getTextMetrics(chars).width;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorationStyleSetColor = undefined;\n\t\t\t\t\tdecorationStyleSetBold = undefined;\n\t\t\t\t\tdecorationStyleSetOpacity = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethrough = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughThickness = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughColor = undefined;\n\n\t\t\t\t\t// Apply supported inline decoration styles to the cell metadata\n\t\t\t\t\tfor (decoration of lineData.inlineDecorations) {\n\t\t\t\t\t\t// This is Range.strictContainsPosition except it works at the cell level,\n\t\t\t\t\t\t// it's also inlined to avoid overhead.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(y < decoration.range.startLineNumber || y > decoration.range.endLineNumber) ||\n\t\t\t\t\t\t\t(y === decoration.range.startLineNumber && x < decoration.range.startColumn - 1) ||\n\t\t\t\t\t\t\t(y === decoration.range.endLineNumber && x >= decoration.range.endColumn - 1)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst rules = ViewGpuContext.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, decoration.inlineClassName);\n\t\t\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\t\t\tconst value = rule.styleMap.get(r)?.toString() ?? '';\n\t\t\t\t\t\t\t\tswitch (r) {\n\t\t\t\t\t\t\t\t\tcase 'color': {\n\t\t\t\t\t\t\t\t\t\t// TODO: This parsing and error handling should move into canRender so fallback\n\t\t\t\t\t\t\t\t\t\t// to DOM works\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(value);\n\t\t\t\t\t\t\t\t\t\tif (!parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new BugIndicatingError('Invalid color format ' + value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'font-weight': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssFontWeight(value);\n\t\t\t\t\t\t\t\t\t\tif (parsedValue >= 400) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = true;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set bold (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = false;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set normal (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'opacity': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssOpacity(value);\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetOpacity = parsedValue;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration':\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-line': {\n\t\t\t\t\t\t\t\t\t\tif (value === 'line-through') {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethrough = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-thickness': {\n\t\t\t\t\t\t\t\t\t\tconst match = value.match(/^(\\d+(?:\\.\\d+)?)px$/);\n\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughThickness = parseFloat(match[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-color': {\n\t\t\t\t\t\t\t\t\t\tlet colorValue = value;\n\t\t\t\t\t\t\t\t\t\tconst varMatch = value.match(/^var\\((--[^,]+),\\s*(?:initial|inherit)\\)$/);\n\t\t\t\t\t\t\t\t\t\tif (varMatch) {\n\t\t\t\t\t\t\t\t\t\t\tcolorValue = ViewGpuContext.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode, varMatch[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(colorValue);\n\t\t\t\t\t\t\t\t\t\tif (parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-style': {\n\t\t\t\t\t\t\t\t\t\t// These are validated in canRender and use default behavior\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new BugIndicatingError('Unexpected inline decoration style');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chars === ' ' || chars === '\\t') {\n\t\t\t\t\t\t// Zero out glyph to ensure it doesn't get rendered\n\t\t\t\t\t\tcellIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\t\tcellBuffer.fill(0, cellIndex, cellIndex + CellBufferInfo.FloatsPerEntry);\n\t\t\t\t\t\t// Adjust xOffset for tab stops\n\t\t\t\t\t\tif (chars === '\\t') {\n\t\t\t\t\t\t\t// Find the pixel offset between the current position and the next tab stop\n\t\t\t\t\t\t\tconst offsetBefore = x + tabXOffset;\n\t\t\t\t\t\t\ttabXOffset = CursorColumns.nextRenderTabStop(x + tabXOffset, lineData.tabSize);\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth * (tabXOffset - offsetBefore);\n\t\t\t\t\t\t\t// Convert back to offset excluding x and the current character\n\t\t\t\t\t\t\ttabXOffset -= x + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst decorationStyleSetId = ViewGpuContext.decorationStyleCache.getOrCreateEntry(decorationStyleSetColor, decorationStyleSetBold, decorationStyleSetOpacity, decorationStyleSetStrikethrough, decorationStyleSetStrikethroughThickness, decorationStyleSetStrikethroughColor);\n\t\t\t\t\tglyph = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, chars, tokenMetadata, decorationStyleSetId, absoluteOffsetX);\n\n\t\t\t\t\tabsoluteOffsetY = Math.round(\n\t\t\t\t\t\t// Top of layout box (includes line height)\n\t\t\t\t\t\tviewportData.relativeVerticalOffset[y - viewportData.startLineNumber] * dpr +\n\n\t\t\t\t\t\t// Delta from top of layout box (includes line height) to top of the inline box (no line height)\n\t\t\t\t\t\tMath.floor((viewportData.lineHeight * dpr - (glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent)) / 2) +\n\n\t\t\t\t\t\t// Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn\n\t\t\t\t\t\t// with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical\n\t\t\t\t\t\t// baseline.\n\t\t\t\t\t\tglyph.fontBoundingBoxAscent\n\t\t\t\t\t);\n\n\t\t\t\t\tcellIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_X] = Math.floor(absoluteOffsetX);\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_Y] = absoluteOffsetY;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex;\n\n\t\t\t\t\t// Adjust the x pixel offset for the next character\n\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t}\n\n\t\t\t\ttokenStartIndex = tokenEndIndex;\n\t\t\t}\n\n\t\t\t// Clear to end of line\n\t\t\tfillStartIndex = ((y - 1) * FullFileRenderStrategy.maxSupportedColumns + tokenEndIndex) * Constants.IndicesPerCell;\n\t\t\tfillEndIndex = (y * FullFileRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\n\t\t\tupToDateLines.add(y);\n\t\t}\n\n\t\tconst visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount;\n\n\t\t// Only write when there is changed data\n\t\tdirtyLineStart = Math.min(dirtyLineStart, FullFileRenderStrategy.maxSupportedLines);\n\t\tdirtyLineEnd = Math.min(dirtyLineEnd, FullFileRenderStrategy.maxSupportedLines);\n\t\tif (dirtyLineStart <= dirtyLineEnd) {\n\t\t\t// Write buffer and swap it out to unblock writes\n\t\t\tthis._device.queue.writeBuffer(\n\t\t\t\tthis._cellBindBuffer,\n\t\t\t\t(dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\tcellBuffer.buffer,\n\t\t\t\t(dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\t(dirtyLineEnd - dirtyLineStart + 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT\n\t\t\t);\n\t\t}\n\n\t\tthis._finalRenderedLine = Math.max(this._finalRenderedLine, dirtyLineEnd);\n\n\t\tthis._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1;\n\n\t\tthis._visibleObjectCount = visibleObjectCount;\n\n\t\treturn visibleObjectCount;\n\t}\n\n\tdraw(pass: GPURenderPassEncoder, viewportData: ViewportData): void {\n\t\tif (this._visibleObjectCount <= 0) {\n\t\t\tthrow new BugIndicatingError('Attempt to draw 0 objects');\n\t\t}\n\t\tpass.draw(\n\t\t\tquadVertices.length / 2,\n\t\t\tthis._visibleObjectCount,\n\t\t\tundefined,\n\t\t\t(viewportData.startLineNumber - 1) * FullFileRenderStrategy.maxSupportedColumns\n\t\t);\n\t}\n\n\t/**\n\t * Queue updates that need to happen on the active buffer, not just the cache. This will be\n\t * deferred to when the actual cell buffer is changed since the active buffer could be locked by\n\t * the GPU which would block the main thread.\n\t */\n\tprivate _queueBufferUpdate(e: QueuedBufferEvent) {\n\t\tthis._queuedBufferUpdates[0].push(e);\n\t\tthis._queuedBufferUpdates[1].push(e);\n\t}\n}\n\nfunction parseCssFontWeight(value: string) {\n\tswitch (value) {\n\t\tcase 'lighter':\n\t\tcase 'normal': return 400;\n\t\tcase 'bolder':\n\t\tcase 'bold': return 700;\n\t}\n\treturn parseInt(value);\n}\n\nfunction parseCssOpacity(value: string): number {\n\tif (value.endsWith('%')) {\n\t\treturn parseFloat(value.substring(0, value.length - 1)) / 100;\n\t}\n\tif (value.match(/^\\d+(?:\\.\\d*)/)) {\n\t\treturn parseFloat(value);\n\t}\n\treturn 1;\n}\n"]}
@@ -92,6 +92,9 @@ export class ViewportRenderStrategy extends BaseRenderStrategy {
92
92
  return true;
93
93
  }
94
94
  onScrollChanged(e) {
95
+ if (this._store.isDisposed) {
96
+ return false;
97
+ }
95
98
  const dpr = getActiveWindow().devicePixelRatio;
96
99
  this._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;
97
100
  this._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/gpu/renderStrategy/viewportRenderStrategy.ts","vs/editor/browser/gpu/renderStrategy/viewportRenderStrategy.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAStE,OAAO,EAAE,sBAAsB,EAA0B,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAmB9E;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC7D;;OAEG;aACa,wBAAmB,GAAG,IAAH,AAAO,CAAC;IAsB3C,IAAI,gBAAgB;QACnB,OAAO;YACN,EAAE,OAAO,yBAAiB,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE;YACxE,EAAE,OAAO,gCAAwB,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,EAAE;SACvF,CAAC;IACH,CAAC;IAKD,YACC,OAA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CAAC;QACd,KAAK,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC;IACzB,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACrC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAC/D,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;QAClC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC","file":"viewportRenderStrategy.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 { getActiveWindow } from '../../../../base/browser/dom.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { IViewLineTokens } from '../../../common/tokens/lineTokens.js';\nimport { type ViewConfigurationChangedEvent, type ViewDecorationsChangedEvent, type ViewLineMappingChangedEvent, type ViewLinesChangedEvent, type ViewLinesDeletedEvent, type ViewLinesInsertedEvent, type ViewScrollChangedEvent, type ViewThemeChangedEvent, type ViewTokensChangedEvent, type ViewZonesChangedEvent } from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineRenderingData } from '../../../common/viewModel.js';\nimport { InlineDecoration } from '../../../common/viewModel/inlineDecorations.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ViewLineOptions } from '../../viewParts/viewLines/viewLineOptions.js';\nimport { ITextureAtlasPageGlyph } from '../atlas/atlas.js';\nimport { createContentSegmenter, type IContentSegmenter } from '../contentSegmenter.js';\nimport { BindingId } from '../gpu.js';\nimport { GPULifecycle } from '../gpuDisposable.js';\nimport { quadVertices } from '../gpuUtils.js';\nimport { GlyphRasterizer } from '../raster/glyphRasterizer.js';\nimport { ViewGpuContext } from '../viewGpuContext.js';\nimport { BaseRenderStrategy } from './baseRenderStrategy.js';\nimport { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js';\n\nconst enum Constants {\n\tIndicesPerCell = 6,\n\tCellBindBufferCapacityIncrement = 32,\n\tCellBindBufferInitialCapacity = 63, // Will be rounded up to nearest increment\n}\n\nconst enum CellBufferInfo {\n\tFloatsPerEntry = 6,\n\tBytesPerEntry = CellBufferInfo.FloatsPerEntry * 4,\n\tOffset_X = 0,\n\tOffset_Y = 1,\n\tOffset_Unused1 = 2,\n\tOffset_Unused2 = 3,\n\tGlyphIndex = 4,\n\tTextureIndex = 5,\n}\n\n/**\n * A render strategy that uploads the content of the entire viewport every frame.\n */\nexport class ViewportRenderStrategy extends BaseRenderStrategy {\n\t/**\n\t * The hard cap for line columns that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedColumns = 2000;\n\n\treadonly type = 'viewport';\n\treadonly wgsl: string = fullFileRenderStrategyWgsl;\n\n\tprivate _cellBindBufferLineCapacity = Constants.CellBindBufferInitialCapacity;\n\tprivate _cellBindBuffer!: GPUBuffer;\n\n\t/**\n\t * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that\n\t * the thread doesn't block when one is being uploaded to the GPU.\n\t */\n\tprivate _cellValueBuffers!: [ArrayBuffer, ArrayBuffer];\n\tprivate _activeDoubleBufferIndex: 0 | 1 = 0;\n\n\tprivate _visibleObjectCount: number = 0;\n\tprivate _lastViewportLineCount: number = 0;\n\n\tprivate _scrollOffsetBindBuffer: GPUBuffer;\n\tprivate _scrollOffsetValueBuffer: Float32Array;\n\tprivate _scrollInitialized: boolean = false;\n\n\tget bindGroupEntries(): GPUBindGroupEntry[] {\n\t\treturn [\n\t\t\t{ binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } },\n\t\t\t{ binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }\n\t\t];\n\t}\n\n\tprivate readonly _onDidChangeBindGroupEntries = this._register(new Emitter<void>());\n\treadonly onDidChangeBindGroupEntries = this._onDidChangeBindGroupEntries.event;\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewGpuContext: ViewGpuContext,\n\t\tdevice: GPUDevice,\n\t\tglyphRasterizer: { value: GlyphRasterizer },\n\t) {\n\t\tsuper(context, viewGpuContext, device, glyphRasterizer);\n\n\t\tthis._rebuildCellBuffer(this._cellBindBufferLineCapacity);\n\n\t\tconst scrollOffsetBufferSize = 2;\n\t\tthis._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco scroll offset buffer',\n\t\t\tsize: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT,\n\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize);\n\t}\n\n\tprivate _rebuildCellBuffer(lineCount: number) {\n\t\tthis._cellBindBuffer?.destroy();\n\n\t\t// Increase in chunks so resizing a window by hand doesn't keep allocating and throwing away\n\t\tconst lineCountWithIncrement = (Math.floor(lineCount / Constants.CellBindBufferCapacityIncrement) + 1) * Constants.CellBindBufferCapacityIncrement;\n\n\t\tconst bufferSize = lineCountWithIncrement * ViewportRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT;\n\t\tthis._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco full file cell buffer',\n\t\t\tsize: bufferSize,\n\t\t\tusage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._cellValueBuffers = [\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t];\n\t\tthis._cellBindBufferLineCapacity = lineCountWithIncrement;\n\t\tthis._lastViewportLineCount = 0;\n\n\t\tthis._onDidChangeBindGroupEntries.fire();\n\t}\n\n\t// #region Event handlers\n\n\t// The primary job of these handlers is to:\n\t// 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when\n\t// it's _within the viewport_.\n\t// 2. Pass relevant events on to the render function so it can force certain line ranges to be\n\t// re-rendered even if they're not in the viewport. For example when a view zone is added,\n\t// there are lines that used to be visible but are no longer, so those ranges must be\n\t// cleared and uploaded to the GPU.\n\n\tpublic override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onTokensChanged(e: ViewTokensChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesDeleted(e: ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesChanged(e: ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e?: ViewScrollChangedEvent): boolean {\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tthis._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;\n\t\tthis._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;\n\t\tthis._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer as Float32Array<ArrayBuffer>);\n\t\treturn true;\n\t}\n\n\tpublic override onThemeChanged(e: ViewThemeChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: ViewLineMappingChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onZonesChanged(e: ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// #endregion\n\n\treset() {\n\t\tfor (const bufferIndex of [0, 1]) {\n\t\t\t// Zero out buffer and upload to GPU to prevent stale rows from rendering\n\t\t\tconst buffer = new Float32Array(this._cellValueBuffers[bufferIndex]);\n\t\t\tbuffer.fill(0, 0, buffer.length);\n\t\t\tthis._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength);\n\t\t}\n\t\tthis._lastViewportLineCount = 0;\n\t}\n\n\tupdate(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number {\n\t\t// IMPORTANT: This is a hot function. Variables are pre-allocated and shared within the\n\t\t// loop. This is done so we don't need to trust the JIT compiler to do this optimization to\n\t\t// avoid potential additional blocking time in garbage collector which is a common cause of\n\t\t// dropped frames.\n\n\t\tlet chars = '';\n\t\tlet segment: string | undefined;\n\t\tlet charWidth = 0;\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tlet absoluteOffsetX = 0;\n\t\tlet absoluteOffsetY = 0;\n\t\tlet tabXOffset = 0;\n\t\tlet glyph: Readonly<ITextureAtlasPageGlyph>;\n\t\tlet cellIndex = 0;\n\n\t\tlet tokenStartIndex = 0;\n\t\tlet tokenEndIndex = 0;\n\t\tlet tokenMetadata = 0;\n\n\t\tlet decorationStyleSetBold: boolean | undefined;\n\t\tlet decorationStyleSetColor: number | undefined;\n\t\tlet decorationStyleSetOpacity: number | undefined;\n\t\tlet decorationStyleSetStrikethrough: boolean | undefined;\n\t\tlet decorationStyleSetStrikethroughThickness: number | undefined;\n\t\tlet decorationStyleSetStrikethroughColor: number | undefined;\n\n\t\tlet lineData: ViewLineRenderingData;\n\t\tlet decoration: InlineDecoration;\n\t\tlet fillStartIndex = 0;\n\t\tlet fillEndIndex = 0;\n\n\t\tlet tokens: IViewLineTokens;\n\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tlet contentSegmenter: IContentSegmenter;\n\n\t\tif (!this._scrollInitialized) {\n\t\t\tthis.onScrollChanged();\n\t\t\tthis._scrollInitialized = true;\n\t\t}\n\n\t\t// Zero out cell buffer or rebuild if needed\n\t\tif (this._cellBindBufferLineCapacity < viewportData.endLineNumber - viewportData.startLineNumber + 1) {\n\t\t\tthis._rebuildCellBuffer(viewportData.endLineNumber - viewportData.startLineNumber + 1);\n\t\t}\n\t\tconst cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);\n\t\tcellBuffer.fill(0);\n\n\t\tconst lineIndexCount = ViewportRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\n\t\tfor (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) {\n\n\t\t\t// Only attempt to render lines that the GPU renderer can handle\n\t\t\tif (!this._viewGpuContext.canRender(viewLineOptions, viewportData, y)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlineData = viewportData.getViewLineRenderingData(y);\n\t\t\ttabXOffset = 0;\n\n\t\t\tcontentSegmenter = createContentSegmenter(lineData, viewLineOptions);\n\t\t\tcharWidth = viewLineOptions.spaceWidth * dpr;\n\t\t\tabsoluteOffsetX = (lineData.minColumn - 1) * charWidth;\n\n\t\t\ttokens = lineData.tokens;\n\t\t\ttokenStartIndex = lineData.minColumn - 1;\n\t\t\ttokenEndIndex = 0;\n\t\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\t\ttokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\t\tif (tokenEndIndex <= tokenStartIndex) {\n\t\t\t\t\t// The faux indent part of the line should have no token type\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttokenMetadata = tokens.getMetadata(tokenIndex);\n\n\t\t\t\tfor (x = tokenStartIndex; x < tokenEndIndex; x++) {\n\t\t\t\t\t// Only render lines that do not exceed maximum columns\n\t\t\t\t\tif (x > ViewportRenderStrategy.maxSupportedColumns) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegment = contentSegmenter.getSegmentAtIndex(x);\n\t\t\t\t\tif (segment === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tchars = segment;\n\n\t\t\t\t\tif (!(lineData.isBasicASCII && viewLineOptions.useMonospaceOptimizations)) {\n\t\t\t\t\t\tcharWidth = this.glyphRasterizer.getTextMetrics(chars).width;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorationStyleSetColor = undefined;\n\t\t\t\t\tdecorationStyleSetBold = undefined;\n\t\t\t\t\tdecorationStyleSetOpacity = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethrough = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughThickness = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughColor = undefined;\n\n\t\t\t\t\t// Apply supported inline decoration styles to the cell metadata\n\t\t\t\t\tfor (decoration of lineData.inlineDecorations) {\n\t\t\t\t\t\t// This is Range.strictContainsPosition except it works at the cell level,\n\t\t\t\t\t\t// it's also inlined to avoid overhead.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(y < decoration.range.startLineNumber || y > decoration.range.endLineNumber) ||\n\t\t\t\t\t\t\t(y === decoration.range.startLineNumber && x < decoration.range.startColumn - 1) ||\n\t\t\t\t\t\t\t(y === decoration.range.endLineNumber && x >= decoration.range.endColumn - 1)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst rules = ViewGpuContext.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, decoration.inlineClassName);\n\t\t\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\t\t\tconst value = rule.styleMap.get(r)?.toString() ?? '';\n\t\t\t\t\t\t\t\tswitch (r) {\n\t\t\t\t\t\t\t\t\tcase 'color': {\n\t\t\t\t\t\t\t\t\t\t// TODO: This parsing and error handling should move into canRender so fallback\n\t\t\t\t\t\t\t\t\t\t// to DOM works\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(value);\n\t\t\t\t\t\t\t\t\t\tif (!parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new BugIndicatingError('Invalid color format ' + value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'font-weight': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssFontWeight(value);\n\t\t\t\t\t\t\t\t\t\tif (parsedValue >= 400) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = true;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set bold (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = false;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set normal (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'opacity': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssOpacity(value);\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetOpacity = parsedValue;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration':\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-line': {\n\t\t\t\t\t\t\t\t\t\tif (value === 'line-through') {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethrough = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-thickness': {\n\t\t\t\t\t\t\t\t\t\tconst match = value.match(/^(\\d+(?:\\.\\d+)?)px$/);\n\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughThickness = parseFloat(match[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-color': {\n\t\t\t\t\t\t\t\t\t\tlet colorValue = value;\n\t\t\t\t\t\t\t\t\t\tconst varMatch = value.match(/^var\\((--[^,]+),\\s*(?:initial|inherit)\\)$/);\n\t\t\t\t\t\t\t\t\t\tif (varMatch) {\n\t\t\t\t\t\t\t\t\t\t\tcolorValue = ViewGpuContext.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode, varMatch[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(colorValue);\n\t\t\t\t\t\t\t\t\t\tif (parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-style': {\n\t\t\t\t\t\t\t\t\t\t// These are validated in canRender and use default behavior\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new BugIndicatingError('Unexpected inline decoration style');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chars === ' ' || chars === '\\t') {\n\t\t\t\t\t\t// Zero out glyph to ensure it doesn't get rendered\n\t\t\t\t\t\tcellIndex = ((y - 1) * ViewportRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\t\tcellBuffer.fill(0, cellIndex, cellIndex + CellBufferInfo.FloatsPerEntry);\n\t\t\t\t\t\t// Adjust xOffset for tab stops\n\t\t\t\t\t\tif (chars === '\\t') {\n\t\t\t\t\t\t\t// Find the pixel offset between the current position and the next tab stop\n\t\t\t\t\t\t\tconst offsetBefore = x + tabXOffset;\n\t\t\t\t\t\t\ttabXOffset = CursorColumns.nextRenderTabStop(x + tabXOffset, lineData.tabSize);\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth * (tabXOffset - offsetBefore);\n\t\t\t\t\t\t\t// Convert back to offset excluding x and the current character\n\t\t\t\t\t\t\ttabXOffset -= x + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst decorationStyleSetId = ViewGpuContext.decorationStyleCache.getOrCreateEntry(decorationStyleSetColor, decorationStyleSetBold, decorationStyleSetOpacity, decorationStyleSetStrikethrough, decorationStyleSetStrikethroughThickness, decorationStyleSetStrikethroughColor);\n\t\t\t\t\tglyph = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, chars, tokenMetadata, decorationStyleSetId, absoluteOffsetX);\n\n\t\t\t\t\tabsoluteOffsetY = Math.round(\n\t\t\t\t\t\t// Top of layout box (includes line height)\n\t\t\t\t\t\tviewportData.relativeVerticalOffset[y - viewportData.startLineNumber] * dpr +\n\n\t\t\t\t\t\t// Delta from top of layout box (includes line height) to top of the inline box (no line height)\n\t\t\t\t\t\tMath.floor((viewportData.lineHeight * dpr - (glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent)) / 2) +\n\n\t\t\t\t\t\t// Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn\n\t\t\t\t\t\t// with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical\n\t\t\t\t\t\t// baseline.\n\t\t\t\t\t\tglyph.fontBoundingBoxAscent\n\t\t\t\t\t);\n\n\t\t\t\t\tcellIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_X] = Math.floor(absoluteOffsetX);\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_Y] = absoluteOffsetY;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex;\n\n\t\t\t\t\t// Adjust the x pixel offset for the next character\n\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t}\n\n\t\t\t\ttokenStartIndex = tokenEndIndex;\n\t\t\t}\n\n\t\t\t// Clear to end of line\n\t\t\tfillStartIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns + tokenEndIndex) * Constants.IndicesPerCell;\n\t\t\tfillEndIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\t\t}\n\n\t\tconst visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount;\n\t\tconst viewportLineCount = viewportData.endLineNumber - viewportData.startLineNumber + 1;\n\n\t\t// This render strategy always uploads the whole viewport\n\t\tthis._device.queue.writeBuffer(\n\t\t\tthis._cellBindBuffer,\n\t\t\t0,\n\t\t\tcellBuffer.buffer,\n\t\t\t0,\n\t\t\tvisibleObjectCount * Float32Array.BYTES_PER_ELEMENT\n\t\t);\n\n\t\t// Clear stale lines in GPU buffer if viewport shrunk\n\t\tif (viewportLineCount < this._lastViewportLineCount) {\n\t\t\tconst staleLineCount = this._lastViewportLineCount - viewportLineCount;\n\t\t\tconst staleStartOffset = visibleObjectCount * Float32Array.BYTES_PER_ELEMENT;\n\t\t\tconst staleByteCount = staleLineCount * lineIndexCount * Float32Array.BYTES_PER_ELEMENT;\n\t\t\t// Write zeros from the zeroed cellBuffer for the stale region\n\t\t\tthis._device.queue.writeBuffer(\n\t\t\t\tthis._cellBindBuffer,\n\t\t\t\tstaleStartOffset,\n\t\t\t\tcellBuffer.buffer,\n\t\t\t\tvisibleObjectCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\tstaleByteCount\n\t\t\t);\n\t\t}\n\t\tthis._lastViewportLineCount = viewportLineCount;\n\n\t\tthis._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1;\n\n\t\tthis._visibleObjectCount = visibleObjectCount;\n\n\t\treturn visibleObjectCount;\n\t}\n\n\tdraw(pass: GPURenderPassEncoder, viewportData: ViewportData): void {\n\t\tif (this._visibleObjectCount <= 0) {\n\t\t\tthrow new BugIndicatingError('Attempt to draw 0 objects');\n\t\t}\n\t\tpass.draw(quadVertices.length / 2, this._visibleObjectCount);\n\t}\n}\n\nfunction parseCssFontWeight(value: string) {\n\tswitch (value) {\n\t\tcase 'lighter':\n\t\tcase 'normal': return 400;\n\t\tcase 'bolder':\n\t\tcase 'bold': return 700;\n\t}\n\treturn parseInt(value);\n}\n\nfunction parseCssOpacity(value: string): number {\n\tif (value.endsWith('%')) {\n\t\treturn parseFloat(value.substring(0, value.length - 1)) / 100;\n\t}\n\tif (value.match(/^\\d+(?:\\.\\d*)/)) {\n\t\treturn parseFloat(value);\n\t}\n\treturn 1;\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 { getActiveWindow } from '../../../../base/browser/dom.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { IViewLineTokens } from '../../../common/tokens/lineTokens.js';\nimport { type ViewConfigurationChangedEvent, type ViewDecorationsChangedEvent, type ViewLineMappingChangedEvent, type ViewLinesChangedEvent, type ViewLinesDeletedEvent, type ViewLinesInsertedEvent, type ViewScrollChangedEvent, type ViewThemeChangedEvent, type ViewTokensChangedEvent, type ViewZonesChangedEvent } from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineRenderingData } from '../../../common/viewModel.js';\nimport { InlineDecoration } from '../../../common/viewModel/inlineDecorations.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ViewLineOptions } from '../../viewParts/viewLines/viewLineOptions.js';\nimport { ITextureAtlasPageGlyph } from '../atlas/atlas.js';\nimport { createContentSegmenter, type IContentSegmenter } from '../contentSegmenter.js';\nimport { BindingId } from '../gpu.js';\nimport { GPULifecycle } from '../gpuDisposable.js';\nimport { quadVertices } from '../gpuUtils.js';\nimport { GlyphRasterizer } from '../raster/glyphRasterizer.js';\nimport { ViewGpuContext } from '../viewGpuContext.js';\nimport { BaseRenderStrategy } from './baseRenderStrategy.js';\nimport { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js';\n\nconst enum Constants {\n\tIndicesPerCell = 6,\n\tCellBindBufferCapacityIncrement = 32,\n\tCellBindBufferInitialCapacity = 63, // Will be rounded up to nearest increment\n}\n\nconst enum CellBufferInfo {\n\tFloatsPerEntry = 6,\n\tBytesPerEntry = CellBufferInfo.FloatsPerEntry * 4,\n\tOffset_X = 0,\n\tOffset_Y = 1,\n\tOffset_Unused1 = 2,\n\tOffset_Unused2 = 3,\n\tGlyphIndex = 4,\n\tTextureIndex = 5,\n}\n\n/**\n * A render strategy that uploads the content of the entire viewport every frame.\n */\nexport class ViewportRenderStrategy extends BaseRenderStrategy {\n\t/**\n\t * The hard cap for line columns that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedColumns = 2000;\n\n\treadonly type = 'viewport';\n\treadonly wgsl: string = fullFileRenderStrategyWgsl;\n\n\tprivate _cellBindBufferLineCapacity = Constants.CellBindBufferInitialCapacity;\n\tprivate _cellBindBuffer!: GPUBuffer;\n\n\t/**\n\t * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that\n\t * the thread doesn't block when one is being uploaded to the GPU.\n\t */\n\tprivate _cellValueBuffers!: [ArrayBuffer, ArrayBuffer];\n\tprivate _activeDoubleBufferIndex: 0 | 1 = 0;\n\n\tprivate _visibleObjectCount: number = 0;\n\tprivate _lastViewportLineCount: number = 0;\n\n\tprivate _scrollOffsetBindBuffer: GPUBuffer;\n\tprivate _scrollOffsetValueBuffer: Float32Array;\n\tprivate _scrollInitialized: boolean = false;\n\n\tget bindGroupEntries(): GPUBindGroupEntry[] {\n\t\treturn [\n\t\t\t{ binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } },\n\t\t\t{ binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }\n\t\t];\n\t}\n\n\tprivate readonly _onDidChangeBindGroupEntries = this._register(new Emitter<void>());\n\treadonly onDidChangeBindGroupEntries = this._onDidChangeBindGroupEntries.event;\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewGpuContext: ViewGpuContext,\n\t\tdevice: GPUDevice,\n\t\tglyphRasterizer: { value: GlyphRasterizer },\n\t) {\n\t\tsuper(context, viewGpuContext, device, glyphRasterizer);\n\n\t\tthis._rebuildCellBuffer(this._cellBindBufferLineCapacity);\n\n\t\tconst scrollOffsetBufferSize = 2;\n\t\tthis._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco scroll offset buffer',\n\t\t\tsize: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT,\n\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize);\n\t}\n\n\tprivate _rebuildCellBuffer(lineCount: number) {\n\t\tthis._cellBindBuffer?.destroy();\n\n\t\t// Increase in chunks so resizing a window by hand doesn't keep allocating and throwing away\n\t\tconst lineCountWithIncrement = (Math.floor(lineCount / Constants.CellBindBufferCapacityIncrement) + 1) * Constants.CellBindBufferCapacityIncrement;\n\n\t\tconst bufferSize = lineCountWithIncrement * ViewportRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT;\n\t\tthis._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco full file cell buffer',\n\t\t\tsize: bufferSize,\n\t\t\tusage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._cellValueBuffers = [\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t];\n\t\tthis._cellBindBufferLineCapacity = lineCountWithIncrement;\n\t\tthis._lastViewportLineCount = 0;\n\n\t\tthis._onDidChangeBindGroupEntries.fire();\n\t}\n\n\t// #region Event handlers\n\n\t// The primary job of these handlers is to:\n\t// 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when\n\t// it's _within the viewport_.\n\t// 2. Pass relevant events on to the render function so it can force certain line ranges to be\n\t// re-rendered even if they're not in the viewport. For example when a view zone is added,\n\t// there are lines that used to be visible but are no longer, so those ranges must be\n\t// cleared and uploaded to the GPU.\n\n\tpublic override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onTokensChanged(e: ViewTokensChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesDeleted(e: ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesChanged(e: ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e?: ViewScrollChangedEvent): boolean {\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tthis._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;\n\t\tthis._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;\n\t\tthis._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer as Float32Array<ArrayBuffer>);\n\t\treturn true;\n\t}\n\n\tpublic override onThemeChanged(e: ViewThemeChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: ViewLineMappingChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onZonesChanged(e: ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// #endregion\n\n\treset() {\n\t\tfor (const bufferIndex of [0, 1]) {\n\t\t\t// Zero out buffer and upload to GPU to prevent stale rows from rendering\n\t\t\tconst buffer = new Float32Array(this._cellValueBuffers[bufferIndex]);\n\t\t\tbuffer.fill(0, 0, buffer.length);\n\t\t\tthis._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength);\n\t\t}\n\t\tthis._lastViewportLineCount = 0;\n\t}\n\n\tupdate(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number {\n\t\t// IMPORTANT: This is a hot function. Variables are pre-allocated and shared within the\n\t\t// loop. This is done so we don't need to trust the JIT compiler to do this optimization to\n\t\t// avoid potential additional blocking time in garbage collector which is a common cause of\n\t\t// dropped frames.\n\n\t\tlet chars = '';\n\t\tlet segment: string | undefined;\n\t\tlet charWidth = 0;\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tlet absoluteOffsetX = 0;\n\t\tlet absoluteOffsetY = 0;\n\t\tlet tabXOffset = 0;\n\t\tlet glyph: Readonly<ITextureAtlasPageGlyph>;\n\t\tlet cellIndex = 0;\n\n\t\tlet tokenStartIndex = 0;\n\t\tlet tokenEndIndex = 0;\n\t\tlet tokenMetadata = 0;\n\n\t\tlet decorationStyleSetBold: boolean | undefined;\n\t\tlet decorationStyleSetColor: number | undefined;\n\t\tlet decorationStyleSetOpacity: number | undefined;\n\t\tlet decorationStyleSetStrikethrough: boolean | undefined;\n\t\tlet decorationStyleSetStrikethroughThickness: number | undefined;\n\t\tlet decorationStyleSetStrikethroughColor: number | undefined;\n\n\t\tlet lineData: ViewLineRenderingData;\n\t\tlet decoration: InlineDecoration;\n\t\tlet fillStartIndex = 0;\n\t\tlet fillEndIndex = 0;\n\n\t\tlet tokens: IViewLineTokens;\n\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tlet contentSegmenter: IContentSegmenter;\n\n\t\tif (!this._scrollInitialized) {\n\t\t\tthis.onScrollChanged();\n\t\t\tthis._scrollInitialized = true;\n\t\t}\n\n\t\t// Zero out cell buffer or rebuild if needed\n\t\tif (this._cellBindBufferLineCapacity < viewportData.endLineNumber - viewportData.startLineNumber + 1) {\n\t\t\tthis._rebuildCellBuffer(viewportData.endLineNumber - viewportData.startLineNumber + 1);\n\t\t}\n\t\tconst cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);\n\t\tcellBuffer.fill(0);\n\n\t\tconst lineIndexCount = ViewportRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\n\t\tfor (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) {\n\n\t\t\t// Only attempt to render lines that the GPU renderer can handle\n\t\t\tif (!this._viewGpuContext.canRender(viewLineOptions, viewportData, y)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlineData = viewportData.getViewLineRenderingData(y);\n\t\t\ttabXOffset = 0;\n\n\t\t\tcontentSegmenter = createContentSegmenter(lineData, viewLineOptions);\n\t\t\tcharWidth = viewLineOptions.spaceWidth * dpr;\n\t\t\tabsoluteOffsetX = (lineData.minColumn - 1) * charWidth;\n\n\t\t\ttokens = lineData.tokens;\n\t\t\ttokenStartIndex = lineData.minColumn - 1;\n\t\t\ttokenEndIndex = 0;\n\t\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\t\ttokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\t\tif (tokenEndIndex <= tokenStartIndex) {\n\t\t\t\t\t// The faux indent part of the line should have no token type\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttokenMetadata = tokens.getMetadata(tokenIndex);\n\n\t\t\t\tfor (x = tokenStartIndex; x < tokenEndIndex; x++) {\n\t\t\t\t\t// Only render lines that do not exceed maximum columns\n\t\t\t\t\tif (x > ViewportRenderStrategy.maxSupportedColumns) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegment = contentSegmenter.getSegmentAtIndex(x);\n\t\t\t\t\tif (segment === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tchars = segment;\n\n\t\t\t\t\tif (!(lineData.isBasicASCII && viewLineOptions.useMonospaceOptimizations)) {\n\t\t\t\t\t\tcharWidth = this.glyphRasterizer.getTextMetrics(chars).width;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorationStyleSetColor = undefined;\n\t\t\t\t\tdecorationStyleSetBold = undefined;\n\t\t\t\t\tdecorationStyleSetOpacity = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethrough = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughThickness = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughColor = undefined;\n\n\t\t\t\t\t// Apply supported inline decoration styles to the cell metadata\n\t\t\t\t\tfor (decoration of lineData.inlineDecorations) {\n\t\t\t\t\t\t// This is Range.strictContainsPosition except it works at the cell level,\n\t\t\t\t\t\t// it's also inlined to avoid overhead.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(y < decoration.range.startLineNumber || y > decoration.range.endLineNumber) ||\n\t\t\t\t\t\t\t(y === decoration.range.startLineNumber && x < decoration.range.startColumn - 1) ||\n\t\t\t\t\t\t\t(y === decoration.range.endLineNumber && x >= decoration.range.endColumn - 1)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst rules = ViewGpuContext.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, decoration.inlineClassName);\n\t\t\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\t\t\tconst value = rule.styleMap.get(r)?.toString() ?? '';\n\t\t\t\t\t\t\t\tswitch (r) {\n\t\t\t\t\t\t\t\t\tcase 'color': {\n\t\t\t\t\t\t\t\t\t\t// TODO: This parsing and error handling should move into canRender so fallback\n\t\t\t\t\t\t\t\t\t\t// to DOM works\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(value);\n\t\t\t\t\t\t\t\t\t\tif (!parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new BugIndicatingError('Invalid color format ' + value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'font-weight': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssFontWeight(value);\n\t\t\t\t\t\t\t\t\t\tif (parsedValue >= 400) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = true;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set bold (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = false;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set normal (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'opacity': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssOpacity(value);\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetOpacity = parsedValue;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration':\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-line': {\n\t\t\t\t\t\t\t\t\t\tif (value === 'line-through') {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethrough = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-thickness': {\n\t\t\t\t\t\t\t\t\t\tconst match = value.match(/^(\\d+(?:\\.\\d+)?)px$/);\n\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughThickness = parseFloat(match[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-color': {\n\t\t\t\t\t\t\t\t\t\tlet colorValue = value;\n\t\t\t\t\t\t\t\t\t\tconst varMatch = value.match(/^var\\((--[^,]+),\\s*(?:initial|inherit)\\)$/);\n\t\t\t\t\t\t\t\t\t\tif (varMatch) {\n\t\t\t\t\t\t\t\t\t\t\tcolorValue = ViewGpuContext.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode, varMatch[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(colorValue);\n\t\t\t\t\t\t\t\t\t\tif (parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-style': {\n\t\t\t\t\t\t\t\t\t\t// These are validated in canRender and use default behavior\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new BugIndicatingError('Unexpected inline decoration style');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chars === ' ' || chars === '\\t') {\n\t\t\t\t\t\t// Zero out glyph to ensure it doesn't get rendered\n\t\t\t\t\t\tcellIndex = ((y - 1) * ViewportRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\t\tcellBuffer.fill(0, cellIndex, cellIndex + CellBufferInfo.FloatsPerEntry);\n\t\t\t\t\t\t// Adjust xOffset for tab stops\n\t\t\t\t\t\tif (chars === '\\t') {\n\t\t\t\t\t\t\t// Find the pixel offset between the current position and the next tab stop\n\t\t\t\t\t\t\tconst offsetBefore = x + tabXOffset;\n\t\t\t\t\t\t\ttabXOffset = CursorColumns.nextRenderTabStop(x + tabXOffset, lineData.tabSize);\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth * (tabXOffset - offsetBefore);\n\t\t\t\t\t\t\t// Convert back to offset excluding x and the current character\n\t\t\t\t\t\t\ttabXOffset -= x + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst decorationStyleSetId = ViewGpuContext.decorationStyleCache.getOrCreateEntry(decorationStyleSetColor, decorationStyleSetBold, decorationStyleSetOpacity, decorationStyleSetStrikethrough, decorationStyleSetStrikethroughThickness, decorationStyleSetStrikethroughColor);\n\t\t\t\t\tglyph = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, chars, tokenMetadata, decorationStyleSetId, absoluteOffsetX);\n\n\t\t\t\t\tabsoluteOffsetY = Math.round(\n\t\t\t\t\t\t// Top of layout box (includes line height)\n\t\t\t\t\t\tviewportData.relativeVerticalOffset[y - viewportData.startLineNumber] * dpr +\n\n\t\t\t\t\t\t// Delta from top of layout box (includes line height) to top of the inline box (no line height)\n\t\t\t\t\t\tMath.floor((viewportData.lineHeight * dpr - (glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent)) / 2) +\n\n\t\t\t\t\t\t// Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn\n\t\t\t\t\t\t// with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical\n\t\t\t\t\t\t// baseline.\n\t\t\t\t\t\tglyph.fontBoundingBoxAscent\n\t\t\t\t\t);\n\n\t\t\t\t\tcellIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_X] = Math.floor(absoluteOffsetX);\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_Y] = absoluteOffsetY;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex;\n\n\t\t\t\t\t// Adjust the x pixel offset for the next character\n\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t}\n\n\t\t\t\ttokenStartIndex = tokenEndIndex;\n\t\t\t}\n\n\t\t\t// Clear to end of line\n\t\t\tfillStartIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns + tokenEndIndex) * Constants.IndicesPerCell;\n\t\t\tfillEndIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\t\t}\n\n\t\tconst visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount;\n\t\tconst viewportLineCount = viewportData.endLineNumber - viewportData.startLineNumber + 1;\n\n\t\t// This render strategy always uploads the whole viewport\n\t\tthis._device.queue.writeBuffer(\n\t\t\tthis._cellBindBuffer,\n\t\t\t0,\n\t\t\tcellBuffer.buffer,\n\t\t\t0,\n\t\t\tvisibleObjectCount * Float32Array.BYTES_PER_ELEMENT\n\t\t);\n\n\t\t// Clear stale lines in GPU buffer if viewport shrunk\n\t\tif (viewportLineCount < this._lastViewportLineCount) {\n\t\t\tconst staleLineCount = this._lastViewportLineCount - viewportLineCount;\n\t\t\tconst staleStartOffset = visibleObjectCount * Float32Array.BYTES_PER_ELEMENT;\n\t\t\tconst staleByteCount = staleLineCount * lineIndexCount * Float32Array.BYTES_PER_ELEMENT;\n\t\t\t// Write zeros from the zeroed cellBuffer for the stale region\n\t\t\tthis._device.queue.writeBuffer(\n\t\t\t\tthis._cellBindBuffer,\n\t\t\t\tstaleStartOffset,\n\t\t\t\tcellBuffer.buffer,\n\t\t\t\tvisibleObjectCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\tstaleByteCount\n\t\t\t);\n\t\t}\n\t\tthis._lastViewportLineCount = viewportLineCount;\n\n\t\tthis._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1;\n\n\t\tthis._visibleObjectCount = visibleObjectCount;\n\n\t\treturn visibleObjectCount;\n\t}\n\n\tdraw(pass: GPURenderPassEncoder, viewportData: ViewportData): void {\n\t\tif (this._visibleObjectCount <= 0) {\n\t\t\tthrow new BugIndicatingError('Attempt to draw 0 objects');\n\t\t}\n\t\tpass.draw(quadVertices.length / 2, this._visibleObjectCount);\n\t}\n}\n\nfunction parseCssFontWeight(value: string) {\n\tswitch (value) {\n\t\tcase 'lighter':\n\t\tcase 'normal': return 400;\n\t\tcase 'bolder':\n\t\tcase 'bold': return 700;\n\t}\n\treturn parseInt(value);\n}\n\nfunction parseCssOpacity(value: string): number {\n\tif (value.endsWith('%')) {\n\t\treturn parseFloat(value.substring(0, value.length - 1)) / 100;\n\t}\n\tif (value.match(/^\\d+(?:\\.\\d*)/)) {\n\t\treturn parseFloat(value);\n\t}\n\treturn 1;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/gpu/renderStrategy/viewportRenderStrategy.ts","vs/editor/browser/gpu/renderStrategy/viewportRenderStrategy.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAStE,OAAO,EAAE,sBAAsB,EAA0B,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAk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CAAC,CAAC,CAAC,CAAC;QAEtE,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;QAE9C,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,IAA0B,EAAE,YAA0B;QAC1D,IAAI,IAAI,CAAC,mBAAmB,IAAI,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,kBAAkB,CAAC,2BAA2B,CAAC,CAAC;QAC3D,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC9D,CAAC;;AAGF,SAAS,kBAAkB,CAAC,KAAa;IACxC,QAAQ,KAAK,EAAE,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ,CAAC,CAAC,OAAO,GAAG,CAAC;QAC1B,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC;IACzB,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACrC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAC/D,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;QAClC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC","file":"viewportRenderStrategy.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 { getActiveWindow } from '../../../../base/browser/dom.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { IViewLineTokens } from '../../../common/tokens/lineTokens.js';\nimport { type ViewConfigurationChangedEvent, type ViewDecorationsChangedEvent, type ViewLineMappingChangedEvent, type ViewLinesChangedEvent, type ViewLinesDeletedEvent, type ViewLinesInsertedEvent, type ViewScrollChangedEvent, type ViewThemeChangedEvent, type ViewTokensChangedEvent, type ViewZonesChangedEvent } from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineRenderingData } from '../../../common/viewModel.js';\nimport { InlineDecoration } from '../../../common/viewModel/inlineDecorations.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ViewLineOptions } from '../../viewParts/viewLines/viewLineOptions.js';\nimport { ITextureAtlasPageGlyph } from '../atlas/atlas.js';\nimport { createContentSegmenter, type IContentSegmenter } from '../contentSegmenter.js';\nimport { BindingId } from '../gpu.js';\nimport { GPULifecycle } from '../gpuDisposable.js';\nimport { quadVertices } from '../gpuUtils.js';\nimport { GlyphRasterizer } from '../raster/glyphRasterizer.js';\nimport { ViewGpuContext } from '../viewGpuContext.js';\nimport { BaseRenderStrategy } from './baseRenderStrategy.js';\nimport { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js';\n\nconst enum Constants {\n\tIndicesPerCell = 6,\n\tCellBindBufferCapacityIncrement = 32,\n\tCellBindBufferInitialCapacity = 63, // Will be rounded up to nearest increment\n}\n\nconst enum CellBufferInfo {\n\tFloatsPerEntry = 6,\n\tBytesPerEntry = CellBufferInfo.FloatsPerEntry * 4,\n\tOffset_X = 0,\n\tOffset_Y = 1,\n\tOffset_Unused1 = 2,\n\tOffset_Unused2 = 3,\n\tGlyphIndex = 4,\n\tTextureIndex = 5,\n}\n\n/**\n * A render strategy that uploads the content of the entire viewport every frame.\n */\nexport class ViewportRenderStrategy extends BaseRenderStrategy {\n\t/**\n\t * The hard cap for line columns that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedColumns = 2000;\n\n\treadonly type = 'viewport';\n\treadonly wgsl: string = fullFileRenderStrategyWgsl;\n\n\tprivate _cellBindBufferLineCapacity = Constants.CellBindBufferInitialCapacity;\n\tprivate _cellBindBuffer!: GPUBuffer;\n\n\t/**\n\t * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that\n\t * the thread doesn't block when one is being uploaded to the GPU.\n\t */\n\tprivate _cellValueBuffers!: [ArrayBuffer, ArrayBuffer];\n\tprivate _activeDoubleBufferIndex: 0 | 1 = 0;\n\n\tprivate _visibleObjectCount: number = 0;\n\tprivate _lastViewportLineCount: number = 0;\n\n\tprivate _scrollOffsetBindBuffer: GPUBuffer;\n\tprivate _scrollOffsetValueBuffer: Float32Array;\n\tprivate _scrollInitialized: boolean = false;\n\n\tget bindGroupEntries(): GPUBindGroupEntry[] {\n\t\treturn [\n\t\t\t{ binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } },\n\t\t\t{ binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }\n\t\t];\n\t}\n\n\tprivate readonly _onDidChangeBindGroupEntries = this._register(new Emitter<void>());\n\treadonly onDidChangeBindGroupEntries = this._onDidChangeBindGroupEntries.event;\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewGpuContext: ViewGpuContext,\n\t\tdevice: GPUDevice,\n\t\tglyphRasterizer: { value: GlyphRasterizer },\n\t) {\n\t\tsuper(context, viewGpuContext, device, glyphRasterizer);\n\n\t\tthis._rebuildCellBuffer(this._cellBindBufferLineCapacity);\n\n\t\tconst scrollOffsetBufferSize = 2;\n\t\tthis._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco scroll offset buffer',\n\t\t\tsize: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT,\n\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize);\n\t}\n\n\tprivate _rebuildCellBuffer(lineCount: number) {\n\t\tthis._cellBindBuffer?.destroy();\n\n\t\t// Increase in chunks so resizing a window by hand doesn't keep allocating and throwing away\n\t\tconst lineCountWithIncrement = (Math.floor(lineCount / Constants.CellBindBufferCapacityIncrement) + 1) * Constants.CellBindBufferCapacityIncrement;\n\n\t\tconst bufferSize = lineCountWithIncrement * ViewportRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT;\n\t\tthis._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco full file cell buffer',\n\t\t\tsize: bufferSize,\n\t\t\tusage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._cellValueBuffers = [\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t];\n\t\tthis._cellBindBufferLineCapacity = lineCountWithIncrement;\n\t\tthis._lastViewportLineCount = 0;\n\n\t\tthis._onDidChangeBindGroupEntries.fire();\n\t}\n\n\t// #region Event handlers\n\n\t// The primary job of these handlers is to:\n\t// 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when\n\t// it's _within the viewport_.\n\t// 2. Pass relevant events on to the render function so it can force certain line ranges to be\n\t// re-rendered even if they're not in the viewport. For example when a view zone is added,\n\t// there are lines that used to be visible but are no longer, so those ranges must be\n\t// cleared and uploaded to the GPU.\n\n\tpublic override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onTokensChanged(e: ViewTokensChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesDeleted(e: ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesChanged(e: ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e?: ViewScrollChangedEvent): boolean {\n\t\tif (this._store.isDisposed) {\n\t\t\treturn false;\n\t\t}\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tthis._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;\n\t\tthis._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;\n\t\tthis._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer as Float32Array<ArrayBuffer>);\n\t\treturn true;\n\t}\n\n\tpublic override onThemeChanged(e: ViewThemeChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: ViewLineMappingChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onZonesChanged(e: ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// #endregion\n\n\treset() {\n\t\tfor (const bufferIndex of [0, 1]) {\n\t\t\t// Zero out buffer and upload to GPU to prevent stale rows from rendering\n\t\t\tconst buffer = new Float32Array(this._cellValueBuffers[bufferIndex]);\n\t\t\tbuffer.fill(0, 0, buffer.length);\n\t\t\tthis._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength);\n\t\t}\n\t\tthis._lastViewportLineCount = 0;\n\t}\n\n\tupdate(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number {\n\t\t// IMPORTANT: This is a hot function. Variables are pre-allocated and shared within the\n\t\t// loop. This is done so we don't need to trust the JIT compiler to do this optimization to\n\t\t// avoid potential additional blocking time in garbage collector which is a common cause of\n\t\t// dropped frames.\n\n\t\tlet chars = '';\n\t\tlet segment: string | undefined;\n\t\tlet charWidth = 0;\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tlet absoluteOffsetX = 0;\n\t\tlet absoluteOffsetY = 0;\n\t\tlet tabXOffset = 0;\n\t\tlet glyph: Readonly<ITextureAtlasPageGlyph>;\n\t\tlet cellIndex = 0;\n\n\t\tlet tokenStartIndex = 0;\n\t\tlet tokenEndIndex = 0;\n\t\tlet tokenMetadata = 0;\n\n\t\tlet decorationStyleSetBold: boolean | undefined;\n\t\tlet decorationStyleSetColor: number | undefined;\n\t\tlet decorationStyleSetOpacity: number | undefined;\n\t\tlet decorationStyleSetStrikethrough: boolean | undefined;\n\t\tlet decorationStyleSetStrikethroughThickness: number | undefined;\n\t\tlet decorationStyleSetStrikethroughColor: number | undefined;\n\n\t\tlet lineData: ViewLineRenderingData;\n\t\tlet decoration: InlineDecoration;\n\t\tlet fillStartIndex = 0;\n\t\tlet fillEndIndex = 0;\n\n\t\tlet tokens: IViewLineTokens;\n\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tlet contentSegmenter: IContentSegmenter;\n\n\t\tif (!this._scrollInitialized) {\n\t\t\tthis.onScrollChanged();\n\t\t\tthis._scrollInitialized = true;\n\t\t}\n\n\t\t// Zero out cell buffer or rebuild if needed\n\t\tif (this._cellBindBufferLineCapacity < viewportData.endLineNumber - viewportData.startLineNumber + 1) {\n\t\t\tthis._rebuildCellBuffer(viewportData.endLineNumber - viewportData.startLineNumber + 1);\n\t\t}\n\t\tconst cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);\n\t\tcellBuffer.fill(0);\n\n\t\tconst lineIndexCount = ViewportRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\n\t\tfor (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) {\n\n\t\t\t// Only attempt to render lines that the GPU renderer can handle\n\t\t\tif (!this._viewGpuContext.canRender(viewLineOptions, viewportData, y)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlineData = viewportData.getViewLineRenderingData(y);\n\t\t\ttabXOffset = 0;\n\n\t\t\tcontentSegmenter = createContentSegmenter(lineData, viewLineOptions);\n\t\t\tcharWidth = viewLineOptions.spaceWidth * dpr;\n\t\t\tabsoluteOffsetX = (lineData.minColumn - 1) * charWidth;\n\n\t\t\ttokens = lineData.tokens;\n\t\t\ttokenStartIndex = lineData.minColumn - 1;\n\t\t\ttokenEndIndex = 0;\n\t\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\t\ttokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\t\tif (tokenEndIndex <= tokenStartIndex) {\n\t\t\t\t\t// The faux indent part of the line should have no token type\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttokenMetadata = tokens.getMetadata(tokenIndex);\n\n\t\t\t\tfor (x = tokenStartIndex; x < tokenEndIndex; x++) {\n\t\t\t\t\t// Only render lines that do not exceed maximum columns\n\t\t\t\t\tif (x > ViewportRenderStrategy.maxSupportedColumns) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegment = contentSegmenter.getSegmentAtIndex(x);\n\t\t\t\t\tif (segment === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tchars = segment;\n\n\t\t\t\t\tif (!(lineData.isBasicASCII && viewLineOptions.useMonospaceOptimizations)) {\n\t\t\t\t\t\tcharWidth = this.glyphRasterizer.getTextMetrics(chars).width;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorationStyleSetColor = undefined;\n\t\t\t\t\tdecorationStyleSetBold = undefined;\n\t\t\t\t\tdecorationStyleSetOpacity = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethrough = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughThickness = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughColor = undefined;\n\n\t\t\t\t\t// Apply supported inline decoration styles to the cell metadata\n\t\t\t\t\tfor (decoration of lineData.inlineDecorations) {\n\t\t\t\t\t\t// This is Range.strictContainsPosition except it works at the cell level,\n\t\t\t\t\t\t// it's also inlined to avoid overhead.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(y < decoration.range.startLineNumber || y > decoration.range.endLineNumber) ||\n\t\t\t\t\t\t\t(y === decoration.range.startLineNumber && x < decoration.range.startColumn - 1) ||\n\t\t\t\t\t\t\t(y === decoration.range.endLineNumber && x >= decoration.range.endColumn - 1)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst rules = ViewGpuContext.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, decoration.inlineClassName);\n\t\t\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\t\t\tconst value = rule.styleMap.get(r)?.toString() ?? '';\n\t\t\t\t\t\t\t\tswitch (r) {\n\t\t\t\t\t\t\t\t\tcase 'color': {\n\t\t\t\t\t\t\t\t\t\t// TODO: This parsing and error handling should move into canRender so fallback\n\t\t\t\t\t\t\t\t\t\t// to DOM works\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(value);\n\t\t\t\t\t\t\t\t\t\tif (!parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new BugIndicatingError('Invalid color format ' + value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'font-weight': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssFontWeight(value);\n\t\t\t\t\t\t\t\t\t\tif (parsedValue >= 400) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = true;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set bold (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = false;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set normal (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'opacity': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssOpacity(value);\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetOpacity = parsedValue;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration':\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-line': {\n\t\t\t\t\t\t\t\t\t\tif (value === 'line-through') {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethrough = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-thickness': {\n\t\t\t\t\t\t\t\t\t\tconst match = value.match(/^(\\d+(?:\\.\\d+)?)px$/);\n\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughThickness = parseFloat(match[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-color': {\n\t\t\t\t\t\t\t\t\t\tlet colorValue = value;\n\t\t\t\t\t\t\t\t\t\tconst varMatch = value.match(/^var\\((--[^,]+),\\s*(?:initial|inherit)\\)$/);\n\t\t\t\t\t\t\t\t\t\tif (varMatch) {\n\t\t\t\t\t\t\t\t\t\t\tcolorValue = ViewGpuContext.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode, varMatch[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(colorValue);\n\t\t\t\t\t\t\t\t\t\tif (parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-style': {\n\t\t\t\t\t\t\t\t\t\t// These are validated in canRender and use default behavior\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new BugIndicatingError('Unexpected inline decoration style');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chars === ' ' || chars === '\\t') {\n\t\t\t\t\t\t// Zero out glyph to ensure it doesn't get rendered\n\t\t\t\t\t\tcellIndex = ((y - 1) * ViewportRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\t\tcellBuffer.fill(0, cellIndex, cellIndex + CellBufferInfo.FloatsPerEntry);\n\t\t\t\t\t\t// Adjust xOffset for tab stops\n\t\t\t\t\t\tif (chars === '\\t') {\n\t\t\t\t\t\t\t// Find the pixel offset between the current position and the next tab stop\n\t\t\t\t\t\t\tconst offsetBefore = x + tabXOffset;\n\t\t\t\t\t\t\ttabXOffset = CursorColumns.nextRenderTabStop(x + tabXOffset, lineData.tabSize);\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth * (tabXOffset - offsetBefore);\n\t\t\t\t\t\t\t// Convert back to offset excluding x and the current character\n\t\t\t\t\t\t\ttabXOffset -= x + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst decorationStyleSetId = ViewGpuContext.decorationStyleCache.getOrCreateEntry(decorationStyleSetColor, decorationStyleSetBold, decorationStyleSetOpacity, decorationStyleSetStrikethrough, decorationStyleSetStrikethroughThickness, decorationStyleSetStrikethroughColor);\n\t\t\t\t\tglyph = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, chars, tokenMetadata, decorationStyleSetId, absoluteOffsetX);\n\n\t\t\t\t\tabsoluteOffsetY = Math.round(\n\t\t\t\t\t\t// Top of layout box (includes line height)\n\t\t\t\t\t\tviewportData.relativeVerticalOffset[y - viewportData.startLineNumber] * dpr +\n\n\t\t\t\t\t\t// Delta from top of layout box (includes line height) to top of the inline box (no line height)\n\t\t\t\t\t\tMath.floor((viewportData.lineHeight * dpr - (glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent)) / 2) +\n\n\t\t\t\t\t\t// Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn\n\t\t\t\t\t\t// with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical\n\t\t\t\t\t\t// baseline.\n\t\t\t\t\t\tglyph.fontBoundingBoxAscent\n\t\t\t\t\t);\n\n\t\t\t\t\tcellIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_X] = Math.floor(absoluteOffsetX);\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_Y] = absoluteOffsetY;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex;\n\n\t\t\t\t\t// Adjust the x pixel offset for the next character\n\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t}\n\n\t\t\t\ttokenStartIndex = tokenEndIndex;\n\t\t\t}\n\n\t\t\t// Clear to end of line\n\t\t\tfillStartIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns + tokenEndIndex) * Constants.IndicesPerCell;\n\t\t\tfillEndIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\t\t}\n\n\t\tconst visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount;\n\t\tconst viewportLineCount = viewportData.endLineNumber - viewportData.startLineNumber + 1;\n\n\t\t// This render strategy always uploads the whole viewport\n\t\tthis._device.queue.writeBuffer(\n\t\t\tthis._cellBindBuffer,\n\t\t\t0,\n\t\t\tcellBuffer.buffer,\n\t\t\t0,\n\t\t\tvisibleObjectCount * Float32Array.BYTES_PER_ELEMENT\n\t\t);\n\n\t\t// Clear stale lines in GPU buffer if viewport shrunk\n\t\tif (viewportLineCount < this._lastViewportLineCount) {\n\t\t\tconst staleLineCount = this._lastViewportLineCount - viewportLineCount;\n\t\t\tconst staleStartOffset = visibleObjectCount * Float32Array.BYTES_PER_ELEMENT;\n\t\t\tconst staleByteCount = staleLineCount * lineIndexCount * Float32Array.BYTES_PER_ELEMENT;\n\t\t\t// Write zeros from the zeroed cellBuffer for the stale region\n\t\t\tthis._device.queue.writeBuffer(\n\t\t\t\tthis._cellBindBuffer,\n\t\t\t\tstaleStartOffset,\n\t\t\t\tcellBuffer.buffer,\n\t\t\t\tvisibleObjectCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\tstaleByteCount\n\t\t\t);\n\t\t}\n\t\tthis._lastViewportLineCount = viewportLineCount;\n\n\t\tthis._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1;\n\n\t\tthis._visibleObjectCount = visibleObjectCount;\n\n\t\treturn visibleObjectCount;\n\t}\n\n\tdraw(pass: GPURenderPassEncoder, viewportData: ViewportData): void {\n\t\tif (this._visibleObjectCount <= 0) {\n\t\t\tthrow new BugIndicatingError('Attempt to draw 0 objects');\n\t\t}\n\t\tpass.draw(quadVertices.length / 2, this._visibleObjectCount);\n\t}\n}\n\nfunction parseCssFontWeight(value: string) {\n\tswitch (value) {\n\t\tcase 'lighter':\n\t\tcase 'normal': return 400;\n\t\tcase 'bolder':\n\t\tcase 'bold': return 700;\n\t}\n\treturn parseInt(value);\n}\n\nfunction parseCssOpacity(value: string): number {\n\tif (value.endsWith('%')) {\n\t\treturn parseFloat(value.substring(0, value.length - 1)) / 100;\n\t}\n\tif (value.match(/^\\d+(?:\\.\\d*)/)) {\n\t\treturn parseFloat(value);\n\t}\n\treturn 1;\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 { getActiveWindow } from '../../../../base/browser/dom.js';\nimport { Color } from '../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { CursorColumns } from '../../../common/core/cursorColumns.js';\nimport { IViewLineTokens } from '../../../common/tokens/lineTokens.js';\nimport { type ViewConfigurationChangedEvent, type ViewDecorationsChangedEvent, type ViewLineMappingChangedEvent, type ViewLinesChangedEvent, type ViewLinesDeletedEvent, type ViewLinesInsertedEvent, type ViewScrollChangedEvent, type ViewThemeChangedEvent, type ViewTokensChangedEvent, type ViewZonesChangedEvent } from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineRenderingData } from '../../../common/viewModel.js';\nimport { InlineDecoration } from '../../../common/viewModel/inlineDecorations.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport { ViewLineOptions } from '../../viewParts/viewLines/viewLineOptions.js';\nimport { ITextureAtlasPageGlyph } from '../atlas/atlas.js';\nimport { createContentSegmenter, type IContentSegmenter } from '../contentSegmenter.js';\nimport { BindingId } from '../gpu.js';\nimport { GPULifecycle } from '../gpuDisposable.js';\nimport { quadVertices } from '../gpuUtils.js';\nimport { GlyphRasterizer } from '../raster/glyphRasterizer.js';\nimport { ViewGpuContext } from '../viewGpuContext.js';\nimport { BaseRenderStrategy } from './baseRenderStrategy.js';\nimport { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js';\n\nconst enum Constants {\n\tIndicesPerCell = 6,\n\tCellBindBufferCapacityIncrement = 32,\n\tCellBindBufferInitialCapacity = 63, // Will be rounded up to nearest increment\n}\n\nconst enum CellBufferInfo {\n\tFloatsPerEntry = 6,\n\tBytesPerEntry = CellBufferInfo.FloatsPerEntry * 4,\n\tOffset_X = 0,\n\tOffset_Y = 1,\n\tOffset_Unused1 = 2,\n\tOffset_Unused2 = 3,\n\tGlyphIndex = 4,\n\tTextureIndex = 5,\n}\n\n/**\n * A render strategy that uploads the content of the entire viewport every frame.\n */\nexport class ViewportRenderStrategy extends BaseRenderStrategy {\n\t/**\n\t * The hard cap for line columns that can be rendered by the GPU renderer.\n\t */\n\tstatic readonly maxSupportedColumns = 2000;\n\n\treadonly type = 'viewport';\n\treadonly wgsl: string = fullFileRenderStrategyWgsl;\n\n\tprivate _cellBindBufferLineCapacity = Constants.CellBindBufferInitialCapacity;\n\tprivate _cellBindBuffer!: GPUBuffer;\n\n\t/**\n\t * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that\n\t * the thread doesn't block when one is being uploaded to the GPU.\n\t */\n\tprivate _cellValueBuffers!: [ArrayBuffer, ArrayBuffer];\n\tprivate _activeDoubleBufferIndex: 0 | 1 = 0;\n\n\tprivate _visibleObjectCount: number = 0;\n\tprivate _lastViewportLineCount: number = 0;\n\n\tprivate _scrollOffsetBindBuffer: GPUBuffer;\n\tprivate _scrollOffsetValueBuffer: Float32Array;\n\tprivate _scrollInitialized: boolean = false;\n\n\tget bindGroupEntries(): GPUBindGroupEntry[] {\n\t\treturn [\n\t\t\t{ binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } },\n\t\t\t{ binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }\n\t\t];\n\t}\n\n\tprivate readonly _onDidChangeBindGroupEntries = this._register(new Emitter<void>());\n\treadonly onDidChangeBindGroupEntries = this._onDidChangeBindGroupEntries.event;\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\tviewGpuContext: ViewGpuContext,\n\t\tdevice: GPUDevice,\n\t\tglyphRasterizer: { value: GlyphRasterizer },\n\t) {\n\t\tsuper(context, viewGpuContext, device, glyphRasterizer);\n\n\t\tthis._rebuildCellBuffer(this._cellBindBufferLineCapacity);\n\n\t\tconst scrollOffsetBufferSize = 2;\n\t\tthis._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco scroll offset buffer',\n\t\t\tsize: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT,\n\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize);\n\t}\n\n\tprivate _rebuildCellBuffer(lineCount: number) {\n\t\tthis._cellBindBuffer?.destroy();\n\n\t\t// Increase in chunks so resizing a window by hand doesn't keep allocating and throwing away\n\t\tconst lineCountWithIncrement = (Math.floor(lineCount / Constants.CellBindBufferCapacityIncrement) + 1) * Constants.CellBindBufferCapacityIncrement;\n\n\t\tconst bufferSize = lineCountWithIncrement * ViewportRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT;\n\t\tthis._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, {\n\t\t\tlabel: 'Monaco full file cell buffer',\n\t\t\tsize: bufferSize,\n\t\t\tusage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,\n\t\t})).object;\n\t\tthis._cellValueBuffers = [\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t\tnew ArrayBuffer(bufferSize),\n\t\t];\n\t\tthis._cellBindBufferLineCapacity = lineCountWithIncrement;\n\t\tthis._lastViewportLineCount = 0;\n\n\t\tthis._onDidChangeBindGroupEntries.fire();\n\t}\n\n\t// #region Event handlers\n\n\t// The primary job of these handlers is to:\n\t// 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when\n\t// it's _within the viewport_.\n\t// 2. Pass relevant events on to the render function so it can force certain line ranges to be\n\t// re-rendered even if they're not in the viewport. For example when a view zone is added,\n\t// there are lines that used to be visible but are no longer, so those ranges must be\n\t// cleared and uploaded to the GPU.\n\n\tpublic override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onDecorationsChanged(e: ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onTokensChanged(e: ViewTokensChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesDeleted(e: ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesInserted(e: ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLinesChanged(e: ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onScrollChanged(e?: ViewScrollChangedEvent): boolean {\n\t\tif (this._store.isDisposed) {\n\t\t\treturn false;\n\t\t}\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tthis._scrollOffsetValueBuffer[0] = (e?.scrollLeft ?? this._context.viewLayout.getCurrentScrollLeft()) * dpr;\n\t\tthis._scrollOffsetValueBuffer[1] = (e?.scrollTop ?? this._context.viewLayout.getCurrentScrollTop()) * dpr;\n\t\tthis._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer as Float32Array<ArrayBuffer>);\n\t\treturn true;\n\t}\n\n\tpublic override onThemeChanged(e: ViewThemeChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onLineMappingChanged(e: ViewLineMappingChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic override onZonesChanged(e: ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// #endregion\n\n\treset() {\n\t\tfor (const bufferIndex of [0, 1]) {\n\t\t\t// Zero out buffer and upload to GPU to prevent stale rows from rendering\n\t\t\tconst buffer = new Float32Array(this._cellValueBuffers[bufferIndex]);\n\t\t\tbuffer.fill(0, 0, buffer.length);\n\t\t\tthis._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength);\n\t\t}\n\t\tthis._lastViewportLineCount = 0;\n\t}\n\n\tupdate(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number {\n\t\t// IMPORTANT: This is a hot function. Variables are pre-allocated and shared within the\n\t\t// loop. This is done so we don't need to trust the JIT compiler to do this optimization to\n\t\t// avoid potential additional blocking time in garbage collector which is a common cause of\n\t\t// dropped frames.\n\n\t\tlet chars = '';\n\t\tlet segment: string | undefined;\n\t\tlet charWidth = 0;\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tlet absoluteOffsetX = 0;\n\t\tlet absoluteOffsetY = 0;\n\t\tlet tabXOffset = 0;\n\t\tlet glyph: Readonly<ITextureAtlasPageGlyph>;\n\t\tlet cellIndex = 0;\n\n\t\tlet tokenStartIndex = 0;\n\t\tlet tokenEndIndex = 0;\n\t\tlet tokenMetadata = 0;\n\n\t\tlet decorationStyleSetBold: boolean | undefined;\n\t\tlet decorationStyleSetColor: number | undefined;\n\t\tlet decorationStyleSetOpacity: number | undefined;\n\t\tlet decorationStyleSetStrikethrough: boolean | undefined;\n\t\tlet decorationStyleSetStrikethroughThickness: number | undefined;\n\t\tlet decorationStyleSetStrikethroughColor: number | undefined;\n\n\t\tlet lineData: ViewLineRenderingData;\n\t\tlet decoration: InlineDecoration;\n\t\tlet fillStartIndex = 0;\n\t\tlet fillEndIndex = 0;\n\n\t\tlet tokens: IViewLineTokens;\n\n\t\tconst dpr = getActiveWindow().devicePixelRatio;\n\t\tlet contentSegmenter: IContentSegmenter;\n\n\t\tif (!this._scrollInitialized) {\n\t\t\tthis.onScrollChanged();\n\t\t\tthis._scrollInitialized = true;\n\t\t}\n\n\t\t// Zero out cell buffer or rebuild if needed\n\t\tif (this._cellBindBufferLineCapacity < viewportData.endLineNumber - viewportData.startLineNumber + 1) {\n\t\t\tthis._rebuildCellBuffer(viewportData.endLineNumber - viewportData.startLineNumber + 1);\n\t\t}\n\t\tconst cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);\n\t\tcellBuffer.fill(0);\n\n\t\tconst lineIndexCount = ViewportRenderStrategy.maxSupportedColumns * Constants.IndicesPerCell;\n\n\t\tfor (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) {\n\n\t\t\t// Only attempt to render lines that the GPU renderer can handle\n\t\t\tif (!this._viewGpuContext.canRender(viewLineOptions, viewportData, y)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlineData = viewportData.getViewLineRenderingData(y);\n\t\t\ttabXOffset = 0;\n\n\t\t\tcontentSegmenter = createContentSegmenter(lineData, viewLineOptions);\n\t\t\tcharWidth = viewLineOptions.spaceWidth * dpr;\n\t\t\tabsoluteOffsetX = (lineData.minColumn - 1) * charWidth;\n\n\t\t\ttokens = lineData.tokens;\n\t\t\ttokenStartIndex = lineData.minColumn - 1;\n\t\t\ttokenEndIndex = 0;\n\t\t\tfor (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n\t\t\t\ttokenEndIndex = tokens.getEndOffset(tokenIndex);\n\t\t\t\tif (tokenEndIndex <= tokenStartIndex) {\n\t\t\t\t\t// The faux indent part of the line should have no token type\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttokenMetadata = tokens.getMetadata(tokenIndex);\n\n\t\t\t\tfor (x = tokenStartIndex; x < tokenEndIndex; x++) {\n\t\t\t\t\t// Only render lines that do not exceed maximum columns\n\t\t\t\t\tif (x > ViewportRenderStrategy.maxSupportedColumns) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegment = contentSegmenter.getSegmentAtIndex(x);\n\t\t\t\t\tif (segment === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tchars = segment;\n\n\t\t\t\t\tif (!(lineData.isBasicASCII && viewLineOptions.useMonospaceOptimizations)) {\n\t\t\t\t\t\tcharWidth = this.glyphRasterizer.getTextMetrics(chars).width;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorationStyleSetColor = undefined;\n\t\t\t\t\tdecorationStyleSetBold = undefined;\n\t\t\t\t\tdecorationStyleSetOpacity = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethrough = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughThickness = undefined;\n\t\t\t\t\tdecorationStyleSetStrikethroughColor = undefined;\n\n\t\t\t\t\t// Apply supported inline decoration styles to the cell metadata\n\t\t\t\t\tfor (decoration of lineData.inlineDecorations) {\n\t\t\t\t\t\t// This is Range.strictContainsPosition except it works at the cell level,\n\t\t\t\t\t\t// it's also inlined to avoid overhead.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(y < decoration.range.startLineNumber || y > decoration.range.endLineNumber) ||\n\t\t\t\t\t\t\t(y === decoration.range.startLineNumber && x < decoration.range.startColumn - 1) ||\n\t\t\t\t\t\t\t(y === decoration.range.endLineNumber && x >= decoration.range.endColumn - 1)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst rules = ViewGpuContext.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, decoration.inlineClassName);\n\t\t\t\t\t\tfor (const rule of rules) {\n\t\t\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\t\t\tconst value = rule.styleMap.get(r)?.toString() ?? '';\n\t\t\t\t\t\t\t\tswitch (r) {\n\t\t\t\t\t\t\t\t\tcase 'color': {\n\t\t\t\t\t\t\t\t\t\t// TODO: This parsing and error handling should move into canRender so fallback\n\t\t\t\t\t\t\t\t\t\t// to DOM works\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(value);\n\t\t\t\t\t\t\t\t\t\tif (!parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new BugIndicatingError('Invalid color format ' + value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'font-weight': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssFontWeight(value);\n\t\t\t\t\t\t\t\t\t\tif (parsedValue >= 400) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = true;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set bold (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetBold = false;\n\t\t\t\t\t\t\t\t\t\t\t// TODO: Set normal (https://github.com/microsoft/vscode/issues/237584)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'opacity': {\n\t\t\t\t\t\t\t\t\t\tconst parsedValue = parseCssOpacity(value);\n\t\t\t\t\t\t\t\t\t\tdecorationStyleSetOpacity = parsedValue;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration':\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-line': {\n\t\t\t\t\t\t\t\t\t\tif (value === 'line-through') {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethrough = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-thickness': {\n\t\t\t\t\t\t\t\t\t\tconst match = value.match(/^(\\d+(?:\\.\\d+)?)px$/);\n\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughThickness = parseFloat(match[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-color': {\n\t\t\t\t\t\t\t\t\t\tlet colorValue = value;\n\t\t\t\t\t\t\t\t\t\tconst varMatch = value.match(/^var\\((--[^,]+),\\s*(?:initial|inherit)\\)$/);\n\t\t\t\t\t\t\t\t\t\tif (varMatch) {\n\t\t\t\t\t\t\t\t\t\t\tcolorValue = ViewGpuContext.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode, varMatch[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst parsedColor = Color.Format.CSS.parse(colorValue);\n\t\t\t\t\t\t\t\t\t\tif (parsedColor) {\n\t\t\t\t\t\t\t\t\t\t\tdecorationStyleSetStrikethroughColor = parsedColor.toNumber32Bit();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase 'text-decoration-style': {\n\t\t\t\t\t\t\t\t\t\t// These are validated in canRender and use default behavior\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new BugIndicatingError('Unexpected inline decoration style');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chars === ' ' || chars === '\\t') {\n\t\t\t\t\t\t// Zero out glyph to ensure it doesn't get rendered\n\t\t\t\t\t\tcellIndex = ((y - 1) * ViewportRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\t\tcellBuffer.fill(0, cellIndex, cellIndex + CellBufferInfo.FloatsPerEntry);\n\t\t\t\t\t\t// Adjust xOffset for tab stops\n\t\t\t\t\t\tif (chars === '\\t') {\n\t\t\t\t\t\t\t// Find the pixel offset between the current position and the next tab stop\n\t\t\t\t\t\t\tconst offsetBefore = x + tabXOffset;\n\t\t\t\t\t\t\ttabXOffset = CursorColumns.nextRenderTabStop(x + tabXOffset, lineData.tabSize);\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth * (tabXOffset - offsetBefore);\n\t\t\t\t\t\t\t// Convert back to offset excluding x and the current character\n\t\t\t\t\t\t\ttabXOffset -= x + 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst decorationStyleSetId = ViewGpuContext.decorationStyleCache.getOrCreateEntry(decorationStyleSetColor, decorationStyleSetBold, decorationStyleSetOpacity, decorationStyleSetStrikethrough, decorationStyleSetStrikethroughThickness, decorationStyleSetStrikethroughColor);\n\t\t\t\t\tglyph = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, chars, tokenMetadata, decorationStyleSetId, absoluteOffsetX);\n\n\t\t\t\t\tabsoluteOffsetY = Math.round(\n\t\t\t\t\t\t// Top of layout box (includes line height)\n\t\t\t\t\t\tviewportData.relativeVerticalOffset[y - viewportData.startLineNumber] * dpr +\n\n\t\t\t\t\t\t// Delta from top of layout box (includes line height) to top of the inline box (no line height)\n\t\t\t\t\t\tMath.floor((viewportData.lineHeight * dpr - (glyph.fontBoundingBoxAscent + glyph.fontBoundingBoxDescent)) / 2) +\n\n\t\t\t\t\t\t// Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn\n\t\t\t\t\t\t// with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical\n\t\t\t\t\t\t// baseline.\n\t\t\t\t\t\tglyph.fontBoundingBoxAscent\n\t\t\t\t\t);\n\n\t\t\t\t\tcellIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns + x) * Constants.IndicesPerCell;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_X] = Math.floor(absoluteOffsetX);\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.Offset_Y] = absoluteOffsetY;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex;\n\t\t\t\t\tcellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex;\n\n\t\t\t\t\t// Adjust the x pixel offset for the next character\n\t\t\t\t\tabsoluteOffsetX += charWidth;\n\t\t\t\t}\n\n\t\t\t\ttokenStartIndex = tokenEndIndex;\n\t\t\t}\n\n\t\t\t// Clear to end of line\n\t\t\tfillStartIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns + tokenEndIndex) * Constants.IndicesPerCell;\n\t\t\tfillEndIndex = ((y - viewportData.startLineNumber) * ViewportRenderStrategy.maxSupportedColumns) * Constants.IndicesPerCell;\n\t\t\tcellBuffer.fill(0, fillStartIndex, fillEndIndex);\n\t\t}\n\n\t\tconst visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount;\n\t\tconst viewportLineCount = viewportData.endLineNumber - viewportData.startLineNumber + 1;\n\n\t\t// This render strategy always uploads the whole viewport\n\t\tthis._device.queue.writeBuffer(\n\t\t\tthis._cellBindBuffer,\n\t\t\t0,\n\t\t\tcellBuffer.buffer,\n\t\t\t0,\n\t\t\tvisibleObjectCount * Float32Array.BYTES_PER_ELEMENT\n\t\t);\n\n\t\t// Clear stale lines in GPU buffer if viewport shrunk\n\t\tif (viewportLineCount < this._lastViewportLineCount) {\n\t\t\tconst staleLineCount = this._lastViewportLineCount - viewportLineCount;\n\t\t\tconst staleStartOffset = visibleObjectCount * Float32Array.BYTES_PER_ELEMENT;\n\t\t\tconst staleByteCount = staleLineCount * lineIndexCount * Float32Array.BYTES_PER_ELEMENT;\n\t\t\t// Write zeros from the zeroed cellBuffer for the stale region\n\t\t\tthis._device.queue.writeBuffer(\n\t\t\t\tthis._cellBindBuffer,\n\t\t\t\tstaleStartOffset,\n\t\t\t\tcellBuffer.buffer,\n\t\t\t\tvisibleObjectCount * Float32Array.BYTES_PER_ELEMENT,\n\t\t\t\tstaleByteCount\n\t\t\t);\n\t\t}\n\t\tthis._lastViewportLineCount = viewportLineCount;\n\n\t\tthis._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1;\n\n\t\tthis._visibleObjectCount = visibleObjectCount;\n\n\t\treturn visibleObjectCount;\n\t}\n\n\tdraw(pass: GPURenderPassEncoder, viewportData: ViewportData): void {\n\t\tif (this._visibleObjectCount <= 0) {\n\t\t\tthrow new BugIndicatingError('Attempt to draw 0 objects');\n\t\t}\n\t\tpass.draw(quadVertices.length / 2, this._visibleObjectCount);\n\t}\n}\n\nfunction parseCssFontWeight(value: string) {\n\tswitch (value) {\n\t\tcase 'lighter':\n\t\tcase 'normal': return 400;\n\t\tcase 'bolder':\n\t\tcase 'bold': return 700;\n\t}\n\treturn parseInt(value);\n}\n\nfunction parseCssOpacity(value: string): number {\n\tif (value.endsWith('%')) {\n\t\treturn parseFloat(value.substring(0, value.length - 1)) / 100;\n\t}\n\tif (value.match(/^\\d+(?:\\.\\d*)/)) {\n\t\treturn parseFloat(value);\n\t}\n\treturn 1;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "monaco-editor-core",
3
3
  "private": false,
4
- "version": "0.56.0-dev-20260131",
4
+ "version": "0.56.0-dev-20260202",
5
5
  "description": "A browser based code editor",
6
6
  "author": "Microsoft Corporation",
7
7
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "bugs": {
15
15
  "url": "https://github.com/microsoft/vscode/issues"
16
16
  },
17
- "vscodeCommitId": "993c5c008e427a6ca655d99248acaca3afdab7ac",
17
+ "vscodeCommitId": "6e3bf5072fd9d74c54e44eeda37ba01ad09b5ee6",
18
18
  "dependencies": {
19
19
  "marked": "14.0.0",
20
20
  "dompurify": "3.2.7"