monaco-editor-core 0.54.0-dev-20250911 → 0.54.0-dev-20250913
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/menu/menu.js +2 -0
- package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +3 -0
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js +71 -0
- package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js.map +1 -0
- package/esm/vs/base/common/observableInternal/observables/baseObservable.js +4 -0
- package/esm/vs/base/common/observableInternal/observables/baseObservable.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +10 -0
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +3 -0
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +9 -0
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -1
- package/esm/vs/editor/browser/widget/diffEditor/commands.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +25 -0
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
- package/esm/vs/editor/common/core/ranges/lineRange.js +3 -0
- package/esm/vs/editor/common/core/ranges/lineRange.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +4 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +2 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionList.js +3 -0
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +2 -2
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputController.js +4 -0
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +12 -0
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +11 -5
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/package.json +6 -2
- package/version.txt +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/ranges/lineRange.ts","vs/editor/common/core/ranges/lineRange.ts"],"names":[],"mappings":"AAAA;;;gGAG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C,MAAM,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;YAEvC,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;gBACrB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC;YAED,IAAI,EAAE,CAAC,sBAAsB,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC;gBAC3D,EAAE,EAAE,CAAC;YACN,CAAC;iBAAM,CAAC;gBACP,EAAE,EAAE,CAAC;YACN,CAAC;QACF,CAAC;QAED,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,YAAY,CAAC,KAAa;QACzB,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;CACD","file":"lineRange.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 { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { OffsetRange } from './offsetRange.js';\nimport { Range } from '../range.js';\nimport { findFirstIdxMonotonousOrArrLen, findLastIdxMonotonous, findLastMonotonous } from '../../../../base/common/arraysFind.js';\nimport { Comparator, compareBy, numberComparator } from '../../../../base/common/arrays.js';\n\n/**\n * A range of lines (1-based).\n */\nexport class LineRange {\n\tpublic static ofLength(startLineNumber: number, length: number): LineRange {\n\t\treturn new LineRange(startLineNumber, startLineNumber + length);\n\t}\n\n\tpublic static fromRangeInclusive(range: Range): LineRange {\n\t\treturn new LineRange(range.startLineNumber, range.endLineNumber + 1);\n\t}\n\n\tpublic static readonly compareByStart: Comparator<LineRange> = compareBy(l => l.startLineNumber, numberComparator);\n\n\t/**\n\t * @param lineRanges An array of arrays of of sorted line ranges.\n\t */\n\tpublic static joinMany(lineRanges: readonly (readonly LineRange[])[]): readonly LineRange[] {\n\t\tif (lineRanges.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tlet result = new LineRangeSet(lineRanges[0].slice());\n\t\tfor (let i = 1; i < lineRanges.length; i++) {\n\t\t\tresult = result.getUnion(new LineRangeSet(lineRanges[i].slice()));\n\t\t}\n\t\treturn result.ranges;\n\t}\n\n\tpublic static join(lineRanges: LineRange[]): LineRange {\n\t\tif (lineRanges.length === 0) {\n\t\t\tthrow new BugIndicatingError('lineRanges cannot be empty');\n\t\t}\n\t\tlet startLineNumber = lineRanges[0].startLineNumber;\n\t\tlet endLineNumberExclusive = lineRanges[0].endLineNumberExclusive;\n\t\tfor (let i = 1; i < lineRanges.length; i++) {\n\t\t\tstartLineNumber = Math.min(startLineNumber, lineRanges[i].startLineNumber);\n\t\t\tendLineNumberExclusive = Math.max(endLineNumberExclusive, lineRanges[i].endLineNumberExclusive);\n\t\t}\n\t\treturn new LineRange(startLineNumber, endLineNumberExclusive);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic static deserialize(lineRange: ISerializedLineRange): LineRange {\n\t\treturn new LineRange(lineRange[0], lineRange[1]);\n\t}\n\n\t/**\n\t * The start line number.\n\t */\n\tpublic readonly startLineNumber: number;\n\n\t/**\n\t * The end line number (exclusive).\n\t */\n\tpublic readonly endLineNumberExclusive: number;\n\n\tconstructor(\n\t\tstartLineNumber: number,\n\t\tendLineNumberExclusive: number,\n\t) {\n\t\tif (startLineNumber > endLineNumberExclusive) {\n\t\t\tthrow new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`);\n\t\t}\n\t\tthis.startLineNumber = startLineNumber;\n\t\tthis.endLineNumberExclusive = endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Indicates if this line range contains the given line number.\n\t */\n\tpublic contains(lineNumber: number): boolean {\n\t\treturn this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Indicates if this line range is empty.\n\t */\n\tget isEmpty(): boolean {\n\t\treturn this.startLineNumber === this.endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Moves this line range by the given offset of line numbers.\n\t */\n\tpublic delta(offset: number): LineRange {\n\t\treturn new LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset);\n\t}\n\n\tpublic deltaLength(offset: number): LineRange {\n\t\treturn new LineRange(this.startLineNumber, this.endLineNumberExclusive + offset);\n\t}\n\n\t/**\n\t * The number of lines this line range spans.\n\t */\n\tpublic get length(): number {\n\t\treturn this.endLineNumberExclusive - this.startLineNumber;\n\t}\n\n\t/**\n\t * Creates a line range that combines this and the given line range.\n\t */\n\tpublic join(other: LineRange): LineRange {\n\t\treturn new LineRange(\n\t\t\tMath.min(this.startLineNumber, other.startLineNumber),\n\t\t\tMath.max(this.endLineNumberExclusive, other.endLineNumberExclusive)\n\t\t);\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[${this.startLineNumber},${this.endLineNumberExclusive})`;\n\t}\n\n\t/**\n\t * The resulting range is empty if the ranges do not intersect, but touch.\n\t * If the ranges don't even touch, the result is undefined.\n\t */\n\tpublic intersect(other: LineRange): LineRange | undefined {\n\t\tconst startLineNumber = Math.max(this.startLineNumber, other.startLineNumber);\n\t\tconst endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive);\n\t\tif (startLineNumber <= endLineNumberExclusive) {\n\t\t\treturn new LineRange(startLineNumber, endLineNumberExclusive);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic intersectsStrict(other: LineRange): boolean {\n\t\treturn this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive;\n\t}\n\n\tpublic intersectsOrTouches(other: LineRange): boolean {\n\t\treturn this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive;\n\t}\n\n\tpublic equals(b: LineRange): boolean {\n\t\treturn this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive;\n\t}\n\n\tpublic toInclusiveRange(): Range | null {\n\t\tif (this.isEmpty) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);\n\t}\n\n\t/**\n\t * @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position!\n\t*/\n\tpublic toExclusiveRange(): Range {\n\t\treturn new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1);\n\t}\n\n\tpublic mapToLineArray<T>(f: (lineNumber: number) => T): T[] {\n\t\tconst result: T[] = [];\n\t\tfor (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n\t\t\tresult.push(f(lineNumber));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic forEach(f: (lineNumber: number) => void): void {\n\t\tfor (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n\t\t\tf(lineNumber);\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic serialize(): ISerializedLineRange {\n\t\treturn [this.startLineNumber, this.endLineNumberExclusive];\n\t}\n\n\t/**\n\t * Converts this 1-based line range to a 0-based offset range (subtracts 1!).\n\t * @internal\n\t */\n\tpublic toOffsetRange(): OffsetRange {\n\t\treturn new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1);\n\t}\n\n\tpublic addMargin(marginTop: number, marginBottom: number): LineRange {\n\t\treturn new LineRange(\n\t\t\tthis.startLineNumber - marginTop,\n\t\t\tthis.endLineNumberExclusive + marginBottom\n\t\t);\n\t}\n}\n\nexport type ISerializedLineRange = [startLineNumber: number, endLineNumberExclusive: number];\n\n\nexport class LineRangeSet {\n\tconstructor(\n\t\t/**\n\t\t * Sorted by start line number.\n\t\t * No two line ranges are touching or intersecting.\n\t\t */\n\t\tprivate readonly _normalizedRanges: LineRange[] = []\n\t) {\n\t}\n\n\tget ranges(): readonly LineRange[] {\n\t\treturn this._normalizedRanges;\n\t}\n\n\taddRange(range: LineRange): void {\n\t\tif (range.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Idea: Find joinRange such that:\n\t\t// replaceRange = _normalizedRanges.replaceRange(joinRange, range.joinAll(joinRange.map(idx => this._normalizedRanges[idx])))\n\n\t\t// idx of first element that touches range or that is after range\n\t\tconst joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n\t\t// idx of element after { last element that touches range or that is before range }\n\t\tconst joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n\n\t\tif (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n\t\t\t// If there is no element that touches range, then joinRangeStartIdx === joinRangeEndIdxExclusive and that value is the index of the element after range\n\t\t\tthis._normalizedRanges.splice(joinRangeStartIdx, 0, range);\n\t\t} else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {\n\t\t\t// Else, there is an element that touches range and in this case it is both the first and last element. Thus we can replace it\n\t\t\tconst joinRange = this._normalizedRanges[joinRangeStartIdx];\n\t\t\tthis._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);\n\t\t} else {\n\t\t\t// First and last element are different - we need to replace the entire range\n\t\t\tconst joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);\n\t\t\tthis._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);\n\t\t}\n\t}\n\n\tcontains(lineNumber: number): boolean {\n\t\tconst rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber <= lineNumber);\n\t\treturn !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber;\n\t}\n\n\tintersects(range: LineRange): boolean {\n\t\tconst rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber < range.endLineNumberExclusive);\n\t\treturn !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber;\n\t}\n\n\tgetUnion(other: LineRangeSet): LineRangeSet {\n\t\tif (this._normalizedRanges.length === 0) {\n\t\t\treturn other;\n\t\t}\n\t\tif (other._normalizedRanges.length === 0) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst result: LineRange[] = [];\n\t\tlet i1 = 0;\n\t\tlet i2 = 0;\n\t\tlet current: LineRange | null = null;\n\t\twhile (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) {\n\t\t\tlet next: LineRange | null = null;\n\t\t\tif (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n\t\t\t\tconst lineRange1 = this._normalizedRanges[i1];\n\t\t\t\tconst lineRange2 = other._normalizedRanges[i2];\n\t\t\t\tif (lineRange1.startLineNumber < lineRange2.startLineNumber) {\n\t\t\t\t\tnext = lineRange1;\n\t\t\t\t\ti1++;\n\t\t\t\t} else {\n\t\t\t\t\tnext = lineRange2;\n\t\t\t\t\ti2++;\n\t\t\t\t}\n\t\t\t} else if (i1 < this._normalizedRanges.length) {\n\t\t\t\tnext = this._normalizedRanges[i1];\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\tnext = other._normalizedRanges[i2];\n\t\t\t\ti2++;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcurrent = next;\n\t\t\t} else {\n\t\t\t\tif (current.endLineNumberExclusive >= next.startLineNumber) {\n\t\t\t\t\t// merge\n\t\t\t\t\tcurrent = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));\n\t\t\t\t} else {\n\t\t\t\t\t// push\n\t\t\t\t\tresult.push(current);\n\t\t\t\t\tcurrent = next;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (current !== null) {\n\t\t\tresult.push(current);\n\t\t}\n\t\treturn new LineRangeSet(result);\n\t}\n\n\t/**\n\t * Subtracts all ranges in this set from `range` and returns the result.\n\t */\n\tsubtractFrom(range: LineRange): LineRangeSet {\n\t\t// idx of first element that touches range or that is after range\n\t\tconst joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n\t\t// idx of element after { last element that touches range or that is before range }\n\t\tconst joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n\n\t\tif (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n\t\t\treturn new LineRangeSet([range]);\n\t\t}\n\n\t\tconst result: LineRange[] = [];\n\t\tlet startLineNumber = range.startLineNumber;\n\t\tfor (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {\n\t\t\tconst r = this._normalizedRanges[i];\n\t\t\tif (r.startLineNumber > startLineNumber) {\n\t\t\t\tresult.push(new LineRange(startLineNumber, r.startLineNumber));\n\t\t\t}\n\t\t\tstartLineNumber = r.endLineNumberExclusive;\n\t\t}\n\t\tif (startLineNumber < range.endLineNumberExclusive) {\n\t\t\tresult.push(new LineRange(startLineNumber, range.endLineNumberExclusive));\n\t\t}\n\n\t\treturn new LineRangeSet(result);\n\t}\n\n\ttoString() {\n\t\treturn this._normalizedRanges.map(r => r.toString()).join(', ');\n\t}\n\n\tgetIntersection(other: LineRangeSet): LineRangeSet {\n\t\tconst result: LineRange[] = [];\n\n\t\tlet i1 = 0;\n\t\tlet i2 = 0;\n\t\twhile (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n\t\t\tconst r1 = this._normalizedRanges[i1];\n\t\t\tconst r2 = other._normalizedRanges[i2];\n\n\t\t\tconst i = r1.intersect(r2);\n\t\t\tif (i && !i.isEmpty) {\n\t\t\t\tresult.push(i);\n\t\t\t}\n\n\t\t\tif (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\ti2++;\n\t\t\t}\n\t\t}\n\n\t\treturn new LineRangeSet(result);\n\t}\n\n\tgetWithDelta(value: number): LineRangeSet {\n\t\treturn new LineRangeSet(this._normalizedRanges.map(r => r.delta(value)));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { OffsetRange } from './offsetRange.js';\nimport { Range } from '../range.js';\nimport { findFirstIdxMonotonousOrArrLen, findLastIdxMonotonous, findLastMonotonous } from '../../../../base/common/arraysFind.js';\nimport { Comparator, compareBy, numberComparator } from '../../../../base/common/arrays.js';\n\n/**\n * A range of lines (1-based).\n */\nexport class LineRange {\n\tpublic static ofLength(startLineNumber: number, length: number): LineRange {\n\t\treturn new LineRange(startLineNumber, startLineNumber + length);\n\t}\n\n\tpublic static fromRangeInclusive(range: Range): LineRange {\n\t\treturn new LineRange(range.startLineNumber, range.endLineNumber + 1);\n\t}\n\n\tpublic static readonly compareByStart: Comparator<LineRange> = compareBy(l => l.startLineNumber, numberComparator);\n\n\t/**\n\t * @param lineRanges An array of arrays of of sorted line ranges.\n\t */\n\tpublic static joinMany(lineRanges: readonly (readonly LineRange[])[]): readonly LineRange[] {\n\t\tif (lineRanges.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tlet result = new LineRangeSet(lineRanges[0].slice());\n\t\tfor (let i = 1; i < lineRanges.length; i++) {\n\t\t\tresult = result.getUnion(new LineRangeSet(lineRanges[i].slice()));\n\t\t}\n\t\treturn result.ranges;\n\t}\n\n\tpublic static join(lineRanges: LineRange[]): LineRange {\n\t\tif (lineRanges.length === 0) {\n\t\t\tthrow new BugIndicatingError('lineRanges cannot be empty');\n\t\t}\n\t\tlet startLineNumber = lineRanges[0].startLineNumber;\n\t\tlet endLineNumberExclusive = lineRanges[0].endLineNumberExclusive;\n\t\tfor (let i = 1; i < lineRanges.length; i++) {\n\t\t\tstartLineNumber = Math.min(startLineNumber, lineRanges[i].startLineNumber);\n\t\t\tendLineNumberExclusive = Math.max(endLineNumberExclusive, lineRanges[i].endLineNumberExclusive);\n\t\t}\n\t\treturn new LineRange(startLineNumber, endLineNumberExclusive);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic static deserialize(lineRange: ISerializedLineRange): LineRange {\n\t\treturn new LineRange(lineRange[0], lineRange[1]);\n\t}\n\n\t/**\n\t * The start line number.\n\t */\n\tpublic readonly startLineNumber: number;\n\n\t/**\n\t * The end line number (exclusive).\n\t */\n\tpublic readonly endLineNumberExclusive: number;\n\n\tconstructor(\n\t\tstartLineNumber: number,\n\t\tendLineNumberExclusive: number,\n\t) {\n\t\tif (startLineNumber > endLineNumberExclusive) {\n\t\t\tthrow new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`);\n\t\t}\n\t\tthis.startLineNumber = startLineNumber;\n\t\tthis.endLineNumberExclusive = endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Indicates if this line range contains the given line number.\n\t */\n\tpublic contains(lineNumber: number): boolean {\n\t\treturn this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Indicates if this line range is empty.\n\t */\n\tget isEmpty(): boolean {\n\t\treturn this.startLineNumber === this.endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Moves this line range by the given offset of line numbers.\n\t */\n\tpublic delta(offset: number): LineRange {\n\t\treturn new LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset);\n\t}\n\n\tpublic deltaLength(offset: number): LineRange {\n\t\treturn new LineRange(this.startLineNumber, this.endLineNumberExclusive + offset);\n\t}\n\n\t/**\n\t * The number of lines this line range spans.\n\t */\n\tpublic get length(): number {\n\t\treturn this.endLineNumberExclusive - this.startLineNumber;\n\t}\n\n\t/**\n\t * Creates a line range that combines this and the given line range.\n\t */\n\tpublic join(other: LineRange): LineRange {\n\t\treturn new LineRange(\n\t\t\tMath.min(this.startLineNumber, other.startLineNumber),\n\t\t\tMath.max(this.endLineNumberExclusive, other.endLineNumberExclusive)\n\t\t);\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[${this.startLineNumber},${this.endLineNumberExclusive})`;\n\t}\n\n\t/**\n\t * The resulting range is empty if the ranges do not intersect, but touch.\n\t * If the ranges don't even touch, the result is undefined.\n\t */\n\tpublic intersect(other: LineRange): LineRange | undefined {\n\t\tconst startLineNumber = Math.max(this.startLineNumber, other.startLineNumber);\n\t\tconst endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive);\n\t\tif (startLineNumber <= endLineNumberExclusive) {\n\t\t\treturn new LineRange(startLineNumber, endLineNumberExclusive);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic intersectsStrict(other: LineRange): boolean {\n\t\treturn this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive;\n\t}\n\n\tpublic intersectsOrTouches(other: LineRange): boolean {\n\t\treturn this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive;\n\t}\n\n\tpublic equals(b: LineRange): boolean {\n\t\treturn this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive;\n\t}\n\n\tpublic toInclusiveRange(): Range | null {\n\t\tif (this.isEmpty) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);\n\t}\n\n\t/**\n\t * @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position!\n\t*/\n\tpublic toExclusiveRange(): Range {\n\t\treturn new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1);\n\t}\n\n\tpublic mapToLineArray<T>(f: (lineNumber: number) => T): T[] {\n\t\tconst result: T[] = [];\n\t\tfor (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n\t\t\tresult.push(f(lineNumber));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic forEach(f: (lineNumber: number) => void): void {\n\t\tfor (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n\t\t\tf(lineNumber);\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic serialize(): ISerializedLineRange {\n\t\treturn [this.startLineNumber, this.endLineNumberExclusive];\n\t}\n\n\t/**\n\t * Converts this 1-based line range to a 0-based offset range (subtracts 1!).\n\t * @internal\n\t */\n\tpublic toOffsetRange(): OffsetRange {\n\t\treturn new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1);\n\t}\n\n\tpublic addMargin(marginTop: number, marginBottom: number): LineRange {\n\t\treturn new LineRange(\n\t\t\tthis.startLineNumber - marginTop,\n\t\t\tthis.endLineNumberExclusive + marginBottom\n\t\t);\n\t}\n}\n\nexport type ISerializedLineRange = [startLineNumber: number, endLineNumberExclusive: number];\n\n\nexport class LineRangeSet {\n\tconstructor(\n\t\t/**\n\t\t * Sorted by start line number.\n\t\t * No two line ranges are touching or intersecting.\n\t\t */\n\t\tprivate readonly _normalizedRanges: LineRange[] = []\n\t) {\n\t}\n\n\tget ranges(): readonly LineRange[] {\n\t\treturn this._normalizedRanges;\n\t}\n\n\taddRange(range: LineRange): void {\n\t\tif (range.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Idea: Find joinRange such that:\n\t\t// replaceRange = _normalizedRanges.replaceRange(joinRange, range.joinAll(joinRange.map(idx => this._normalizedRanges[idx])))\n\n\t\t// idx of first element that touches range or that is after range\n\t\tconst joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n\t\t// idx of element after { last element that touches range or that is before range }\n\t\tconst joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n\n\t\tif (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n\t\t\t// If there is no element that touches range, then joinRangeStartIdx === joinRangeEndIdxExclusive and that value is the index of the element after range\n\t\t\tthis._normalizedRanges.splice(joinRangeStartIdx, 0, range);\n\t\t} else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {\n\t\t\t// Else, there is an element that touches range and in this case it is both the first and last element. Thus we can replace it\n\t\t\tconst joinRange = this._normalizedRanges[joinRangeStartIdx];\n\t\t\tthis._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);\n\t\t} else {\n\t\t\t// First and last element are different - we need to replace the entire range\n\t\t\tconst joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);\n\t\t\tthis._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);\n\t\t}\n\t}\n\n\tcontains(lineNumber: number): boolean {\n\t\tconst rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber <= lineNumber);\n\t\treturn !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber;\n\t}\n\n\tintersects(range: LineRange): boolean {\n\t\tconst rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber < range.endLineNumberExclusive);\n\t\treturn !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber;\n\t}\n\n\tgetUnion(other: LineRangeSet): LineRangeSet {\n\t\tif (this._normalizedRanges.length === 0) {\n\t\t\treturn other;\n\t\t}\n\t\tif (other._normalizedRanges.length === 0) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst result: LineRange[] = [];\n\t\tlet i1 = 0;\n\t\tlet i2 = 0;\n\t\tlet current: LineRange | null = null;\n\t\twhile (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) {\n\t\t\tlet next: LineRange | null = null;\n\t\t\tif (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n\t\t\t\tconst lineRange1 = this._normalizedRanges[i1];\n\t\t\t\tconst lineRange2 = other._normalizedRanges[i2];\n\t\t\t\tif (lineRange1.startLineNumber < lineRange2.startLineNumber) {\n\t\t\t\t\tnext = lineRange1;\n\t\t\t\t\ti1++;\n\t\t\t\t} else {\n\t\t\t\t\tnext = lineRange2;\n\t\t\t\t\ti2++;\n\t\t\t\t}\n\t\t\t} else if (i1 < this._normalizedRanges.length) {\n\t\t\t\tnext = this._normalizedRanges[i1];\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\tnext = other._normalizedRanges[i2];\n\t\t\t\ti2++;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcurrent = next;\n\t\t\t} else {\n\t\t\t\tif (current.endLineNumberExclusive >= next.startLineNumber) {\n\t\t\t\t\t// merge\n\t\t\t\t\tcurrent = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));\n\t\t\t\t} else {\n\t\t\t\t\t// push\n\t\t\t\t\tresult.push(current);\n\t\t\t\t\tcurrent = next;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (current !== null) {\n\t\t\tresult.push(current);\n\t\t}\n\t\treturn new LineRangeSet(result);\n\t}\n\n\t/**\n\t * Subtracts all ranges in this set from `range` and returns the result.\n\t */\n\tsubtractFrom(range: LineRange): LineRangeSet {\n\t\t// idx of first element that touches range or that is after range\n\t\tconst joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n\t\t// idx of element after { last element that touches range or that is before range }\n\t\tconst joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n\n\t\tif (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n\t\t\treturn new LineRangeSet([range]);\n\t\t}\n\n\t\tconst result: LineRange[] = [];\n\t\tlet startLineNumber = range.startLineNumber;\n\t\tfor (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {\n\t\t\tconst r = this._normalizedRanges[i];\n\t\t\tif (r.startLineNumber > startLineNumber) {\n\t\t\t\tresult.push(new LineRange(startLineNumber, r.startLineNumber));\n\t\t\t}\n\t\t\tstartLineNumber = r.endLineNumberExclusive;\n\t\t}\n\t\tif (startLineNumber < range.endLineNumberExclusive) {\n\t\t\tresult.push(new LineRange(startLineNumber, range.endLineNumberExclusive));\n\t\t}\n\n\t\treturn new LineRangeSet(result);\n\t}\n\n\ttoString() {\n\t\treturn this._normalizedRanges.map(r => r.toString()).join(', ');\n\t}\n\n\tgetIntersection(other: LineRangeSet): LineRangeSet {\n\t\tconst result: LineRange[] = [];\n\n\t\tlet i1 = 0;\n\t\tlet i2 = 0;\n\t\twhile (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n\t\t\tconst r1 = this._normalizedRanges[i1];\n\t\t\tconst r2 = other._normalizedRanges[i2];\n\n\t\t\tconst i = r1.intersect(r2);\n\t\t\tif (i && !i.isEmpty) {\n\t\t\t\tresult.push(i);\n\t\t\t}\n\n\t\t\tif (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\ti2++;\n\t\t\t}\n\t\t}\n\n\t\treturn new LineRangeSet(result);\n\t}\n\n\tgetWithDelta(value: number): LineRangeSet {\n\t\treturn new LineRangeSet(this._normalizedRanges.map(r => r.delta(value)));\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/ranges/lineRange.ts","v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OAAO,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,IAAI,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;YAClF,MAAM,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;YACtC,MAAM,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;YAEvC,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;gBACrB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC;YAED,IAAI,EAAE,CAAC,sBAAsB,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC;gBAC3D,EAAE,EAAE,CAAC;YACN,CAAC;iBAAM,CAAC;gBACP,EAAE,EAAE,CAAC;YACN,CAAC;QACF,CAAC;QAED,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,YAAY,CAAC,KAAa;QACzB,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;CACD","file":"lineRange.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 { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { OffsetRange } from './offsetRange.js';\nimport { Range } from '../range.js';\nimport { findFirstIdxMonotonousOrArrLen, findLastIdxMonotonous, findLastMonotonous } from '../../../../base/common/arraysFind.js';\nimport { Comparator, compareBy, numberComparator } from '../../../../base/common/arrays.js';\n\n/**\n * A range of lines (1-based).\n */\nexport class LineRange {\n\tpublic static ofLength(startLineNumber: number, length: number): LineRange {\n\t\treturn new LineRange(startLineNumber, startLineNumber + length);\n\t}\n\n\tpublic static fromRange(range: Range): LineRange {\n\t\treturn new LineRange(range.startLineNumber, range.endLineNumber);\n\t}\n\n\tpublic static fromRangeInclusive(range: Range): LineRange {\n\t\treturn new LineRange(range.startLineNumber, range.endLineNumber + 1);\n\t}\n\n\tpublic static readonly compareByStart: Comparator<LineRange> = compareBy(l => l.startLineNumber, numberComparator);\n\n\t/**\n\t * @param lineRanges An array of arrays of of sorted line ranges.\n\t */\n\tpublic static joinMany(lineRanges: readonly (readonly LineRange[])[]): readonly LineRange[] {\n\t\tif (lineRanges.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tlet result = new LineRangeSet(lineRanges[0].slice());\n\t\tfor (let i = 1; i < lineRanges.length; i++) {\n\t\t\tresult = result.getUnion(new LineRangeSet(lineRanges[i].slice()));\n\t\t}\n\t\treturn result.ranges;\n\t}\n\n\tpublic static join(lineRanges: LineRange[]): LineRange {\n\t\tif (lineRanges.length === 0) {\n\t\t\tthrow new BugIndicatingError('lineRanges cannot be empty');\n\t\t}\n\t\tlet startLineNumber = lineRanges[0].startLineNumber;\n\t\tlet endLineNumberExclusive = lineRanges[0].endLineNumberExclusive;\n\t\tfor (let i = 1; i < lineRanges.length; i++) {\n\t\t\tstartLineNumber = Math.min(startLineNumber, lineRanges[i].startLineNumber);\n\t\t\tendLineNumberExclusive = Math.max(endLineNumberExclusive, lineRanges[i].endLineNumberExclusive);\n\t\t}\n\t\treturn new LineRange(startLineNumber, endLineNumberExclusive);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic static deserialize(lineRange: ISerializedLineRange): LineRange {\n\t\treturn new LineRange(lineRange[0], lineRange[1]);\n\t}\n\n\t/**\n\t * The start line number.\n\t */\n\tpublic readonly startLineNumber: number;\n\n\t/**\n\t * The end line number (exclusive).\n\t */\n\tpublic readonly endLineNumberExclusive: number;\n\n\tconstructor(\n\t\tstartLineNumber: number,\n\t\tendLineNumberExclusive: number,\n\t) {\n\t\tif (startLineNumber > endLineNumberExclusive) {\n\t\t\tthrow new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`);\n\t\t}\n\t\tthis.startLineNumber = startLineNumber;\n\t\tthis.endLineNumberExclusive = endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Indicates if this line range contains the given line number.\n\t */\n\tpublic contains(lineNumber: number): boolean {\n\t\treturn this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Indicates if this line range is empty.\n\t */\n\tget isEmpty(): boolean {\n\t\treturn this.startLineNumber === this.endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Moves this line range by the given offset of line numbers.\n\t */\n\tpublic delta(offset: number): LineRange {\n\t\treturn new LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset);\n\t}\n\n\tpublic deltaLength(offset: number): LineRange {\n\t\treturn new LineRange(this.startLineNumber, this.endLineNumberExclusive + offset);\n\t}\n\n\t/**\n\t * The number of lines this line range spans.\n\t */\n\tpublic get length(): number {\n\t\treturn this.endLineNumberExclusive - this.startLineNumber;\n\t}\n\n\t/**\n\t * Creates a line range that combines this and the given line range.\n\t */\n\tpublic join(other: LineRange): LineRange {\n\t\treturn new LineRange(\n\t\t\tMath.min(this.startLineNumber, other.startLineNumber),\n\t\t\tMath.max(this.endLineNumberExclusive, other.endLineNumberExclusive)\n\t\t);\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[${this.startLineNumber},${this.endLineNumberExclusive})`;\n\t}\n\n\t/**\n\t * The resulting range is empty if the ranges do not intersect, but touch.\n\t * If the ranges don't even touch, the result is undefined.\n\t */\n\tpublic intersect(other: LineRange): LineRange | undefined {\n\t\tconst startLineNumber = Math.max(this.startLineNumber, other.startLineNumber);\n\t\tconst endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive);\n\t\tif (startLineNumber <= endLineNumberExclusive) {\n\t\t\treturn new LineRange(startLineNumber, endLineNumberExclusive);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic intersectsStrict(other: LineRange): boolean {\n\t\treturn this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive;\n\t}\n\n\tpublic intersectsOrTouches(other: LineRange): boolean {\n\t\treturn this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive;\n\t}\n\n\tpublic equals(b: LineRange): boolean {\n\t\treturn this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive;\n\t}\n\n\tpublic toInclusiveRange(): Range | null {\n\t\tif (this.isEmpty) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);\n\t}\n\n\t/**\n\t * @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position!\n\t*/\n\tpublic toExclusiveRange(): Range {\n\t\treturn new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1);\n\t}\n\n\tpublic mapToLineArray<T>(f: (lineNumber: number) => T): T[] {\n\t\tconst result: T[] = [];\n\t\tfor (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n\t\t\tresult.push(f(lineNumber));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic forEach(f: (lineNumber: number) => void): void {\n\t\tfor (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n\t\t\tf(lineNumber);\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic serialize(): ISerializedLineRange {\n\t\treturn [this.startLineNumber, this.endLineNumberExclusive];\n\t}\n\n\t/**\n\t * Converts this 1-based line range to a 0-based offset range (subtracts 1!).\n\t * @internal\n\t */\n\tpublic toOffsetRange(): OffsetRange {\n\t\treturn new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1);\n\t}\n\n\tpublic addMargin(marginTop: number, marginBottom: number): LineRange {\n\t\treturn new LineRange(\n\t\t\tthis.startLineNumber - marginTop,\n\t\t\tthis.endLineNumberExclusive + marginBottom\n\t\t);\n\t}\n}\n\nexport type ISerializedLineRange = [startLineNumber: number, endLineNumberExclusive: number];\n\n\nexport class LineRangeSet {\n\tconstructor(\n\t\t/**\n\t\t * Sorted by start line number.\n\t\t * No two line ranges are touching or intersecting.\n\t\t */\n\t\tprivate readonly _normalizedRanges: LineRange[] = []\n\t) {\n\t}\n\n\tget ranges(): readonly LineRange[] {\n\t\treturn this._normalizedRanges;\n\t}\n\n\taddRange(range: LineRange): void {\n\t\tif (range.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Idea: Find joinRange such that:\n\t\t// replaceRange = _normalizedRanges.replaceRange(joinRange, range.joinAll(joinRange.map(idx => this._normalizedRanges[idx])))\n\n\t\t// idx of first element that touches range or that is after range\n\t\tconst joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n\t\t// idx of element after { last element that touches range or that is before range }\n\t\tconst joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n\n\t\tif (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n\t\t\t// If there is no element that touches range, then joinRangeStartIdx === joinRangeEndIdxExclusive and that value is the index of the element after range\n\t\t\tthis._normalizedRanges.splice(joinRangeStartIdx, 0, range);\n\t\t} else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {\n\t\t\t// Else, there is an element that touches range and in this case it is both the first and last element. Thus we can replace it\n\t\t\tconst joinRange = this._normalizedRanges[joinRangeStartIdx];\n\t\t\tthis._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);\n\t\t} else {\n\t\t\t// First and last element are different - we need to replace the entire range\n\t\t\tconst joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);\n\t\t\tthis._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);\n\t\t}\n\t}\n\n\tcontains(lineNumber: number): boolean {\n\t\tconst rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber <= lineNumber);\n\t\treturn !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber;\n\t}\n\n\tintersects(range: LineRange): boolean {\n\t\tconst rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber < range.endLineNumberExclusive);\n\t\treturn !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber;\n\t}\n\n\tgetUnion(other: LineRangeSet): LineRangeSet {\n\t\tif (this._normalizedRanges.length === 0) {\n\t\t\treturn other;\n\t\t}\n\t\tif (other._normalizedRanges.length === 0) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst result: LineRange[] = [];\n\t\tlet i1 = 0;\n\t\tlet i2 = 0;\n\t\tlet current: LineRange | null = null;\n\t\twhile (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) {\n\t\t\tlet next: LineRange | null = null;\n\t\t\tif (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n\t\t\t\tconst lineRange1 = this._normalizedRanges[i1];\n\t\t\t\tconst lineRange2 = other._normalizedRanges[i2];\n\t\t\t\tif (lineRange1.startLineNumber < lineRange2.startLineNumber) {\n\t\t\t\t\tnext = lineRange1;\n\t\t\t\t\ti1++;\n\t\t\t\t} else {\n\t\t\t\t\tnext = lineRange2;\n\t\t\t\t\ti2++;\n\t\t\t\t}\n\t\t\t} else if (i1 < this._normalizedRanges.length) {\n\t\t\t\tnext = this._normalizedRanges[i1];\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\tnext = other._normalizedRanges[i2];\n\t\t\t\ti2++;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcurrent = next;\n\t\t\t} else {\n\t\t\t\tif (current.endLineNumberExclusive >= next.startLineNumber) {\n\t\t\t\t\t// merge\n\t\t\t\t\tcurrent = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));\n\t\t\t\t} else {\n\t\t\t\t\t// push\n\t\t\t\t\tresult.push(current);\n\t\t\t\t\tcurrent = next;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (current !== null) {\n\t\t\tresult.push(current);\n\t\t}\n\t\treturn new LineRangeSet(result);\n\t}\n\n\t/**\n\t * Subtracts all ranges in this set from `range` and returns the result.\n\t */\n\tsubtractFrom(range: LineRange): LineRangeSet {\n\t\t// idx of first element that touches range or that is after range\n\t\tconst joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n\t\t// idx of element after { last element that touches range or that is before range }\n\t\tconst joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n\n\t\tif (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n\t\t\treturn new LineRangeSet([range]);\n\t\t}\n\n\t\tconst result: LineRange[] = [];\n\t\tlet startLineNumber = range.startLineNumber;\n\t\tfor (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {\n\t\t\tconst r = this._normalizedRanges[i];\n\t\t\tif (r.startLineNumber > startLineNumber) {\n\t\t\t\tresult.push(new LineRange(startLineNumber, r.startLineNumber));\n\t\t\t}\n\t\t\tstartLineNumber = r.endLineNumberExclusive;\n\t\t}\n\t\tif (startLineNumber < range.endLineNumberExclusive) {\n\t\t\tresult.push(new LineRange(startLineNumber, range.endLineNumberExclusive));\n\t\t}\n\n\t\treturn new LineRangeSet(result);\n\t}\n\n\ttoString() {\n\t\treturn this._normalizedRanges.map(r => r.toString()).join(', ');\n\t}\n\n\tgetIntersection(other: LineRangeSet): LineRangeSet {\n\t\tconst result: LineRange[] = [];\n\n\t\tlet i1 = 0;\n\t\tlet i2 = 0;\n\t\twhile (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n\t\t\tconst r1 = this._normalizedRanges[i1];\n\t\t\tconst r2 = other._normalizedRanges[i2];\n\n\t\t\tconst i = r1.intersect(r2);\n\t\t\tif (i && !i.isEmpty) {\n\t\t\t\tresult.push(i);\n\t\t\t}\n\n\t\t\tif (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\ti2++;\n\t\t\t}\n\t\t}\n\n\t\treturn new LineRangeSet(result);\n\t}\n\n\tgetWithDelta(value: number): LineRangeSet {\n\t\treturn new LineRangeSet(this._normalizedRanges.map(r => r.delta(value)));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { OffsetRange } from './offsetRange.js';\nimport { Range } from '../range.js';\nimport { findFirstIdxMonotonousOrArrLen, findLastIdxMonotonous, findLastMonotonous } from '../../../../base/common/arraysFind.js';\nimport { Comparator, compareBy, numberComparator } from '../../../../base/common/arrays.js';\n\n/**\n * A range of lines (1-based).\n */\nexport class LineRange {\n\tpublic static ofLength(startLineNumber: number, length: number): LineRange {\n\t\treturn new LineRange(startLineNumber, startLineNumber + length);\n\t}\n\n\tpublic static fromRange(range: Range): LineRange {\n\t\treturn new LineRange(range.startLineNumber, range.endLineNumber);\n\t}\n\n\tpublic static fromRangeInclusive(range: Range): LineRange {\n\t\treturn new LineRange(range.startLineNumber, range.endLineNumber + 1);\n\t}\n\n\tpublic static readonly compareByStart: Comparator<LineRange> = compareBy(l => l.startLineNumber, numberComparator);\n\n\t/**\n\t * @param lineRanges An array of arrays of of sorted line ranges.\n\t */\n\tpublic static joinMany(lineRanges: readonly (readonly LineRange[])[]): readonly LineRange[] {\n\t\tif (lineRanges.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tlet result = new LineRangeSet(lineRanges[0].slice());\n\t\tfor (let i = 1; i < lineRanges.length; i++) {\n\t\t\tresult = result.getUnion(new LineRangeSet(lineRanges[i].slice()));\n\t\t}\n\t\treturn result.ranges;\n\t}\n\n\tpublic static join(lineRanges: LineRange[]): LineRange {\n\t\tif (lineRanges.length === 0) {\n\t\t\tthrow new BugIndicatingError('lineRanges cannot be empty');\n\t\t}\n\t\tlet startLineNumber = lineRanges[0].startLineNumber;\n\t\tlet endLineNumberExclusive = lineRanges[0].endLineNumberExclusive;\n\t\tfor (let i = 1; i < lineRanges.length; i++) {\n\t\t\tstartLineNumber = Math.min(startLineNumber, lineRanges[i].startLineNumber);\n\t\t\tendLineNumberExclusive = Math.max(endLineNumberExclusive, lineRanges[i].endLineNumberExclusive);\n\t\t}\n\t\treturn new LineRange(startLineNumber, endLineNumberExclusive);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic static deserialize(lineRange: ISerializedLineRange): LineRange {\n\t\treturn new LineRange(lineRange[0], lineRange[1]);\n\t}\n\n\t/**\n\t * The start line number.\n\t */\n\tpublic readonly startLineNumber: number;\n\n\t/**\n\t * The end line number (exclusive).\n\t */\n\tpublic readonly endLineNumberExclusive: number;\n\n\tconstructor(\n\t\tstartLineNumber: number,\n\t\tendLineNumberExclusive: number,\n\t) {\n\t\tif (startLineNumber > endLineNumberExclusive) {\n\t\t\tthrow new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`);\n\t\t}\n\t\tthis.startLineNumber = startLineNumber;\n\t\tthis.endLineNumberExclusive = endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Indicates if this line range contains the given line number.\n\t */\n\tpublic contains(lineNumber: number): boolean {\n\t\treturn this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Indicates if this line range is empty.\n\t */\n\tget isEmpty(): boolean {\n\t\treturn this.startLineNumber === this.endLineNumberExclusive;\n\t}\n\n\t/**\n\t * Moves this line range by the given offset of line numbers.\n\t */\n\tpublic delta(offset: number): LineRange {\n\t\treturn new LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset);\n\t}\n\n\tpublic deltaLength(offset: number): LineRange {\n\t\treturn new LineRange(this.startLineNumber, this.endLineNumberExclusive + offset);\n\t}\n\n\t/**\n\t * The number of lines this line range spans.\n\t */\n\tpublic get length(): number {\n\t\treturn this.endLineNumberExclusive - this.startLineNumber;\n\t}\n\n\t/**\n\t * Creates a line range that combines this and the given line range.\n\t */\n\tpublic join(other: LineRange): LineRange {\n\t\treturn new LineRange(\n\t\t\tMath.min(this.startLineNumber, other.startLineNumber),\n\t\t\tMath.max(this.endLineNumberExclusive, other.endLineNumberExclusive)\n\t\t);\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[${this.startLineNumber},${this.endLineNumberExclusive})`;\n\t}\n\n\t/**\n\t * The resulting range is empty if the ranges do not intersect, but touch.\n\t * If the ranges don't even touch, the result is undefined.\n\t */\n\tpublic intersect(other: LineRange): LineRange | undefined {\n\t\tconst startLineNumber = Math.max(this.startLineNumber, other.startLineNumber);\n\t\tconst endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive);\n\t\tif (startLineNumber <= endLineNumberExclusive) {\n\t\t\treturn new LineRange(startLineNumber, endLineNumberExclusive);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic intersectsStrict(other: LineRange): boolean {\n\t\treturn this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive;\n\t}\n\n\tpublic intersectsOrTouches(other: LineRange): boolean {\n\t\treturn this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive;\n\t}\n\n\tpublic equals(b: LineRange): boolean {\n\t\treturn this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive;\n\t}\n\n\tpublic toInclusiveRange(): Range | null {\n\t\tif (this.isEmpty) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);\n\t}\n\n\t/**\n\t * @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position!\n\t*/\n\tpublic toExclusiveRange(): Range {\n\t\treturn new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1);\n\t}\n\n\tpublic mapToLineArray<T>(f: (lineNumber: number) => T): T[] {\n\t\tconst result: T[] = [];\n\t\tfor (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n\t\t\tresult.push(f(lineNumber));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic forEach(f: (lineNumber: number) => void): void {\n\t\tfor (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n\t\t\tf(lineNumber);\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic serialize(): ISerializedLineRange {\n\t\treturn [this.startLineNumber, this.endLineNumberExclusive];\n\t}\n\n\t/**\n\t * Converts this 1-based line range to a 0-based offset range (subtracts 1!).\n\t * @internal\n\t */\n\tpublic toOffsetRange(): OffsetRange {\n\t\treturn new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1);\n\t}\n\n\tpublic addMargin(marginTop: number, marginBottom: number): LineRange {\n\t\treturn new LineRange(\n\t\t\tthis.startLineNumber - marginTop,\n\t\t\tthis.endLineNumberExclusive + marginBottom\n\t\t);\n\t}\n}\n\nexport type ISerializedLineRange = [startLineNumber: number, endLineNumberExclusive: number];\n\n\nexport class LineRangeSet {\n\tconstructor(\n\t\t/**\n\t\t * Sorted by start line number.\n\t\t * No two line ranges are touching or intersecting.\n\t\t */\n\t\tprivate readonly _normalizedRanges: LineRange[] = []\n\t) {\n\t}\n\n\tget ranges(): readonly LineRange[] {\n\t\treturn this._normalizedRanges;\n\t}\n\n\taddRange(range: LineRange): void {\n\t\tif (range.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Idea: Find joinRange such that:\n\t\t// replaceRange = _normalizedRanges.replaceRange(joinRange, range.joinAll(joinRange.map(idx => this._normalizedRanges[idx])))\n\n\t\t// idx of first element that touches range or that is after range\n\t\tconst joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n\t\t// idx of element after { last element that touches range or that is before range }\n\t\tconst joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n\n\t\tif (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n\t\t\t// If there is no element that touches range, then joinRangeStartIdx === joinRangeEndIdxExclusive and that value is the index of the element after range\n\t\t\tthis._normalizedRanges.splice(joinRangeStartIdx, 0, range);\n\t\t} else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {\n\t\t\t// Else, there is an element that touches range and in this case it is both the first and last element. Thus we can replace it\n\t\t\tconst joinRange = this._normalizedRanges[joinRangeStartIdx];\n\t\t\tthis._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);\n\t\t} else {\n\t\t\t// First and last element are different - we need to replace the entire range\n\t\t\tconst joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);\n\t\t\tthis._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);\n\t\t}\n\t}\n\n\tcontains(lineNumber: number): boolean {\n\t\tconst rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber <= lineNumber);\n\t\treturn !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber;\n\t}\n\n\tintersects(range: LineRange): boolean {\n\t\tconst rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber < range.endLineNumberExclusive);\n\t\treturn !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber;\n\t}\n\n\tgetUnion(other: LineRangeSet): LineRangeSet {\n\t\tif (this._normalizedRanges.length === 0) {\n\t\t\treturn other;\n\t\t}\n\t\tif (other._normalizedRanges.length === 0) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst result: LineRange[] = [];\n\t\tlet i1 = 0;\n\t\tlet i2 = 0;\n\t\tlet current: LineRange | null = null;\n\t\twhile (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) {\n\t\t\tlet next: LineRange | null = null;\n\t\t\tif (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n\t\t\t\tconst lineRange1 = this._normalizedRanges[i1];\n\t\t\t\tconst lineRange2 = other._normalizedRanges[i2];\n\t\t\t\tif (lineRange1.startLineNumber < lineRange2.startLineNumber) {\n\t\t\t\t\tnext = lineRange1;\n\t\t\t\t\ti1++;\n\t\t\t\t} else {\n\t\t\t\t\tnext = lineRange2;\n\t\t\t\t\ti2++;\n\t\t\t\t}\n\t\t\t} else if (i1 < this._normalizedRanges.length) {\n\t\t\t\tnext = this._normalizedRanges[i1];\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\tnext = other._normalizedRanges[i2];\n\t\t\t\ti2++;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcurrent = next;\n\t\t\t} else {\n\t\t\t\tif (current.endLineNumberExclusive >= next.startLineNumber) {\n\t\t\t\t\t// merge\n\t\t\t\t\tcurrent = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));\n\t\t\t\t} else {\n\t\t\t\t\t// push\n\t\t\t\t\tresult.push(current);\n\t\t\t\t\tcurrent = next;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (current !== null) {\n\t\t\tresult.push(current);\n\t\t}\n\t\treturn new LineRangeSet(result);\n\t}\n\n\t/**\n\t * Subtracts all ranges in this set from `range` and returns the result.\n\t */\n\tsubtractFrom(range: LineRange): LineRangeSet {\n\t\t// idx of first element that touches range or that is after range\n\t\tconst joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n\t\t// idx of element after { last element that touches range or that is before range }\n\t\tconst joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n\n\t\tif (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n\t\t\treturn new LineRangeSet([range]);\n\t\t}\n\n\t\tconst result: LineRange[] = [];\n\t\tlet startLineNumber = range.startLineNumber;\n\t\tfor (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {\n\t\t\tconst r = this._normalizedRanges[i];\n\t\t\tif (r.startLineNumber > startLineNumber) {\n\t\t\t\tresult.push(new LineRange(startLineNumber, r.startLineNumber));\n\t\t\t}\n\t\t\tstartLineNumber = r.endLineNumberExclusive;\n\t\t}\n\t\tif (startLineNumber < range.endLineNumberExclusive) {\n\t\t\tresult.push(new LineRange(startLineNumber, range.endLineNumberExclusive));\n\t\t}\n\n\t\treturn new LineRangeSet(result);\n\t}\n\n\ttoString() {\n\t\treturn this._normalizedRanges.map(r => r.toString()).join(', ');\n\t}\n\n\tgetIntersection(other: LineRangeSet): LineRangeSet {\n\t\tconst result: LineRange[] = [];\n\n\t\tlet i1 = 0;\n\t\tlet i2 = 0;\n\t\twhile (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n\t\t\tconst r1 = this._normalizedRanges[i1];\n\t\t\tconst r2 = other._normalizedRanges[i2];\n\n\t\t\tconst i = r1.intersect(r2);\n\t\t\tif (i && !i.isEmpty) {\n\t\t\t\tresult.push(i);\n\t\t\t}\n\n\t\t\tif (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\ti2++;\n\t\t\t}\n\t\t}\n\n\t\treturn new LineRangeSet(result);\n\t}\n\n\tgetWithDelta(value: number): LineRangeSet {\n\t\treturn new LineRangeSet(this._normalizedRanges.map(r => r.delta(value)));\n\t}\n}\n"]}
|
|
@@ -30,6 +30,7 @@ import { InlineEditTabAction } from '../inlineEditsViewInterface.js';
|
|
|
30
30
|
import { getEditorBlendedColor, inlineEditIndicatorBackground, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorSecondaryBorder, inlineEditIndicatorSecondaryForeground, inlineEditIndicatorsuccessfulBackground, inlineEditIndicatorsuccessfulBorder, inlineEditIndicatorsuccessfulForeground } from '../theme.js';
|
|
31
31
|
import { mapOutFalsy, rectToProps } from '../utils/utils.js';
|
|
32
32
|
import { GutterIndicatorMenuContent } from './gutterIndicatorMenu.js';
|
|
33
|
+
import { assertNever } from '../../../../../../../base/common/assert.js';
|
|
33
34
|
let InlineEditsGutterIndicator = class InlineEditsGutterIndicator extends Disposable {
|
|
34
35
|
get model() {
|
|
35
36
|
const model = this._model.get();
|
|
@@ -62,7 +63,7 @@ let InlineEditsGutterIndicator = class InlineEditsGutterIndicator extends Dispos
|
|
|
62
63
|
this._isHoveredOverIconDebounced = debouncedObservable(this._isHoveredOverIcon, 100);
|
|
63
64
|
this.isHoveredOverIcon = this._isHoveredOverIconDebounced;
|
|
64
65
|
this._isHoveredOverInlineEditDebounced = debouncedObservable(this._isHoveringOverInlineEdit, 100);
|
|
65
|
-
this._gutterIndicatorStyles = this._tabAction.map((v, reader) => {
|
|
66
|
+
this._gutterIndicatorStyles = this._tabAction.map(this, (v, reader) => {
|
|
66
67
|
switch (v) {
|
|
67
68
|
case InlineEditTabAction.Inactive: return {
|
|
68
69
|
background: getEditorBlendedColor(inlineEditIndicatorSecondaryBackground, themeService).read(reader).toString(),
|
|
@@ -79,6 +80,8 @@ let InlineEditsGutterIndicator = class InlineEditsGutterIndicator extends Dispos
|
|
|
79
80
|
foreground: getEditorBlendedColor(inlineEditIndicatorsuccessfulForeground, themeService).read(reader).toString(),
|
|
80
81
|
border: getEditorBlendedColor(inlineEditIndicatorsuccessfulBorder, themeService).read(reader).toString()
|
|
81
82
|
};
|
|
83
|
+
default:
|
|
84
|
+
assertNever(v);
|
|
82
85
|
}
|
|
83
86
|
});
|
|
84
87
|
this._originalRangeObs = mapOutFalsy(this._originalRange);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC1G,OAAO,EAAoC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7M,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,aAAa,EAA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,CAAC,CAAC;gBACzC,eAAe,CAAC,OAAO,EAAE,CAAC;YAC3B,CAAC,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACP,eAAe,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;IACF,CAAC;CAKD,CAAA;AA9dY,0BAA0B;IAkBpC,WAAA,aAAa,CAAA;IACb,WAAA,qBAAqB,CAAA;IACrB,WAAA,qBAAqB,CAAA;IACrB,WAAA,aAAa,CAAA;GArBH,0BAA0B,CA8dtC;;AAED,SAAS,wBAAwB,CAAC,SAAqC;IACtE,QAAQ,SAAS,EAAE,CAAC;QACnB,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,KAAK,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;AACF,CAAC","file":"gutterIndicatorView.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 { n, trackFocus } from '../../../../../../../base/browser/dom.js';\nimport { renderIcon } from '../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../../base/common/codicons.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, ISettableObservable, autorun, constObservable, debouncedObservable, derived, observableFromEvent, observableValue, runOnChange } from '../../../../../../../base/common/observable.js';\nimport { IAccessibilityService } from '../../../../../../../platform/accessibility/common/accessibility.js';\nimport { IHoverService } from '../../../../../../../platform/hover/browser/hover.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { IEditorMouseEvent } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { HoverService } from '../../../../../../browser/services/hoverService/hoverService.js';\nimport { HoverWidget } from '../../../../../../browser/services/hoverService/hoverWidget.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { IInlineEditModel, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getEditorBlendedColor, inlineEditIndicatorBackground, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorSecondaryBorder, inlineEditIndicatorSecondaryForeground, inlineEditIndicatorsuccessfulBackground, inlineEditIndicatorsuccessfulBorder, inlineEditIndicatorsuccessfulForeground } from '../theme.js';\nimport { mapOutFalsy, rectToProps } from '../utils/utils.js';\nimport { GutterIndicatorMenuContent } from './gutterIndicatorMenu.js';\n\nexport class InlineEditsGutterIndicator extends Disposable {\n\n\tprivate get model() {\n\t\tconst model = this._model.get();\n\t\tif (!model) { throw new BugIndicatingError('Inline Edit Model not available'); }\n\t\treturn model;\n\t}\n\n\tprivate readonly _gutterIndicatorStyles: IObservable<{ background: string; foreground: string; border: string }>;\n\tprivate readonly _isHoveredOverInlineEditDebounced: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editorObs: ObservableCodeEditor,\n\t\tprivate readonly _originalRange: IObservable<LineRange | undefined>,\n\t\tprivate readonly _verticalOffset: IObservable<number>,\n\t\tprivate readonly _model: IObservable<IInlineEditModel | undefined>,\n\t\tprivate readonly _isHoveringOverInlineEdit: IObservable<boolean>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IHoverService private readonly _hoverService: HoverService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IThemeService themeService: IThemeService,\n\t) {\n\t\tsuper();\n\n\t\tthis._tabAction = derived(this, reader => {\n\t\t\tconst model = this._model.read(reader);\n\t\t\tif (!model) { return InlineEditTabAction.Inactive; }\n\t\t\treturn model.tabAction.read(reader);\n\t\t});\n\n\t\tthis._hoverVisible = observableValue(this, false);\n\t\tthis.isHoverVisible = this._hoverVisible;\n\t\tthis._isHoveredOverIcon = observableValue(this, false);\n\t\tthis._isHoveredOverIconDebounced = debouncedObservable(this._isHoveredOverIcon, 100);\n\t\tthis.isHoveredOverIcon = this._isHoveredOverIconDebounced;\n\t\tthis._isHoveredOverInlineEditDebounced = debouncedObservable(this._isHoveringOverInlineEdit, 100);\n\n\t\tthis._gutterIndicatorStyles = this._tabAction.map((v, reader) => {\n\t\t\tswitch (v) {\n\t\t\t\tcase InlineEditTabAction.Inactive: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorSecondaryBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorSecondaryForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorSecondaryBorder, themeService).read(reader).toString(),\n\t\t\t\t};\n\t\t\t\tcase InlineEditTabAction.Jump: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorPrimaryBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorPrimaryForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorPrimaryBorder, themeService).read(reader).toString()\n\t\t\t\t};\n\t\t\t\tcase InlineEditTabAction.Accept: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorsuccessfulBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorsuccessfulForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorsuccessfulBorder, themeService).read(reader).toString()\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\tthis._originalRangeObs = mapOutFalsy(this._originalRange);\n\t\tthis._state = derived(this, reader => {\n\t\t\tconst range = this._originalRangeObs.read(reader);\n\t\t\tif (!range) { return undefined; }\n\t\t\treturn {\n\t\t\t\trange,\n\t\t\t\tlineOffsetRange: this._editorObs.observeLineOffsetRange(range, this._store),\n\t\t\t};\n\t\t});\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController\n\t\t\t? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight)\n\t\t\t: constObservable(0);\n\t\tthis._lineNumberToRender = derived(this, reader => {\n\t\t\tif (this._verticalOffset.read(reader) !== 0) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst lineNumber = this._originalRange.read(reader)?.startLineNumber;\n\t\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\n\t\t\tif (lineNumber === undefined || lineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Interval) {\n\t\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\t\tif (lineNumber % 10 === 0 || cursorPosition && cursorPosition.lineNumber === lineNumber) {\n\t\t\t\t\treturn lineNumber.toString();\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\t\tif (!cursorPosition) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\tconst relativeLineNumber = Math.abs(lineNumber - cursorPosition.lineNumber);\n\t\t\t\tif (relativeLineNumber === 0) {\n\t\t\t\t\treturn lineNumber.toString();\n\t\t\t\t}\n\t\t\t\treturn relativeLineNumber.toString();\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Custom) {\n\t\t\t\tif (lineNumberOptions.renderFn) {\n\t\t\t\t\treturn lineNumberOptions.renderFn(lineNumber);\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\treturn lineNumber.toString();\n\t\t});\n\t\tthis._availableWidthForIcon = derived(this, reader => {\n\t\t\tconst textModel = this._editorObs.editor.getModel();\n\t\t\tconst editor = this._editorObs.editor;\n\t\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\t\t\tconst gutterWidth = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft;\n\n\t\t\tif (!textModel || gutterWidth <= 0) {\n\t\t\t\treturn () => 0;\n\t\t\t}\n\n\t\t\t// no glyph margin => the entire gutter width is available as there is no optimal place to put the icon\n\t\t\tif (layout.lineNumbersLeft === 0) {\n\t\t\t\treturn () => gutterWidth;\n\t\t\t}\n\n\t\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative || /* likely to flicker */\n\t\t\t\tlineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\t\treturn () => gutterWidth;\n\t\t\t}\n\n\t\t\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst rightOfLineNumber = layout.lineNumbersLeft + layout.lineNumbersWidth;\n\t\t\tconst totalLines = textModel.getLineCount();\n\t\t\tconst totalLinesDigits = (totalLines + 1 /* 0 based to 1 based*/).toString().length;\n\n\t\t\tconst offsetDigits: {\n\t\t\t\tfirstLineNumberWithDigitCount: number;\n\t\t\t\ttopOfLineNumber: number;\n\t\t\t\tusableWidthLeftOfLineNumber: number;\n\t\t\t}[] = [];\n\n\t\t\t// We only need to pre compute the usable width left of the line number for the first line number with a given digit count\n\t\t\tfor (let digits = 1; digits <= totalLinesDigits; digits++) {\n\t\t\t\tconst firstLineNumberWithDigitCount = 10 ** (digits - 1);\n\t\t\t\tconst topOfLineNumber = editor.getTopForLineNumber(firstLineNumberWithDigitCount);\n\t\t\t\tconst digitsWidth = digits * w;\n\t\t\t\tconst usableWidthLeftOfLineNumber = Math.min(gutterWidth, Math.max(0, rightOfLineNumber - digitsWidth - layout.glyphMarginLeft));\n\t\t\t\toffsetDigits.push({ firstLineNumberWithDigitCount, topOfLineNumber, usableWidthLeftOfLineNumber });\n\t\t\t}\n\n\t\t\treturn (topOffset: number) => {\n\t\t\t\tfor (let i = offsetDigits.length - 1; i >= 0; i--) {\n\t\t\t\t\tif (topOffset >= offsetDigits[i].topOfLineNumber) {\n\t\t\t\t\t\treturn offsetDigits[i].usableWidthLeftOfLineNumber;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new BugIndicatingError('Could not find avilable width for icon');\n\t\t\t};\n\t\t});\n\t\tthis._layout = derived(this, reader => {\n\t\t\tconst s = this._state.read(reader);\n\t\t\tif (!s) { return undefined; }\n\n\t\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\n\t\t\tconst lineHeight = this._editorObs.observeLineHeightForLine(s.range.map(r => r.startLineNumber)).read(reader);\n\t\t\tconst gutterViewPortPadding = 2;\n\n\t\t\t// Entire gutter view from top left to bottom right\n\t\t\tconst gutterWidthWithoutPadding = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft - 2 * gutterViewPortPadding;\n\t\t\tconst gutterHeightWithoutPadding = layout.height - 2 * gutterViewPortPadding;\n\t\t\tconst gutterViewPortWithStickyScroll = Rect.fromLeftTopWidthHeight(gutterViewPortPadding, gutterViewPortPadding, gutterWidthWithoutPadding, gutterHeightWithoutPadding);\n\t\t\tconst gutterViewPortWithoutStickyScrollWithoutPaddingTop = gutterViewPortWithStickyScroll.withTop(this._stickyScrollHeight.read(reader));\n\t\t\tconst gutterViewPortWithoutStickyScroll = gutterViewPortWithStickyScroll.withTop(gutterViewPortWithoutStickyScrollWithoutPaddingTop.top + gutterViewPortPadding);\n\n\t\t\t// The glyph margin area across all relevant lines\n\t\t\tconst verticalEditRange = s.lineOffsetRange.read(reader);\n\t\t\tconst gutterEditArea = Rect.fromRanges(OffsetRange.fromTo(gutterViewPortWithoutStickyScroll.left, gutterViewPortWithoutStickyScroll.right), verticalEditRange);\n\n\t\t\t// The gutter view container (pill)\n\t\t\tconst pillHeight = lineHeight;\n\t\t\tconst pillOffset = this._verticalOffset.read(reader);\n\t\t\tconst pillFullyDockedRect = gutterEditArea.withHeight(pillHeight).translateY(pillOffset);\n\t\t\tconst pillIsFullyDocked = gutterViewPortWithoutStickyScrollWithoutPaddingTop.containsRect(pillFullyDockedRect);\n\n\t\t\t// The icon which will be rendered in the pill\n\t\t\tconst iconNoneDocked = this._tabAction.map(action => action === InlineEditTabAction.Accept ? Codicon.keyboardTab : Codicon.arrowRight);\n\t\t\tconst iconDocked = derived(this, reader => {\n\t\t\t\tif (this._isHoveredOverIconDebounced.read(reader) || this._isHoveredOverInlineEditDebounced.read(reader)) {\n\t\t\t\t\treturn Codicon.check;\n\t\t\t\t}\n\t\t\t\tif (this._tabAction.read(reader) === InlineEditTabAction.Accept) {\n\t\t\t\t\treturn Codicon.keyboardTab;\n\t\t\t\t}\n\t\t\t\tconst cursorLineNumber = this._editorObs.cursorLineNumber.read(reader) ?? 0;\n\t\t\t\tconst editStartLineNumber = s.range.read(reader).startLineNumber;\n\t\t\t\treturn cursorLineNumber <= editStartLineNumber ? Codicon.keyboardTabAbove : Codicon.keyboardTabBelow;\n\t\t\t});\n\n\t\t\tconst idealIconWidth = 22;\n\t\t\tconst minimalIconWidth = 16; // codicon size\n\t\t\tconst iconWidth = (pillRect: Rect) => {\n\t\t\t\tconst availableWidth = this._availableWidthForIcon.get()(pillRect.bottom + this._editorObs.editor.getScrollTop()) - gutterViewPortPadding;\n\t\t\t\treturn Math.max(Math.min(availableWidth, idealIconWidth), minimalIconWidth);\n\t\t\t};\n\n\t\t\tif (pillIsFullyDocked) {\n\t\t\t\tconst pillRect = pillFullyDockedRect;\n\n\t\t\t\tlet lineNumberWidth;\n\t\t\t\tif (layout.lineNumbersWidth === 0) {\n\t\t\t\t\tlineNumberWidth = Math.min(Math.max(layout.lineNumbersLeft - gutterViewPortWithStickyScroll.left, 0), pillRect.width - idealIconWidth);\n\t\t\t\t} else {\n\t\t\t\t\tlineNumberWidth = Math.max(layout.lineNumbersLeft + layout.lineNumbersWidth - gutterViewPortWithStickyScroll.left, 0);\n\t\t\t\t}\n\n\t\t\t\tconst lineNumberRect = pillRect.withWidth(lineNumberWidth);\n\t\t\t\tconst iconWidth = Math.max(Math.min(layout.decorationsWidth, idealIconWidth), minimalIconWidth);\n\t\t\t\tconst iconRect = pillRect.withWidth(iconWidth).translateX(lineNumberWidth);\n\n\t\t\t\treturn {\n\t\t\t\t\tgutterEditArea,\n\t\t\t\t\ticon: iconDocked,\n\t\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\t\ticonRect,\n\t\t\t\t\tpillRect,\n\t\t\t\t\tlineNumberRect,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst pillPartiallyDockedPossibleArea = gutterViewPortWithStickyScroll.intersect(gutterEditArea); // The area in which the pill could be partially docked\n\t\t\tconst pillIsPartiallyDocked = pillPartiallyDockedPossibleArea && pillPartiallyDockedPossibleArea.height >= pillHeight;\n\n\t\t\tif (pillIsPartiallyDocked) {\n\t\t\t\t// pillFullyDockedRect is outside viewport, move it into the viewport under sticky scroll as we prefer the pill to not be on top of the sticky scroll\n\t\t\t\t// then move it into the possible area which will only cause it to move if it has to be rendered on top of the sticky scroll\n\t\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithoutStickyScroll).moveToBeContainedIn(pillPartiallyDockedPossibleArea);\n\t\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\t\tconst iconRect = pillRect;\n\n\t\t\t\treturn {\n\t\t\t\t\tgutterEditArea,\n\t\t\t\t\ticon: iconDocked,\n\t\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\t\ticonRect,\n\t\t\t\t\tpillRect,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// pillFullyDockedRect is outside viewport, so move it into viewport\n\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithStickyScroll);\n\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\tconst iconRect = pillRect;\n\n\t\t\t// docked = pill was already in the viewport\n\t\t\tconst iconDirection = pillRect.top < pillFullyDockedRect.top ?\n\t\t\t\t'top' as const :\n\t\t\t\t'bottom' as const;\n\n\t\t\treturn {\n\t\t\t\tgutterEditArea,\n\t\t\t\ticon: iconNoneDocked,\n\t\t\t\ticonDirection,\n\t\t\t\ticonRect,\n\t\t\t\tpillRect,\n\t\t\t};\n\t\t});\n\t\tthis._iconRef = n.ref<HTMLDivElement>();\n\t\tthis.isVisible = this._layout.map(l => !!l);\n\t\tthis._indicator = n.div({\n\t\t\tclass: 'inline-edits-view-gutter-indicator',\n\t\t\tonclick: () => {\n\t\t\t\tconst layout = this._layout.get();\n\t\t\t\tconst acceptOnClick = layout?.icon.get() === Codicon.check;\n\n\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\tif (acceptOnClick) {\n\t\t\t\t\tthis.model.accept();\n\t\t\t\t} else {\n\t\t\t\t\tthis.model.jump();\n\t\t\t\t}\n\t\t\t},\n\t\t\ttabIndex: 0,\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'visible',\n\t\t\t},\n\t\t}, mapOutFalsy(this._layout).map(layout => !layout ? [] : [\n\t\t\tn.div({\n\t\t\t\tstyle: {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tbackground: asCssVariable(inlineEditIndicatorBackground),\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t...rectToProps(reader => layout.read(reader).gutterEditArea),\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'icon',\n\t\t\t\tref: this._iconRef,\n\t\t\t\tonmouseenter: () => {\n\t\t\t\t\t// TODO show hover when hovering ghost text etc.\n\t\t\t\t\tthis._showHover();\n\t\t\t\t},\n\t\t\t\tstyle: {\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tzIndex: '20',\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tbackgroundColor: this._gutterIndicatorStyles.map(v => v.background),\n\t\t\t\t\t['--vscodeIconForeground' as any]: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t\tborder: this._gutterIndicatorStyles.map(v => `1px solid ${v.border}`),\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\ttransition: 'background-color 0.2s ease-in-out, width 0.2s ease-in-out',\n\t\t\t\t\t...rectToProps(reader => layout.read(reader).pillRect),\n\t\t\t\t}\n\t\t\t}, [\n\t\t\t\tn.div({\n\t\t\t\t\tclassName: 'line-number',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tlineHeight: layout.map(l => l.lineNumberRect ? l.lineNumberRect.height : 0),\n\t\t\t\t\t\tdisplay: layout.map(l => l.lineNumberRect ? 'flex' : 'none'),\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\t\twidth: layout.map(l => l.lineNumberRect ? l.lineNumberRect.width : 0),\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\tcolor: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\tthis._lineNumberToRender\n\t\t\t\t),\n\t\t\t\tn.div({\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\trotate: layout.map(l => `${getRotationFromDirection(l.iconDirection)}deg`),\n\t\t\t\t\t\ttransition: 'rotate 0.2s ease-in-out',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\tmarginRight: layout.map(l => l.pillRect.width - l.iconRect.width - (l.lineNumberRect?.width ?? 0)),\n\t\t\t\t\t\twidth: layout.map(l => l.iconRect.width),\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tlayout.map((l, reader) => renderIcon(l.icon.read(reader))),\n\t\t\t\t])\n\t\t\t]),\n\t\t])).keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._indicator.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tconst state = this._state.get();\n\t\t\tif (state === undefined) { return; }\n\n\t\t\tconst el = this._iconRef.element;\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tconst rectangularArea = Rect.fromLeftTopWidthHeight(rect.left, rect.top, rect.width, rect.height);\n\t\t\tconst point = new Point(e.event.posx, e.event.posy);\n\t\t\tthis._isHoveredOverIcon.set(rectangularArea.containsPoint(point), undefined);\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onDidScrollChange(() => {\n\t\t\tthis._isHoveredOverIcon.set(false, undefined);\n\t\t}));\n\n\t\t// pulse animation when hovering inline edit\n\t\tthis._register(runOnChange(this._isHoveredOverInlineEditDebounced, (isHovering) => {\n\t\t\tif (isHovering) {\n\t\t\t\tthis.triggerAnimation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._indicator.readEffect(reader);\n\t\t\tif (this._indicator.element) {\n\t\t\t\tthis._editorObs.editor.applyFontInfo(this._indicator.element);\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic triggerAnimation(): Promise<Animation> {\n\t\tif (this._accessibilityService.isMotionReduced()) {\n\t\t\treturn new Animation(null, null).finished;\n\t\t}\n\n\t\t// PULSE ANIMATION:\n\t\tconst animation = this._iconRef.element.animate([\n\t\t\t{\n\t\t\t\toutline: `2px solid ${this._gutterIndicatorStyles.map(v => v.border).get()}`,\n\t\t\t\toutlineOffset: '-1px',\n\t\t\t\toffset: 0\n\t\t\t},\n\t\t\t{\n\t\t\t\toutline: `2px solid transparent`,\n\t\t\t\toutlineOffset: '10px',\n\t\t\t\toffset: 1\n\t\t\t},\n\t\t], { duration: 500 });\n\n\t\treturn animation.finished;\n\t}\n\n\tprivate readonly _originalRangeObs;\n\n\tprivate readonly _state;\n\n\tprivate readonly _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _lineNumberToRender;\n\n\tprivate readonly _availableWidthForIcon;\n\n\tprivate readonly _layout;\n\n\n\tprivate readonly _iconRef;\n\n\tpublic readonly isVisible;\n\n\tprivate readonly _hoverVisible;\n\tpublic readonly isHoverVisible: IObservable<boolean>;\n\n\tprivate readonly _isHoveredOverIcon;\n\tprivate readonly _isHoveredOverIconDebounced: IObservable<boolean>;\n\tpublic readonly isHoveredOverIcon: IObservable<boolean>;\n\n\tprivate _showHover(): void {\n\t\tif (this._hoverVisible.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst disposableStore = new DisposableStore();\n\t\tconst content = disposableStore.add(this._instantiationService.createInstance(\n\t\t\tGutterIndicatorMenuContent,\n\t\t\tthis.model,\n\t\t\t(focusEditor) => {\n\t\t\t\tif (focusEditor) {\n\t\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\t}\n\t\t\t\th?.dispose();\n\t\t\t},\n\t\t\tthis._editorObs,\n\t\t).toDisposableLiveElement());\n\n\t\tconst focusTracker = disposableStore.add(trackFocus(content.element));\n\t\tdisposableStore.add(focusTracker.onDidBlur(() => this._focusIsInMenu.set(false, undefined)));\n\t\tdisposableStore.add(focusTracker.onDidFocus(() => this._focusIsInMenu.set(true, undefined)));\n\t\tdisposableStore.add(toDisposable(() => this._focusIsInMenu.set(false, undefined)));\n\n\t\tconst h = this._hoverService.showInstantHover({\n\t\t\ttarget: this._iconRef.element,\n\t\t\tcontent: content.element,\n\t\t}) as HoverWidget | undefined;\n\t\tif (h) {\n\t\t\tthis._hoverVisible.set(true, undefined);\n\t\t\tdisposableStore.add(this._editorObs.editor.onDidScrollChange(() => h.dispose()));\n\t\t\tdisposableStore.add(h.onDispose(() => {\n\t\t\t\tthis._hoverVisible.set(false, undefined);\n\t\t\t\tdisposableStore.dispose();\n\t\t\t}));\n\t\t} else {\n\t\t\tdisposableStore.dispose();\n\t\t}\n\t}\n\n\tprivate readonly _tabAction;\n\n\tprivate readonly _indicator;\n}\n\nfunction getRotationFromDirection(direction: 'top' | 'bottom' | 'right'): number {\n\tswitch (direction) {\n\t\tcase 'top': return 90;\n\t\tcase 'bottom': return -90;\n\t\tcase 'right': return 0;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { n, trackFocus } from '../../../../../../../base/browser/dom.js';\nimport { renderIcon } from '../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../../base/common/codicons.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, ISettableObservable, autorun, constObservable, debouncedObservable, derived, observableFromEvent, observableValue, runOnChange } from '../../../../../../../base/common/observable.js';\nimport { IAccessibilityService } from '../../../../../../../platform/accessibility/common/accessibility.js';\nimport { IHoverService } from '../../../../../../../platform/hover/browser/hover.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { IEditorMouseEvent } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { HoverService } from '../../../../../../browser/services/hoverService/hoverService.js';\nimport { HoverWidget } from '../../../../../../browser/services/hoverService/hoverWidget.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { IInlineEditModel, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getEditorBlendedColor, inlineEditIndicatorBackground, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorSecondaryBorder, inlineEditIndicatorSecondaryForeground, inlineEditIndicatorsuccessfulBackground, inlineEditIndicatorsuccessfulBorder, inlineEditIndicatorsuccessfulForeground } from '../theme.js';\nimport { mapOutFalsy, rectToProps } from '../utils/utils.js';\nimport { GutterIndicatorMenuContent } from './gutterIndicatorMenu.js';\n\nexport class InlineEditsGutterIndicator extends Disposable {\n\n\tprivate get model() {\n\t\tconst model = this._model.get();\n\t\tif (!model) { throw new BugIndicatingError('Inline Edit Model not available'); }\n\t\treturn model;\n\t}\n\n\tprivate readonly _gutterIndicatorStyles: IObservable<{ background: string; foreground: string; border: string }>;\n\tprivate readonly _isHoveredOverInlineEditDebounced: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editorObs: ObservableCodeEditor,\n\t\tprivate readonly _originalRange: IObservable<LineRange | undefined>,\n\t\tprivate readonly _verticalOffset: IObservable<number>,\n\t\tprivate readonly _model: IObservable<IInlineEditModel | undefined>,\n\t\tprivate readonly _isHoveringOverInlineEdit: IObservable<boolean>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IHoverService private readonly _hoverService: HoverService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IThemeService themeService: IThemeService,\n\t) {\n\t\tsuper();\n\n\t\tthis._tabAction = derived(this, reader => {\n\t\t\tconst model = this._model.read(reader);\n\t\t\tif (!model) { return InlineEditTabAction.Inactive; }\n\t\t\treturn model.tabAction.read(reader);\n\t\t});\n\n\t\tthis._hoverVisible = observableValue(this, false);\n\t\tthis.isHoverVisible = this._hoverVisible;\n\t\tthis._isHoveredOverIcon = observableValue(this, false);\n\t\tthis._isHoveredOverIconDebounced = debouncedObservable(this._isHoveredOverIcon, 100);\n\t\tthis.isHoveredOverIcon = this._isHoveredOverIconDebounced;\n\t\tthis._isHoveredOverInlineEditDebounced = debouncedObservable(this._isHoveringOverInlineEdit, 100);\n\n\t\tthis._gutterIndicatorStyles = this._tabAction.map((v, reader) => {\n\t\t\tswitch (v) {\n\t\t\t\tcase InlineEditTabAction.Inactive: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorSecondaryBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorSecondaryForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorSecondaryBorder, themeService).read(reader).toString(),\n\t\t\t\t};\n\t\t\t\tcase InlineEditTabAction.Jump: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorPrimaryBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorPrimaryForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorPrimaryBorder, themeService).read(reader).toString()\n\t\t\t\t};\n\t\t\t\tcase InlineEditTabAction.Accept: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorsuccessfulBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorsuccessfulForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorsuccessfulBorder, themeService).read(reader).toString()\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\tthis._originalRangeObs = mapOutFalsy(this._originalRange);\n\t\tthis._state = derived(this, reader => {\n\t\t\tconst range = this._originalRangeObs.read(reader);\n\t\t\tif (!range) { return undefined; }\n\t\t\treturn {\n\t\t\t\trange,\n\t\t\t\tlineOffsetRange: this._editorObs.observeLineOffsetRange(range, this._store),\n\t\t\t};\n\t\t});\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController\n\t\t\t? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight)\n\t\t\t: constObservable(0);\n\t\tthis._lineNumberToRender = derived(this, reader => {\n\t\t\tif (this._verticalOffset.read(reader) !== 0) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst lineNumber = this._originalRange.read(reader)?.startLineNumber;\n\t\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\n\t\t\tif (lineNumber === undefined || lineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Interval) {\n\t\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\t\tif (lineNumber % 10 === 0 || cursorPosition && cursorPosition.lineNumber === lineNumber) {\n\t\t\t\t\treturn lineNumber.toString();\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\t\tif (!cursorPosition) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\tconst relativeLineNumber = Math.abs(lineNumber - cursorPosition.lineNumber);\n\t\t\t\tif (relativeLineNumber === 0) {\n\t\t\t\t\treturn lineNumber.toString();\n\t\t\t\t}\n\t\t\t\treturn relativeLineNumber.toString();\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Custom) {\n\t\t\t\tif (lineNumberOptions.renderFn) {\n\t\t\t\t\treturn lineNumberOptions.renderFn(lineNumber);\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\treturn lineNumber.toString();\n\t\t});\n\t\tthis._availableWidthForIcon = derived(this, reader => {\n\t\t\tconst textModel = this._editorObs.editor.getModel();\n\t\t\tconst editor = this._editorObs.editor;\n\t\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\t\t\tconst gutterWidth = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft;\n\n\t\t\tif (!textModel || gutterWidth <= 0) {\n\t\t\t\treturn () => 0;\n\t\t\t}\n\n\t\t\t// no glyph margin => the entire gutter width is available as there is no optimal place to put the icon\n\t\t\tif (layout.lineNumbersLeft === 0) {\n\t\t\t\treturn () => gutterWidth;\n\t\t\t}\n\n\t\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative || /* likely to flicker */\n\t\t\t\tlineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\t\treturn () => gutterWidth;\n\t\t\t}\n\n\t\t\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst rightOfLineNumber = layout.lineNumbersLeft + layout.lineNumbersWidth;\n\t\t\tconst totalLines = textModel.getLineCount();\n\t\t\tconst totalLinesDigits = (totalLines + 1 /* 0 based to 1 based*/).toString().length;\n\n\t\t\tconst offsetDigits: {\n\t\t\t\tfirstLineNumberWithDigitCount: number;\n\t\t\t\ttopOfLineNumber: number;\n\t\t\t\tusableWidthLeftOfLineNumber: number;\n\t\t\t}[] = [];\n\n\t\t\t// We only need to pre compute the usable width left of the line number for the first line number with a given digit count\n\t\t\tfor (let digits = 1; digits <= totalLinesDigits; digits++) {\n\t\t\t\tconst firstLineNumberWithDigitCount = 10 ** (digits - 1);\n\t\t\t\tconst topOfLineNumber = editor.getTopForLineNumber(firstLineNumberWithDigitCount);\n\t\t\t\tconst digitsWidth = digits * w;\n\t\t\t\tconst usableWidthLeftOfLineNumber = Math.min(gutterWidth, Math.max(0, rightOfLineNumber - digitsWidth - layout.glyphMarginLeft));\n\t\t\t\toffsetDigits.push({ firstLineNumberWithDigitCount, topOfLineNumber, usableWidthLeftOfLineNumber });\n\t\t\t}\n\n\t\t\treturn (topOffset: number) => {\n\t\t\t\tfor (let i = offsetDigits.length - 1; i >= 0; i--) {\n\t\t\t\t\tif (topOffset >= offsetDigits[i].topOfLineNumber) {\n\t\t\t\t\t\treturn offsetDigits[i].usableWidthLeftOfLineNumber;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new BugIndicatingError('Could not find avilable width for icon');\n\t\t\t};\n\t\t});\n\t\tthis._layout = derived(this, reader => {\n\t\t\tconst s = this._state.read(reader);\n\t\t\tif (!s) { return undefined; }\n\n\t\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\n\t\t\tconst lineHeight = this._editorObs.observeLineHeightForLine(s.range.map(r => r.startLineNumber)).read(reader);\n\t\t\tconst gutterViewPortPadding = 2;\n\n\t\t\t// Entire gutter view from top left to bottom right\n\t\t\tconst gutterWidthWithoutPadding = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft - 2 * gutterViewPortPadding;\n\t\t\tconst gutterHeightWithoutPadding = layout.height - 2 * gutterViewPortPadding;\n\t\t\tconst gutterViewPortWithStickyScroll = Rect.fromLeftTopWidthHeight(gutterViewPortPadding, gutterViewPortPadding, gutterWidthWithoutPadding, gutterHeightWithoutPadding);\n\t\t\tconst gutterViewPortWithoutStickyScrollWithoutPaddingTop = gutterViewPortWithStickyScroll.withTop(this._stickyScrollHeight.read(reader));\n\t\t\tconst gutterViewPortWithoutStickyScroll = gutterViewPortWithStickyScroll.withTop(gutterViewPortWithoutStickyScrollWithoutPaddingTop.top + gutterViewPortPadding);\n\n\t\t\t// The glyph margin area across all relevant lines\n\t\t\tconst verticalEditRange = s.lineOffsetRange.read(reader);\n\t\t\tconst gutterEditArea = Rect.fromRanges(OffsetRange.fromTo(gutterViewPortWithoutStickyScroll.left, gutterViewPortWithoutStickyScroll.right), verticalEditRange);\n\n\t\t\t// The gutter view container (pill)\n\t\t\tconst pillHeight = lineHeight;\n\t\t\tconst pillOffset = this._verticalOffset.read(reader);\n\t\t\tconst pillFullyDockedRect = gutterEditArea.withHeight(pillHeight).translateY(pillOffset);\n\t\t\tconst pillIsFullyDocked = gutterViewPortWithoutStickyScrollWithoutPaddingTop.containsRect(pillFullyDockedRect);\n\n\t\t\t// The icon which will be rendered in the pill\n\t\t\tconst iconNoneDocked = this._tabAction.map(action => action === InlineEditTabAction.Accept ? Codicon.keyboardTab : Codicon.arrowRight);\n\t\t\tconst iconDocked = derived(this, reader => {\n\t\t\t\tif (this._isHoveredOverIconDebounced.read(reader) || this._isHoveredOverInlineEditDebounced.read(reader)) {\n\t\t\t\t\treturn Codicon.check;\n\t\t\t\t}\n\t\t\t\tif (this._tabAction.read(reader) === InlineEditTabAction.Accept) {\n\t\t\t\t\treturn Codicon.keyboardTab;\n\t\t\t\t}\n\t\t\t\tconst cursorLineNumber = this._editorObs.cursorLineNumber.read(reader) ?? 0;\n\t\t\t\tconst editStartLineNumber = s.range.read(reader).startLineNumber;\n\t\t\t\treturn cursorLineNumber <= editStartLineNumber ? Codicon.keyboardTabAbove : Codicon.keyboardTabBelow;\n\t\t\t});\n\n\t\t\tconst idealIconWidth = 22;\n\t\t\tconst minimalIconWidth = 16; // codicon size\n\t\t\tconst iconWidth = (pillRect: Rect) => {\n\t\t\t\tconst availableWidth = this._availableWidthForIcon.get()(pillRect.bottom + this._editorObs.editor.getScrollTop()) - gutterViewPortPadding;\n\t\t\t\treturn Math.max(Math.min(availableWidth, idealIconWidth), minimalIconWidth);\n\t\t\t};\n\n\t\t\tif (pillIsFullyDocked) {\n\t\t\t\tconst pillRect = pillFullyDockedRect;\n\n\t\t\t\tlet lineNumberWidth;\n\t\t\t\tif (layout.lineNumbersWidth === 0) {\n\t\t\t\t\tlineNumberWidth = Math.min(Math.max(layout.lineNumbersLeft - gutterViewPortWithStickyScroll.left, 0), pillRect.width - idealIconWidth);\n\t\t\t\t} else {\n\t\t\t\t\tlineNumberWidth = Math.max(layout.lineNumbersLeft + layout.lineNumbersWidth - gutterViewPortWithStickyScroll.left, 0);\n\t\t\t\t}\n\n\t\t\t\tconst lineNumberRect = pillRect.withWidth(lineNumberWidth);\n\t\t\t\tconst iconWidth = Math.max(Math.min(layout.decorationsWidth, idealIconWidth), minimalIconWidth);\n\t\t\t\tconst iconRect = pillRect.withWidth(iconWidth).translateX(lineNumberWidth);\n\n\t\t\t\treturn {\n\t\t\t\t\tgutterEditArea,\n\t\t\t\t\ticon: iconDocked,\n\t\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\t\ticonRect,\n\t\t\t\t\tpillRect,\n\t\t\t\t\tlineNumberRect,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst pillPartiallyDockedPossibleArea = gutterViewPortWithStickyScroll.intersect(gutterEditArea); // The area in which the pill could be partially docked\n\t\t\tconst pillIsPartiallyDocked = pillPartiallyDockedPossibleArea && pillPartiallyDockedPossibleArea.height >= pillHeight;\n\n\t\t\tif (pillIsPartiallyDocked) {\n\t\t\t\t// pillFullyDockedRect is outside viewport, move it into the viewport under sticky scroll as we prefer the pill to not be on top of the sticky scroll\n\t\t\t\t// then move it into the possible area which will only cause it to move if it has to be rendered on top of the sticky scroll\n\t\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithoutStickyScroll).moveToBeContainedIn(pillPartiallyDockedPossibleArea);\n\t\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\t\tconst iconRect = pillRect;\n\n\t\t\t\treturn {\n\t\t\t\t\tgutterEditArea,\n\t\t\t\t\ticon: iconDocked,\n\t\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\t\ticonRect,\n\t\t\t\t\tpillRect,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// pillFullyDockedRect is outside viewport, so move it into viewport\n\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithStickyScroll);\n\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\tconst iconRect = pillRect;\n\n\t\t\t// docked = pill was already in the viewport\n\t\t\tconst iconDirection = pillRect.top < pillFullyDockedRect.top ?\n\t\t\t\t'top' as const :\n\t\t\t\t'bottom' as const;\n\n\t\t\treturn {\n\t\t\t\tgutterEditArea,\n\t\t\t\ticon: iconNoneDocked,\n\t\t\t\ticonDirection,\n\t\t\t\ticonRect,\n\t\t\t\tpillRect,\n\t\t\t};\n\t\t});\n\t\tthis._iconRef = n.ref<HTMLDivElement>();\n\t\tthis.isVisible = this._layout.map(l => !!l);\n\t\tthis._indicator = n.div({\n\t\t\tclass: 'inline-edits-view-gutter-indicator',\n\t\t\tonclick: () => {\n\t\t\t\tconst layout = this._layout.get();\n\t\t\t\tconst acceptOnClick = layout?.icon.get() === Codicon.check;\n\n\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\tif (acceptOnClick) {\n\t\t\t\t\tthis.model.accept();\n\t\t\t\t} else {\n\t\t\t\t\tthis.model.jump();\n\t\t\t\t}\n\t\t\t},\n\t\t\ttabIndex: 0,\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'visible',\n\t\t\t},\n\t\t}, mapOutFalsy(this._layout).map(layout => !layout ? [] : [\n\t\t\tn.div({\n\t\t\t\tstyle: {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tbackground: asCssVariable(inlineEditIndicatorBackground),\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t...rectToProps(reader => layout.read(reader).gutterEditArea),\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'icon',\n\t\t\t\tref: this._iconRef,\n\t\t\t\tonmouseenter: () => {\n\t\t\t\t\t// TODO show hover when hovering ghost text etc.\n\t\t\t\t\tthis._showHover();\n\t\t\t\t},\n\t\t\t\tstyle: {\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tzIndex: '20',\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tbackgroundColor: this._gutterIndicatorStyles.map(v => v.background),\n\t\t\t\t\t['--vscodeIconForeground' as any]: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t\tborder: this._gutterIndicatorStyles.map(v => `1px solid ${v.border}`),\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\ttransition: 'background-color 0.2s ease-in-out, width 0.2s ease-in-out',\n\t\t\t\t\t...rectToProps(reader => layout.read(reader).pillRect),\n\t\t\t\t}\n\t\t\t}, [\n\t\t\t\tn.div({\n\t\t\t\t\tclassName: 'line-number',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tlineHeight: layout.map(l => l.lineNumberRect ? l.lineNumberRect.height : 0),\n\t\t\t\t\t\tdisplay: layout.map(l => l.lineNumberRect ? 'flex' : 'none'),\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\t\twidth: layout.map(l => l.lineNumberRect ? l.lineNumberRect.width : 0),\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\tcolor: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\tthis._lineNumberToRender\n\t\t\t\t),\n\t\t\t\tn.div({\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\trotate: layout.map(l => `${getRotationFromDirection(l.iconDirection)}deg`),\n\t\t\t\t\t\ttransition: 'rotate 0.2s ease-in-out',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\tmarginRight: layout.map(l => l.pillRect.width - l.iconRect.width - (l.lineNumberRect?.width ?? 0)),\n\t\t\t\t\t\twidth: layout.map(l => l.iconRect.width),\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tlayout.map((l, reader) => renderIcon(l.icon.read(reader))),\n\t\t\t\t])\n\t\t\t]),\n\t\t])).keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._indicator.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tconst state = this._state.get();\n\t\t\tif (state === undefined) { return; }\n\n\t\t\tconst el = this._iconRef.element;\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tconst rectangularArea = Rect.fromLeftTopWidthHeight(rect.left, rect.top, rect.width, rect.height);\n\t\t\tconst point = new Point(e.event.posx, e.event.posy);\n\t\t\tthis._isHoveredOverIcon.set(rectangularArea.containsPoint(point), undefined);\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onDidScrollChange(() => {\n\t\t\tthis._isHoveredOverIcon.set(false, undefined);\n\t\t}));\n\n\t\t// pulse animation when hovering inline edit\n\t\tthis._register(runOnChange(this._isHoveredOverInlineEditDebounced, (isHovering) => {\n\t\t\tif (isHovering) {\n\t\t\t\tthis.triggerAnimation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._indicator.readEffect(reader);\n\t\t\tif (this._indicator.element) {\n\t\t\t\tthis._editorObs.editor.applyFontInfo(this._indicator.element);\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic triggerAnimation(): Promise<Animation> {\n\t\tif (this._accessibilityService.isMotionReduced()) {\n\t\t\treturn new Animation(null, null).finished;\n\t\t}\n\n\t\t// PULSE ANIMATION:\n\t\tconst animation = this._iconRef.element.animate([\n\t\t\t{\n\t\t\t\toutline: `2px solid ${this._gutterIndicatorStyles.map(v => v.border).get()}`,\n\t\t\t\toutlineOffset: '-1px',\n\t\t\t\toffset: 0\n\t\t\t},\n\t\t\t{\n\t\t\t\toutline: `2px solid transparent`,\n\t\t\t\toutlineOffset: '10px',\n\t\t\t\toffset: 1\n\t\t\t},\n\t\t], { duration: 500 });\n\n\t\treturn animation.finished;\n\t}\n\n\tprivate readonly _originalRangeObs;\n\n\tprivate readonly _state;\n\n\tprivate readonly _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _lineNumberToRender;\n\n\tprivate readonly _availableWidthForIcon;\n\n\tprivate readonly _layout;\n\n\n\tprivate readonly _iconRef;\n\n\tpublic readonly isVisible;\n\n\tprivate readonly _hoverVisible;\n\tpublic readonly isHoverVisible: IObservable<boolean>;\n\n\tprivate readonly _isHoveredOverIcon;\n\tprivate readonly _isHoveredOverIconDebounced: IObservable<boolean>;\n\tpublic readonly isHoveredOverIcon: IObservable<boolean>;\n\n\tprivate _showHover(): void {\n\t\tif (this._hoverVisible.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst disposableStore = new DisposableStore();\n\t\tconst content = disposableStore.add(this._instantiationService.createInstance(\n\t\t\tGutterIndicatorMenuContent,\n\t\t\tthis.model,\n\t\t\t(focusEditor) => {\n\t\t\t\tif (focusEditor) {\n\t\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\t}\n\t\t\t\th?.dispose();\n\t\t\t},\n\t\t\tthis._editorObs,\n\t\t).toDisposableLiveElement());\n\n\t\tconst focusTracker = disposableStore.add(trackFocus(content.element));\n\t\tdisposableStore.add(focusTracker.onDidBlur(() => this._focusIsInMenu.set(false, undefined)));\n\t\tdisposableStore.add(focusTracker.onDidFocus(() => this._focusIsInMenu.set(true, undefined)));\n\t\tdisposableStore.add(toDisposable(() => this._focusIsInMenu.set(false, undefined)));\n\n\t\tconst h = this._hoverService.showInstantHover({\n\t\t\ttarget: this._iconRef.element,\n\t\t\tcontent: content.element,\n\t\t}) as HoverWidget | undefined;\n\t\tif (h) {\n\t\t\tthis._hoverVisible.set(true, undefined);\n\t\t\tdisposableStore.add(this._editorObs.editor.onDidScrollChange(() => h.dispose()));\n\t\t\tdisposableStore.add(h.onDispose(() => {\n\t\t\t\tthis._hoverVisible.set(false, undefined);\n\t\t\t\tdisposableStore.dispose();\n\t\t\t}));\n\t\t} else {\n\t\t\tdisposableStore.dispose();\n\t\t}\n\t}\n\n\tprivate readonly _tabAction;\n\n\tprivate readonly _indicator;\n}\n\nfunction getRotationFromDirection(direction: 'top' | 'bottom' | 'right'): number {\n\tswitch (direction) {\n\t\tcase 'top': return 90;\n\t\tcase 'bottom': return -90;\n\t\tcase 'right': return 0;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC1G,OAAO,EAAoC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7M,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,4DAA4D,CAAC;AAG3F,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+DAA+D,CAAC;AACvG,OAAO,EAAoB,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,oCAAoC,EAAE,gCAAgC,EAAE,oCAAoC,EAAE,sCAAsC,EAAE,kCAAkC,EAAE,sCAAsC,EAAE,uCAA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AE,CAAC;QACnB,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,KAAK,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;AACF,CAAC","file":"gutterIndicatorView.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 { n, trackFocus } from '../../../../../../../base/browser/dom.js';\nimport { renderIcon } from '../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../../base/common/codicons.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, ISettableObservable, autorun, constObservable, debouncedObservable, derived, observableFromEvent, observableValue, runOnChange } from '../../../../../../../base/common/observable.js';\nimport { IAccessibilityService } from '../../../../../../../platform/accessibility/common/accessibility.js';\nimport { IHoverService } from '../../../../../../../platform/hover/browser/hover.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { IEditorMouseEvent } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { HoverService } from '../../../../../../browser/services/hoverService/hoverService.js';\nimport { HoverWidget } from '../../../../../../browser/services/hoverService/hoverWidget.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { IInlineEditModel, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getEditorBlendedColor, inlineEditIndicatorBackground, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorSecondaryBorder, inlineEditIndicatorSecondaryForeground, inlineEditIndicatorsuccessfulBackground, inlineEditIndicatorsuccessfulBorder, inlineEditIndicatorsuccessfulForeground } from '../theme.js';\nimport { mapOutFalsy, rectToProps } from '../utils/utils.js';\nimport { GutterIndicatorMenuContent } from './gutterIndicatorMenu.js';\nimport { assertNever } from '../../../../../../../base/common/assert.js';\n\nexport class InlineEditsGutterIndicator extends Disposable {\n\n\tprivate get model() {\n\t\tconst model = this._model.get();\n\t\tif (!model) { throw new BugIndicatingError('Inline Edit Model not available'); }\n\t\treturn model;\n\t}\n\n\tprivate readonly _gutterIndicatorStyles;\n\tprivate readonly _isHoveredOverInlineEditDebounced: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editorObs: ObservableCodeEditor,\n\t\tprivate readonly _originalRange: IObservable<LineRange | undefined>,\n\t\tprivate readonly _verticalOffset: IObservable<number>,\n\t\tprivate readonly _model: IObservable<IInlineEditModel | undefined>,\n\t\tprivate readonly _isHoveringOverInlineEdit: IObservable<boolean>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IHoverService private readonly _hoverService: HoverService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IThemeService themeService: IThemeService,\n\t) {\n\t\tsuper();\n\n\t\tthis._tabAction = derived(this, reader => {\n\t\t\tconst model = this._model.read(reader);\n\t\t\tif (!model) { return InlineEditTabAction.Inactive; }\n\t\t\treturn model.tabAction.read(reader);\n\t\t});\n\n\t\tthis._hoverVisible = observableValue(this, false);\n\t\tthis.isHoverVisible = this._hoverVisible;\n\t\tthis._isHoveredOverIcon = observableValue(this, false);\n\t\tthis._isHoveredOverIconDebounced = debouncedObservable(this._isHoveredOverIcon, 100);\n\t\tthis.isHoveredOverIcon = this._isHoveredOverIconDebounced;\n\t\tthis._isHoveredOverInlineEditDebounced = debouncedObservable(this._isHoveringOverInlineEdit, 100);\n\n\t\tthis._gutterIndicatorStyles = this._tabAction.map(this, (v, reader) => {\n\t\t\tswitch (v) {\n\t\t\t\tcase InlineEditTabAction.Inactive: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorSecondaryBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorSecondaryForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorSecondaryBorder, themeService).read(reader).toString(),\n\t\t\t\t};\n\t\t\t\tcase InlineEditTabAction.Jump: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorPrimaryBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorPrimaryForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorPrimaryBorder, themeService).read(reader).toString()\n\t\t\t\t};\n\t\t\t\tcase InlineEditTabAction.Accept: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorsuccessfulBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorsuccessfulForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorsuccessfulBorder, themeService).read(reader).toString()\n\t\t\t\t};\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(v);\n\t\t\t}\n\t\t});\n\n\t\tthis._originalRangeObs = mapOutFalsy(this._originalRange);\n\t\tthis._state = derived(this, reader => {\n\t\t\tconst range = this._originalRangeObs.read(reader);\n\t\t\tif (!range) { return undefined; }\n\t\t\treturn {\n\t\t\t\trange,\n\t\t\t\tlineOffsetRange: this._editorObs.observeLineOffsetRange(range, this._store),\n\t\t\t};\n\t\t});\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController\n\t\t\t? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight)\n\t\t\t: constObservable(0);\n\t\tthis._lineNumberToRender = derived(this, reader => {\n\t\t\tif (this._verticalOffset.read(reader) !== 0) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst lineNumber = this._originalRange.read(reader)?.startLineNumber;\n\t\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\n\t\t\tif (lineNumber === undefined || lineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Interval) {\n\t\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\t\tif (lineNumber % 10 === 0 || cursorPosition && cursorPosition.lineNumber === lineNumber) {\n\t\t\t\t\treturn lineNumber.toString();\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\t\tif (!cursorPosition) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\tconst relativeLineNumber = Math.abs(lineNumber - cursorPosition.lineNumber);\n\t\t\t\tif (relativeLineNumber === 0) {\n\t\t\t\t\treturn lineNumber.toString();\n\t\t\t\t}\n\t\t\t\treturn relativeLineNumber.toString();\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Custom) {\n\t\t\t\tif (lineNumberOptions.renderFn) {\n\t\t\t\t\treturn lineNumberOptions.renderFn(lineNumber);\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\treturn lineNumber.toString();\n\t\t});\n\t\tthis._availableWidthForIcon = derived(this, reader => {\n\t\t\tconst textModel = this._editorObs.editor.getModel();\n\t\t\tconst editor = this._editorObs.editor;\n\t\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\t\t\tconst gutterWidth = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft;\n\n\t\t\tif (!textModel || gutterWidth <= 0) {\n\t\t\t\treturn () => 0;\n\t\t\t}\n\n\t\t\t// no glyph margin => the entire gutter width is available as there is no optimal place to put the icon\n\t\t\tif (layout.lineNumbersLeft === 0) {\n\t\t\t\treturn () => gutterWidth;\n\t\t\t}\n\n\t\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative || /* likely to flicker */\n\t\t\t\tlineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\t\treturn () => gutterWidth;\n\t\t\t}\n\n\t\t\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst rightOfLineNumber = layout.lineNumbersLeft + layout.lineNumbersWidth;\n\t\t\tconst totalLines = textModel.getLineCount();\n\t\t\tconst totalLinesDigits = (totalLines + 1 /* 0 based to 1 based*/).toString().length;\n\n\t\t\tconst offsetDigits: {\n\t\t\t\tfirstLineNumberWithDigitCount: number;\n\t\t\t\ttopOfLineNumber: number;\n\t\t\t\tusableWidthLeftOfLineNumber: number;\n\t\t\t}[] = [];\n\n\t\t\t// We only need to pre compute the usable width left of the line number for the first line number with a given digit count\n\t\t\tfor (let digits = 1; digits <= totalLinesDigits; digits++) {\n\t\t\t\tconst firstLineNumberWithDigitCount = 10 ** (digits - 1);\n\t\t\t\tconst topOfLineNumber = editor.getTopForLineNumber(firstLineNumberWithDigitCount);\n\t\t\t\tconst digitsWidth = digits * w;\n\t\t\t\tconst usableWidthLeftOfLineNumber = Math.min(gutterWidth, Math.max(0, rightOfLineNumber - digitsWidth - layout.glyphMarginLeft));\n\t\t\t\toffsetDigits.push({ firstLineNumberWithDigitCount, topOfLineNumber, usableWidthLeftOfLineNumber });\n\t\t\t}\n\n\t\t\treturn (topOffset: number) => {\n\t\t\t\tfor (let i = offsetDigits.length - 1; i >= 0; i--) {\n\t\t\t\t\tif (topOffset >= offsetDigits[i].topOfLineNumber) {\n\t\t\t\t\t\treturn offsetDigits[i].usableWidthLeftOfLineNumber;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new BugIndicatingError('Could not find avilable width for icon');\n\t\t\t};\n\t\t});\n\t\tthis._layout = derived(this, reader => {\n\t\t\tconst s = this._state.read(reader);\n\t\t\tif (!s) { return undefined; }\n\n\t\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\n\t\t\tconst lineHeight = this._editorObs.observeLineHeightForLine(s.range.map(r => r.startLineNumber)).read(reader);\n\t\t\tconst gutterViewPortPadding = 2;\n\n\t\t\t// Entire gutter view from top left to bottom right\n\t\t\tconst gutterWidthWithoutPadding = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft - 2 * gutterViewPortPadding;\n\t\t\tconst gutterHeightWithoutPadding = layout.height - 2 * gutterViewPortPadding;\n\t\t\tconst gutterViewPortWithStickyScroll = Rect.fromLeftTopWidthHeight(gutterViewPortPadding, gutterViewPortPadding, gutterWidthWithoutPadding, gutterHeightWithoutPadding);\n\t\t\tconst gutterViewPortWithoutStickyScrollWithoutPaddingTop = gutterViewPortWithStickyScroll.withTop(this._stickyScrollHeight.read(reader));\n\t\t\tconst gutterViewPortWithoutStickyScroll = gutterViewPortWithStickyScroll.withTop(gutterViewPortWithoutStickyScrollWithoutPaddingTop.top + gutterViewPortPadding);\n\n\t\t\t// The glyph margin area across all relevant lines\n\t\t\tconst verticalEditRange = s.lineOffsetRange.read(reader);\n\t\t\tconst gutterEditArea = Rect.fromRanges(OffsetRange.fromTo(gutterViewPortWithoutStickyScroll.left, gutterViewPortWithoutStickyScroll.right), verticalEditRange);\n\n\t\t\t// The gutter view container (pill)\n\t\t\tconst pillHeight = lineHeight;\n\t\t\tconst pillOffset = this._verticalOffset.read(reader);\n\t\t\tconst pillFullyDockedRect = gutterEditArea.withHeight(pillHeight).translateY(pillOffset);\n\t\t\tconst pillIsFullyDocked = gutterViewPortWithoutStickyScrollWithoutPaddingTop.containsRect(pillFullyDockedRect);\n\n\t\t\t// The icon which will be rendered in the pill\n\t\t\tconst iconNoneDocked = this._tabAction.map(action => action === InlineEditTabAction.Accept ? Codicon.keyboardTab : Codicon.arrowRight);\n\t\t\tconst iconDocked = derived(this, reader => {\n\t\t\t\tif (this._isHoveredOverIconDebounced.read(reader) || this._isHoveredOverInlineEditDebounced.read(reader)) {\n\t\t\t\t\treturn Codicon.check;\n\t\t\t\t}\n\t\t\t\tif (this._tabAction.read(reader) === InlineEditTabAction.Accept) {\n\t\t\t\t\treturn Codicon.keyboardTab;\n\t\t\t\t}\n\t\t\t\tconst cursorLineNumber = this._editorObs.cursorLineNumber.read(reader) ?? 0;\n\t\t\t\tconst editStartLineNumber = s.range.read(reader).startLineNumber;\n\t\t\t\treturn cursorLineNumber <= editStartLineNumber ? Codicon.keyboardTabAbove : Codicon.keyboardTabBelow;\n\t\t\t});\n\n\t\t\tconst idealIconWidth = 22;\n\t\t\tconst minimalIconWidth = 16; // codicon size\n\t\t\tconst iconWidth = (pillRect: Rect) => {\n\t\t\t\tconst availableWidth = this._availableWidthForIcon.get()(pillRect.bottom + this._editorObs.editor.getScrollTop()) - gutterViewPortPadding;\n\t\t\t\treturn Math.max(Math.min(availableWidth, idealIconWidth), minimalIconWidth);\n\t\t\t};\n\n\t\t\tif (pillIsFullyDocked) {\n\t\t\t\tconst pillRect = pillFullyDockedRect;\n\n\t\t\t\tlet lineNumberWidth;\n\t\t\t\tif (layout.lineNumbersWidth === 0) {\n\t\t\t\t\tlineNumberWidth = Math.min(Math.max(layout.lineNumbersLeft - gutterViewPortWithStickyScroll.left, 0), pillRect.width - idealIconWidth);\n\t\t\t\t} else {\n\t\t\t\t\tlineNumberWidth = Math.max(layout.lineNumbersLeft + layout.lineNumbersWidth - gutterViewPortWithStickyScroll.left, 0);\n\t\t\t\t}\n\n\t\t\t\tconst lineNumberRect = pillRect.withWidth(lineNumberWidth);\n\t\t\t\tconst iconWidth = Math.max(Math.min(layout.decorationsWidth, idealIconWidth), minimalIconWidth);\n\t\t\t\tconst iconRect = pillRect.withWidth(iconWidth).translateX(lineNumberWidth);\n\n\t\t\t\treturn {\n\t\t\t\t\tgutterEditArea,\n\t\t\t\t\ticon: iconDocked,\n\t\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\t\ticonRect,\n\t\t\t\t\tpillRect,\n\t\t\t\t\tlineNumberRect,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst pillPartiallyDockedPossibleArea = gutterViewPortWithStickyScroll.intersect(gutterEditArea); // The area in which the pill could be partially docked\n\t\t\tconst pillIsPartiallyDocked = pillPartiallyDockedPossibleArea && pillPartiallyDockedPossibleArea.height >= pillHeight;\n\n\t\t\tif (pillIsPartiallyDocked) {\n\t\t\t\t// pillFullyDockedRect is outside viewport, move it into the viewport under sticky scroll as we prefer the pill to not be on top of the sticky scroll\n\t\t\t\t// then move it into the possible area which will only cause it to move if it has to be rendered on top of the sticky scroll\n\t\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithoutStickyScroll).moveToBeContainedIn(pillPartiallyDockedPossibleArea);\n\t\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\t\tconst iconRect = pillRect;\n\n\t\t\t\treturn {\n\t\t\t\t\tgutterEditArea,\n\t\t\t\t\ticon: iconDocked,\n\t\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\t\ticonRect,\n\t\t\t\t\tpillRect,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// pillFullyDockedRect is outside viewport, so move it into viewport\n\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithStickyScroll);\n\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\tconst iconRect = pillRect;\n\n\t\t\t// docked = pill was already in the viewport\n\t\t\tconst iconDirection = pillRect.top < pillFullyDockedRect.top ?\n\t\t\t\t'top' as const :\n\t\t\t\t'bottom' as const;\n\n\t\t\treturn {\n\t\t\t\tgutterEditArea,\n\t\t\t\ticon: iconNoneDocked,\n\t\t\t\ticonDirection,\n\t\t\t\ticonRect,\n\t\t\t\tpillRect,\n\t\t\t};\n\t\t});\n\t\tthis._iconRef = n.ref<HTMLDivElement>();\n\t\tthis.isVisible = this._layout.map(l => !!l);\n\t\tthis._indicator = n.div({\n\t\t\tclass: 'inline-edits-view-gutter-indicator',\n\t\t\tonclick: () => {\n\t\t\t\tconst layout = this._layout.get();\n\t\t\t\tconst acceptOnClick = layout?.icon.get() === Codicon.check;\n\n\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\tif (acceptOnClick) {\n\t\t\t\t\tthis.model.accept();\n\t\t\t\t} else {\n\t\t\t\t\tthis.model.jump();\n\t\t\t\t}\n\t\t\t},\n\t\t\ttabIndex: 0,\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'visible',\n\t\t\t},\n\t\t}, mapOutFalsy(this._layout).map(layout => !layout ? [] : [\n\t\t\tn.div({\n\t\t\t\tstyle: {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tbackground: asCssVariable(inlineEditIndicatorBackground),\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t...rectToProps(reader => layout.read(reader).gutterEditArea),\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'icon',\n\t\t\t\tref: this._iconRef,\n\t\t\t\tonmouseenter: () => {\n\t\t\t\t\t// TODO show hover when hovering ghost text etc.\n\t\t\t\t\tthis._showHover();\n\t\t\t\t},\n\t\t\t\tstyle: {\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tzIndex: '20',\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tbackgroundColor: this._gutterIndicatorStyles.map(v => v.background),\n\t\t\t\t\t['--vscodeIconForeground' as any]: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t\tborder: this._gutterIndicatorStyles.map(v => `1px solid ${v.border}`),\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\ttransition: 'background-color 0.2s ease-in-out, width 0.2s ease-in-out',\n\t\t\t\t\t...rectToProps(reader => layout.read(reader).pillRect),\n\t\t\t\t}\n\t\t\t}, [\n\t\t\t\tn.div({\n\t\t\t\t\tclassName: 'line-number',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tlineHeight: layout.map(l => l.lineNumberRect ? l.lineNumberRect.height : 0),\n\t\t\t\t\t\tdisplay: layout.map(l => l.lineNumberRect ? 'flex' : 'none'),\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\t\twidth: layout.map(l => l.lineNumberRect ? l.lineNumberRect.width : 0),\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\tcolor: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\tthis._lineNumberToRender\n\t\t\t\t),\n\t\t\t\tn.div({\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\trotate: layout.map(l => `${getRotationFromDirection(l.iconDirection)}deg`),\n\t\t\t\t\t\ttransition: 'rotate 0.2s ease-in-out',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\tmarginRight: layout.map(l => l.pillRect.width - l.iconRect.width - (l.lineNumberRect?.width ?? 0)),\n\t\t\t\t\t\twidth: layout.map(l => l.iconRect.width),\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tlayout.map((l, reader) => renderIcon(l.icon.read(reader))),\n\t\t\t\t])\n\t\t\t]),\n\t\t])).keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._indicator.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tconst state = this._state.get();\n\t\t\tif (state === undefined) { return; }\n\n\t\t\tconst el = this._iconRef.element;\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tconst rectangularArea = Rect.fromLeftTopWidthHeight(rect.left, rect.top, rect.width, rect.height);\n\t\t\tconst point = new Point(e.event.posx, e.event.posy);\n\t\t\tthis._isHoveredOverIcon.set(rectangularArea.containsPoint(point), undefined);\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onDidScrollChange(() => {\n\t\t\tthis._isHoveredOverIcon.set(false, undefined);\n\t\t}));\n\n\t\t// pulse animation when hovering inline edit\n\t\tthis._register(runOnChange(this._isHoveredOverInlineEditDebounced, (isHovering) => {\n\t\t\tif (isHovering) {\n\t\t\t\tthis.triggerAnimation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._indicator.readEffect(reader);\n\t\t\tif (this._indicator.element) {\n\t\t\t\tthis._editorObs.editor.applyFontInfo(this._indicator.element);\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic triggerAnimation(): Promise<Animation> {\n\t\tif (this._accessibilityService.isMotionReduced()) {\n\t\t\treturn new Animation(null, null).finished;\n\t\t}\n\n\t\t// PULSE ANIMATION:\n\t\tconst animation = this._iconRef.element.animate([\n\t\t\t{\n\t\t\t\toutline: `2px solid ${this._gutterIndicatorStyles.map(v => v.border).get()}`,\n\t\t\t\toutlineOffset: '-1px',\n\t\t\t\toffset: 0\n\t\t\t},\n\t\t\t{\n\t\t\t\toutline: `2px solid transparent`,\n\t\t\t\toutlineOffset: '10px',\n\t\t\t\toffset: 1\n\t\t\t},\n\t\t], { duration: 500 });\n\n\t\treturn animation.finished;\n\t}\n\n\tprivate readonly _originalRangeObs;\n\n\tprivate readonly _state;\n\n\tprivate readonly _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _lineNumberToRender;\n\n\tprivate readonly _availableWidthForIcon;\n\n\tprivate readonly _layout;\n\n\n\tprivate readonly _iconRef;\n\n\tpublic readonly isVisible;\n\n\tprivate readonly _hoverVisible;\n\tpublic readonly isHoverVisible: IObservable<boolean>;\n\n\tprivate readonly _isHoveredOverIcon;\n\tprivate readonly _isHoveredOverIconDebounced: IObservable<boolean>;\n\tpublic readonly isHoveredOverIcon: IObservable<boolean>;\n\n\tprivate _showHover(): void {\n\t\tif (this._hoverVisible.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst disposableStore = new DisposableStore();\n\t\tconst content = disposableStore.add(this._instantiationService.createInstance(\n\t\t\tGutterIndicatorMenuContent,\n\t\t\tthis.model,\n\t\t\t(focusEditor) => {\n\t\t\t\tif (focusEditor) {\n\t\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\t}\n\t\t\t\th?.dispose();\n\t\t\t},\n\t\t\tthis._editorObs,\n\t\t).toDisposableLiveElement());\n\n\t\tconst focusTracker = disposableStore.add(trackFocus(content.element));\n\t\tdisposableStore.add(focusTracker.onDidBlur(() => this._focusIsInMenu.set(false, undefined)));\n\t\tdisposableStore.add(focusTracker.onDidFocus(() => this._focusIsInMenu.set(true, undefined)));\n\t\tdisposableStore.add(toDisposable(() => this._focusIsInMenu.set(false, undefined)));\n\n\t\tconst h = this._hoverService.showInstantHover({\n\t\t\ttarget: this._iconRef.element,\n\t\t\tcontent: content.element,\n\t\t}) as HoverWidget | undefined;\n\t\tif (h) {\n\t\t\tthis._hoverVisible.set(true, undefined);\n\t\t\tdisposableStore.add(this._editorObs.editor.onDidScrollChange(() => h.dispose()));\n\t\t\tdisposableStore.add(h.onDispose(() => {\n\t\t\t\tthis._hoverVisible.set(false, undefined);\n\t\t\t\tdisposableStore.dispose();\n\t\t\t}));\n\t\t} else {\n\t\t\tdisposableStore.dispose();\n\t\t}\n\t}\n\n\tprivate readonly _tabAction;\n\n\tprivate readonly _indicator;\n}\n\nfunction getRotationFromDirection(direction: 'top' | 'bottom' | 'right'): number {\n\tswitch (direction) {\n\t\tcase 'top': return 90;\n\t\tcase 'bottom': return -90;\n\t\tcase 'right': return 0;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { n, trackFocus } from '../../../../../../../base/browser/dom.js';\nimport { renderIcon } from '../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../../base/common/codicons.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../../../../../base/common/lifecycle.js';\nimport { IObservable, ISettableObservable, autorun, constObservable, debouncedObservable, derived, observableFromEvent, observableValue, runOnChange } from '../../../../../../../base/common/observable.js';\nimport { IAccessibilityService } from '../../../../../../../platform/accessibility/common/accessibility.js';\nimport { IHoverService } from '../../../../../../../platform/hover/browser/hover.js';\nimport { IInstantiationService } from '../../../../../../../platform/instantiation/common/instantiation.js';\nimport { asCssVariable } from '../../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';\nimport { IEditorMouseEvent } from '../../../../../../browser/editorBrowser.js';\nimport { ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { HoverService } from '../../../../../../browser/services/hoverService/hoverService.js';\nimport { HoverWidget } from '../../../../../../browser/services/hoverService/hoverWidget.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { StickyScrollController } from '../../../../../stickyScroll/browser/stickyScrollController.js';\nimport { IInlineEditModel, InlineEditTabAction } from '../inlineEditsViewInterface.js';\nimport { getEditorBlendedColor, inlineEditIndicatorBackground, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryBorder, inlineEditIndicatorPrimaryForeground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorSecondaryBorder, inlineEditIndicatorSecondaryForeground, inlineEditIndicatorsuccessfulBackground, inlineEditIndicatorsuccessfulBorder, inlineEditIndicatorsuccessfulForeground } from '../theme.js';\nimport { mapOutFalsy, rectToProps } from '../utils/utils.js';\nimport { GutterIndicatorMenuContent } from './gutterIndicatorMenu.js';\nimport { assertNever } from '../../../../../../../base/common/assert.js';\n\nexport class InlineEditsGutterIndicator extends Disposable {\n\n\tprivate get model() {\n\t\tconst model = this._model.get();\n\t\tif (!model) { throw new BugIndicatingError('Inline Edit Model not available'); }\n\t\treturn model;\n\t}\n\n\tprivate readonly _gutterIndicatorStyles;\n\tprivate readonly _isHoveredOverInlineEditDebounced: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editorObs: ObservableCodeEditor,\n\t\tprivate readonly _originalRange: IObservable<LineRange | undefined>,\n\t\tprivate readonly _verticalOffset: IObservable<number>,\n\t\tprivate readonly _model: IObservable<IInlineEditModel | undefined>,\n\t\tprivate readonly _isHoveringOverInlineEdit: IObservable<boolean>,\n\t\tprivate readonly _focusIsInMenu: ISettableObservable<boolean>,\n\t\t@IHoverService private readonly _hoverService: HoverService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IThemeService themeService: IThemeService,\n\t) {\n\t\tsuper();\n\n\t\tthis._tabAction = derived(this, reader => {\n\t\t\tconst model = this._model.read(reader);\n\t\t\tif (!model) { return InlineEditTabAction.Inactive; }\n\t\t\treturn model.tabAction.read(reader);\n\t\t});\n\n\t\tthis._hoverVisible = observableValue(this, false);\n\t\tthis.isHoverVisible = this._hoverVisible;\n\t\tthis._isHoveredOverIcon = observableValue(this, false);\n\t\tthis._isHoveredOverIconDebounced = debouncedObservable(this._isHoveredOverIcon, 100);\n\t\tthis.isHoveredOverIcon = this._isHoveredOverIconDebounced;\n\t\tthis._isHoveredOverInlineEditDebounced = debouncedObservable(this._isHoveringOverInlineEdit, 100);\n\n\t\tthis._gutterIndicatorStyles = this._tabAction.map(this, (v, reader) => {\n\t\t\tswitch (v) {\n\t\t\t\tcase InlineEditTabAction.Inactive: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorSecondaryBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorSecondaryForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorSecondaryBorder, themeService).read(reader).toString(),\n\t\t\t\t};\n\t\t\t\tcase InlineEditTabAction.Jump: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorPrimaryBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorPrimaryForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorPrimaryBorder, themeService).read(reader).toString()\n\t\t\t\t};\n\t\t\t\tcase InlineEditTabAction.Accept: return {\n\t\t\t\t\tbackground: getEditorBlendedColor(inlineEditIndicatorsuccessfulBackground, themeService).read(reader).toString(),\n\t\t\t\t\tforeground: getEditorBlendedColor(inlineEditIndicatorsuccessfulForeground, themeService).read(reader).toString(),\n\t\t\t\t\tborder: getEditorBlendedColor(inlineEditIndicatorsuccessfulBorder, themeService).read(reader).toString()\n\t\t\t\t};\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(v);\n\t\t\t}\n\t\t});\n\n\t\tthis._originalRangeObs = mapOutFalsy(this._originalRange);\n\t\tthis._state = derived(this, reader => {\n\t\t\tconst range = this._originalRangeObs.read(reader);\n\t\t\tif (!range) { return undefined; }\n\t\t\treturn {\n\t\t\t\trange,\n\t\t\t\tlineOffsetRange: this._editorObs.observeLineOffsetRange(range, this._store),\n\t\t\t};\n\t\t});\n\t\tthis._stickyScrollController = StickyScrollController.get(this._editorObs.editor);\n\t\tthis._stickyScrollHeight = this._stickyScrollController\n\t\t\t? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController!.stickyScrollWidgetHeight)\n\t\t\t: constObservable(0);\n\t\tthis._lineNumberToRender = derived(this, reader => {\n\t\t\tif (this._verticalOffset.read(reader) !== 0) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst lineNumber = this._originalRange.read(reader)?.startLineNumber;\n\t\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\n\t\t\tif (lineNumber === undefined || lineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Interval) {\n\t\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\t\tif (lineNumber % 10 === 0 || cursorPosition && cursorPosition.lineNumber === lineNumber) {\n\t\t\t\t\treturn lineNumber.toString();\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tconst cursorPosition = this._editorObs.cursorPosition.read(reader);\n\t\t\t\tif (!cursorPosition) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\tconst relativeLineNumber = Math.abs(lineNumber - cursorPosition.lineNumber);\n\t\t\t\tif (relativeLineNumber === 0) {\n\t\t\t\t\treturn lineNumber.toString();\n\t\t\t\t}\n\t\t\t\treturn relativeLineNumber.toString();\n\t\t\t}\n\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Custom) {\n\t\t\t\tif (lineNumberOptions.renderFn) {\n\t\t\t\t\treturn lineNumberOptions.renderFn(lineNumber);\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\treturn lineNumber.toString();\n\t\t});\n\t\tthis._availableWidthForIcon = derived(this, reader => {\n\t\t\tconst textModel = this._editorObs.editor.getModel();\n\t\t\tconst editor = this._editorObs.editor;\n\t\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\t\t\tconst gutterWidth = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft;\n\n\t\t\tif (!textModel || gutterWidth <= 0) {\n\t\t\t\treturn () => 0;\n\t\t\t}\n\n\t\t\t// no glyph margin => the entire gutter width is available as there is no optimal place to put the icon\n\t\t\tif (layout.lineNumbersLeft === 0) {\n\t\t\t\treturn () => gutterWidth;\n\t\t\t}\n\n\t\t\tconst lineNumberOptions = this._editorObs.getOption(EditorOption.lineNumbers).read(reader);\n\t\t\tif (lineNumberOptions.renderType === RenderLineNumbersType.Relative || /* likely to flicker */\n\t\t\t\tlineNumberOptions.renderType === RenderLineNumbersType.Off) {\n\t\t\t\treturn () => gutterWidth;\n\t\t\t}\n\n\t\t\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst rightOfLineNumber = layout.lineNumbersLeft + layout.lineNumbersWidth;\n\t\t\tconst totalLines = textModel.getLineCount();\n\t\t\tconst totalLinesDigits = (totalLines + 1 /* 0 based to 1 based*/).toString().length;\n\n\t\t\tconst offsetDigits: {\n\t\t\t\tfirstLineNumberWithDigitCount: number;\n\t\t\t\ttopOfLineNumber: number;\n\t\t\t\tusableWidthLeftOfLineNumber: number;\n\t\t\t}[] = [];\n\n\t\t\t// We only need to pre compute the usable width left of the line number for the first line number with a given digit count\n\t\t\tfor (let digits = 1; digits <= totalLinesDigits; digits++) {\n\t\t\t\tconst firstLineNumberWithDigitCount = 10 ** (digits - 1);\n\t\t\t\tconst topOfLineNumber = editor.getTopForLineNumber(firstLineNumberWithDigitCount);\n\t\t\t\tconst digitsWidth = digits * w;\n\t\t\t\tconst usableWidthLeftOfLineNumber = Math.min(gutterWidth, Math.max(0, rightOfLineNumber - digitsWidth - layout.glyphMarginLeft));\n\t\t\t\toffsetDigits.push({ firstLineNumberWithDigitCount, topOfLineNumber, usableWidthLeftOfLineNumber });\n\t\t\t}\n\n\t\t\treturn (topOffset: number) => {\n\t\t\t\tfor (let i = offsetDigits.length - 1; i >= 0; i--) {\n\t\t\t\t\tif (topOffset >= offsetDigits[i].topOfLineNumber) {\n\t\t\t\t\t\treturn offsetDigits[i].usableWidthLeftOfLineNumber;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new BugIndicatingError('Could not find avilable width for icon');\n\t\t\t};\n\t\t});\n\t\tthis._layout = derived(this, reader => {\n\t\t\tconst s = this._state.read(reader);\n\t\t\tif (!s) { return undefined; }\n\n\t\t\tconst layout = this._editorObs.layoutInfo.read(reader);\n\n\t\t\tconst lineHeight = this._editorObs.observeLineHeightForLine(s.range.map(r => r.startLineNumber)).read(reader);\n\t\t\tconst gutterViewPortPadding = 2;\n\n\t\t\t// Entire gutter view from top left to bottom right\n\t\t\tconst gutterWidthWithoutPadding = layout.decorationsLeft + layout.decorationsWidth - layout.glyphMarginLeft - 2 * gutterViewPortPadding;\n\t\t\tconst gutterHeightWithoutPadding = layout.height - 2 * gutterViewPortPadding;\n\t\t\tconst gutterViewPortWithStickyScroll = Rect.fromLeftTopWidthHeight(gutterViewPortPadding, gutterViewPortPadding, gutterWidthWithoutPadding, gutterHeightWithoutPadding);\n\t\t\tconst gutterViewPortWithoutStickyScrollWithoutPaddingTop = gutterViewPortWithStickyScroll.withTop(this._stickyScrollHeight.read(reader));\n\t\t\tconst gutterViewPortWithoutStickyScroll = gutterViewPortWithStickyScroll.withTop(gutterViewPortWithoutStickyScrollWithoutPaddingTop.top + gutterViewPortPadding);\n\n\t\t\t// The glyph margin area across all relevant lines\n\t\t\tconst verticalEditRange = s.lineOffsetRange.read(reader);\n\t\t\tconst gutterEditArea = Rect.fromRanges(OffsetRange.fromTo(gutterViewPortWithoutStickyScroll.left, gutterViewPortWithoutStickyScroll.right), verticalEditRange);\n\n\t\t\t// The gutter view container (pill)\n\t\t\tconst pillHeight = lineHeight;\n\t\t\tconst pillOffset = this._verticalOffset.read(reader);\n\t\t\tconst pillFullyDockedRect = gutterEditArea.withHeight(pillHeight).translateY(pillOffset);\n\t\t\tconst pillIsFullyDocked = gutterViewPortWithoutStickyScrollWithoutPaddingTop.containsRect(pillFullyDockedRect);\n\n\t\t\t// The icon which will be rendered in the pill\n\t\t\tconst iconNoneDocked = this._tabAction.map(action => action === InlineEditTabAction.Accept ? Codicon.keyboardTab : Codicon.arrowRight);\n\t\t\tconst iconDocked = derived(this, reader => {\n\t\t\t\tif (this._isHoveredOverIconDebounced.read(reader) || this._isHoveredOverInlineEditDebounced.read(reader)) {\n\t\t\t\t\treturn Codicon.check;\n\t\t\t\t}\n\t\t\t\tif (this._tabAction.read(reader) === InlineEditTabAction.Accept) {\n\t\t\t\t\treturn Codicon.keyboardTab;\n\t\t\t\t}\n\t\t\t\tconst cursorLineNumber = this._editorObs.cursorLineNumber.read(reader) ?? 0;\n\t\t\t\tconst editStartLineNumber = s.range.read(reader).startLineNumber;\n\t\t\t\treturn cursorLineNumber <= editStartLineNumber ? Codicon.keyboardTabAbove : Codicon.keyboardTabBelow;\n\t\t\t});\n\n\t\t\tconst idealIconWidth = 22;\n\t\t\tconst minimalIconWidth = 16; // codicon size\n\t\t\tconst iconWidth = (pillRect: Rect) => {\n\t\t\t\tconst availableWidth = this._availableWidthForIcon.get()(pillRect.bottom + this._editorObs.editor.getScrollTop()) - gutterViewPortPadding;\n\t\t\t\treturn Math.max(Math.min(availableWidth, idealIconWidth), minimalIconWidth);\n\t\t\t};\n\n\t\t\tif (pillIsFullyDocked) {\n\t\t\t\tconst pillRect = pillFullyDockedRect;\n\n\t\t\t\tlet lineNumberWidth;\n\t\t\t\tif (layout.lineNumbersWidth === 0) {\n\t\t\t\t\tlineNumberWidth = Math.min(Math.max(layout.lineNumbersLeft - gutterViewPortWithStickyScroll.left, 0), pillRect.width - idealIconWidth);\n\t\t\t\t} else {\n\t\t\t\t\tlineNumberWidth = Math.max(layout.lineNumbersLeft + layout.lineNumbersWidth - gutterViewPortWithStickyScroll.left, 0);\n\t\t\t\t}\n\n\t\t\t\tconst lineNumberRect = pillRect.withWidth(lineNumberWidth);\n\t\t\t\tconst iconWidth = Math.max(Math.min(layout.decorationsWidth, idealIconWidth), minimalIconWidth);\n\t\t\t\tconst iconRect = pillRect.withWidth(iconWidth).translateX(lineNumberWidth);\n\n\t\t\t\treturn {\n\t\t\t\t\tgutterEditArea,\n\t\t\t\t\ticon: iconDocked,\n\t\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\t\ticonRect,\n\t\t\t\t\tpillRect,\n\t\t\t\t\tlineNumberRect,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst pillPartiallyDockedPossibleArea = gutterViewPortWithStickyScroll.intersect(gutterEditArea); // The area in which the pill could be partially docked\n\t\t\tconst pillIsPartiallyDocked = pillPartiallyDockedPossibleArea && pillPartiallyDockedPossibleArea.height >= pillHeight;\n\n\t\t\tif (pillIsPartiallyDocked) {\n\t\t\t\t// pillFullyDockedRect is outside viewport, move it into the viewport under sticky scroll as we prefer the pill to not be on top of the sticky scroll\n\t\t\t\t// then move it into the possible area which will only cause it to move if it has to be rendered on top of the sticky scroll\n\t\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithoutStickyScroll).moveToBeContainedIn(pillPartiallyDockedPossibleArea);\n\t\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\t\tconst iconRect = pillRect;\n\n\t\t\t\treturn {\n\t\t\t\t\tgutterEditArea,\n\t\t\t\t\ticon: iconDocked,\n\t\t\t\t\ticonDirection: 'right' as const,\n\t\t\t\t\ticonRect,\n\t\t\t\t\tpillRect,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// pillFullyDockedRect is outside viewport, so move it into viewport\n\t\t\tconst pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithStickyScroll);\n\t\t\tconst pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved));\n\t\t\tconst iconRect = pillRect;\n\n\t\t\t// docked = pill was already in the viewport\n\t\t\tconst iconDirection = pillRect.top < pillFullyDockedRect.top ?\n\t\t\t\t'top' as const :\n\t\t\t\t'bottom' as const;\n\n\t\t\treturn {\n\t\t\t\tgutterEditArea,\n\t\t\t\ticon: iconNoneDocked,\n\t\t\t\ticonDirection,\n\t\t\t\ticonRect,\n\t\t\t\tpillRect,\n\t\t\t};\n\t\t});\n\t\tthis._iconRef = n.ref<HTMLDivElement>();\n\t\tthis.isVisible = this._layout.map(l => !!l);\n\t\tthis._indicator = n.div({\n\t\t\tclass: 'inline-edits-view-gutter-indicator',\n\t\t\tonclick: () => {\n\t\t\t\tconst layout = this._layout.get();\n\t\t\t\tconst acceptOnClick = layout?.icon.get() === Codicon.check;\n\n\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\tif (acceptOnClick) {\n\t\t\t\t\tthis.model.accept();\n\t\t\t\t} else {\n\t\t\t\t\tthis.model.jump();\n\t\t\t\t}\n\t\t\t},\n\t\t\ttabIndex: 0,\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'visible',\n\t\t\t},\n\t\t}, mapOutFalsy(this._layout).map(layout => !layout ? [] : [\n\t\t\tn.div({\n\t\t\t\tstyle: {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tbackground: asCssVariable(inlineEditIndicatorBackground),\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t...rectToProps(reader => layout.read(reader).gutterEditArea),\n\t\t\t\t}\n\t\t\t}),\n\t\t\tn.div({\n\t\t\t\tclass: 'icon',\n\t\t\t\tref: this._iconRef,\n\t\t\t\tonmouseenter: () => {\n\t\t\t\t\t// TODO show hover when hovering ghost text etc.\n\t\t\t\t\tthis._showHover();\n\t\t\t\t},\n\t\t\t\tstyle: {\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tzIndex: '20',\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tbackgroundColor: this._gutterIndicatorStyles.map(v => v.background),\n\t\t\t\t\t['--vscodeIconForeground' as any]: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t\tborder: this._gutterIndicatorStyles.map(v => `1px solid ${v.border}`),\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\ttransition: 'background-color 0.2s ease-in-out, width 0.2s ease-in-out',\n\t\t\t\t\t...rectToProps(reader => layout.read(reader).pillRect),\n\t\t\t\t}\n\t\t\t}, [\n\t\t\t\tn.div({\n\t\t\t\t\tclassName: 'line-number',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tlineHeight: layout.map(l => l.lineNumberRect ? l.lineNumberRect.height : 0),\n\t\t\t\t\t\tdisplay: layout.map(l => l.lineNumberRect ? 'flex' : 'none'),\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'flex-end',\n\t\t\t\t\t\twidth: layout.map(l => l.lineNumberRect ? l.lineNumberRect.width : 0),\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\tcolor: this._gutterIndicatorStyles.map(v => v.foreground),\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\tthis._lineNumberToRender\n\t\t\t\t),\n\t\t\t\tn.div({\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\trotate: layout.map(l => `${getRotationFromDirection(l.iconDirection)}deg`),\n\t\t\t\t\t\ttransition: 'rotate 0.2s ease-in-out',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\tmarginRight: layout.map(l => l.pillRect.width - l.iconRect.width - (l.lineNumberRect?.width ?? 0)),\n\t\t\t\t\t\twidth: layout.map(l => l.iconRect.width),\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tlayout.map((l, reader) => renderIcon(l.icon.read(reader))),\n\t\t\t\t])\n\t\t\t]),\n\t\t])).keepUpdated(this._store);\n\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._indicator.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tconst state = this._state.get();\n\t\t\tif (state === undefined) { return; }\n\n\t\t\tconst el = this._iconRef.element;\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tconst rectangularArea = Rect.fromLeftTopWidthHeight(rect.left, rect.top, rect.width, rect.height);\n\t\t\tconst point = new Point(e.event.posx, e.event.posy);\n\t\t\tthis._isHoveredOverIcon.set(rectangularArea.containsPoint(point), undefined);\n\t\t}));\n\n\t\tthis._register(this._editorObs.editor.onDidScrollChange(() => {\n\t\t\tthis._isHoveredOverIcon.set(false, undefined);\n\t\t}));\n\n\t\t// pulse animation when hovering inline edit\n\t\tthis._register(runOnChange(this._isHoveredOverInlineEditDebounced, (isHovering) => {\n\t\t\tif (isHovering) {\n\t\t\t\tthis.triggerAnimation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._indicator.readEffect(reader);\n\t\t\tif (this._indicator.element) {\n\t\t\t\tthis._editorObs.editor.applyFontInfo(this._indicator.element);\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic triggerAnimation(): Promise<Animation> {\n\t\tif (this._accessibilityService.isMotionReduced()) {\n\t\t\treturn new Animation(null, null).finished;\n\t\t}\n\n\t\t// PULSE ANIMATION:\n\t\tconst animation = this._iconRef.element.animate([\n\t\t\t{\n\t\t\t\toutline: `2px solid ${this._gutterIndicatorStyles.map(v => v.border).get()}`,\n\t\t\t\toutlineOffset: '-1px',\n\t\t\t\toffset: 0\n\t\t\t},\n\t\t\t{\n\t\t\t\toutline: `2px solid transparent`,\n\t\t\t\toutlineOffset: '10px',\n\t\t\t\toffset: 1\n\t\t\t},\n\t\t], { duration: 500 });\n\n\t\treturn animation.finished;\n\t}\n\n\tprivate readonly _originalRangeObs;\n\n\tprivate readonly _state;\n\n\tprivate readonly _stickyScrollController;\n\tprivate readonly _stickyScrollHeight;\n\n\tprivate readonly _lineNumberToRender;\n\n\tprivate readonly _availableWidthForIcon;\n\n\tprivate readonly _layout;\n\n\n\tprivate readonly _iconRef;\n\n\tpublic readonly isVisible;\n\n\tprivate readonly _hoverVisible;\n\tpublic readonly isHoverVisible: IObservable<boolean>;\n\n\tprivate readonly _isHoveredOverIcon;\n\tprivate readonly _isHoveredOverIconDebounced: IObservable<boolean>;\n\tpublic readonly isHoveredOverIcon: IObservable<boolean>;\n\n\tprivate _showHover(): void {\n\t\tif (this._hoverVisible.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst disposableStore = new DisposableStore();\n\t\tconst content = disposableStore.add(this._instantiationService.createInstance(\n\t\t\tGutterIndicatorMenuContent,\n\t\t\tthis.model,\n\t\t\t(focusEditor) => {\n\t\t\t\tif (focusEditor) {\n\t\t\t\t\tthis._editorObs.editor.focus();\n\t\t\t\t}\n\t\t\t\th?.dispose();\n\t\t\t},\n\t\t\tthis._editorObs,\n\t\t).toDisposableLiveElement());\n\n\t\tconst focusTracker = disposableStore.add(trackFocus(content.element));\n\t\tdisposableStore.add(focusTracker.onDidBlur(() => this._focusIsInMenu.set(false, undefined)));\n\t\tdisposableStore.add(focusTracker.onDidFocus(() => this._focusIsInMenu.set(true, undefined)));\n\t\tdisposableStore.add(toDisposable(() => this._focusIsInMenu.set(false, undefined)));\n\n\t\tconst h = this._hoverService.showInstantHover({\n\t\t\ttarget: this._iconRef.element,\n\t\t\tcontent: content.element,\n\t\t}) as HoverWidget | undefined;\n\t\tif (h) {\n\t\t\tthis._hoverVisible.set(true, undefined);\n\t\t\tdisposableStore.add(this._editorObs.editor.onDidScrollChange(() => h.dispose()));\n\t\t\tdisposableStore.add(h.onDispose(() => {\n\t\t\t\tthis._hoverVisible.set(false, undefined);\n\t\t\t\tdisposableStore.dispose();\n\t\t\t}));\n\t\t} else {\n\t\t\tdisposableStore.dispose();\n\t\t}\n\t}\n\n\tprivate readonly _tabAction;\n\n\tprivate readonly _indicator;\n}\n\nfunction getRotationFromDirection(direction: 'top' | 'bottom' | 'right'): number {\n\tswitch (direction) {\n\t\tcase 'top': return 90;\n\t\tcase 'bottom': return -90;\n\t\tcase 'right': return 0;\n\t}\n}\n"]}
|
|
@@ -98,6 +98,7 @@ let InlineEditsView = InlineEditsView_1 = class InlineEditsView extends Disposab
|
|
|
98
98
|
return undefined;
|
|
99
99
|
}
|
|
100
100
|
const indicatorDisplayRange = derivedOpts({ owner: this, equalsFn: equalsIfDefined(itemEquals()) }, reader => {
|
|
101
|
+
/** @description indicatorDisplayRange */
|
|
101
102
|
const ghostTextIndicator = this._ghostTextIndicator.read(reader);
|
|
102
103
|
if (ghostTextIndicator) {
|
|
103
104
|
return ghostTextIndicator.lineRange;
|
|
@@ -119,6 +120,7 @@ let InlineEditsView = InlineEditsView_1 = class InlineEditsView extends Disposab
|
|
|
119
120
|
return state.edit.displayRange;
|
|
120
121
|
});
|
|
121
122
|
const modelWithGhostTextSupport = derived(this, reader => {
|
|
123
|
+
/** @description modelWithGhostTextSupport */
|
|
122
124
|
const model = this._model.read(reader);
|
|
123
125
|
if (model) {
|
|
124
126
|
return model;
|