monaco-editor-core 0.55.0-dev-20251031 → 0.55.0-dev-20251101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.messages.cs.js +1 -1
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/editor/common/tokens/sparseMultilineTokens.js +4 -0
- package/esm/vs/editor/common/tokens/sparseMultilineTokens.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +9 -3
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputActions.js.map +1 -1
- package/package.json +2 -2
package/esm/nls.messages.cs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.de.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.fr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.it.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ja.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ko.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.pl.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ru.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.tr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251101(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
Binary file
|
|
@@ -235,6 +235,10 @@ class SparseMultilineTokensStorage {
|
|
|
235
235
|
tokens[destOffset + 2] = tokenEndCharacter;
|
|
236
236
|
tokens[destOffset + 3] = tokenMetadata;
|
|
237
237
|
}
|
|
238
|
+
else if (firstDeltaLine !== 0) {
|
|
239
|
+
// must adjust the delta line in place
|
|
240
|
+
tokens[srcOffset] = tokenDeltaLine - firstDeltaLine;
|
|
241
|
+
}
|
|
238
242
|
newTokenCount++;
|
|
239
243
|
}
|
|
240
244
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/tokens/sparseMultilineTokens.ts","vs/editor/common/tokens/sparseMultilineTokens.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAU,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAE1B,MAAM,CAAC,MAAM,CAAC,eAAuB,EAAE,MAAmB;QAChE,OAAO,IAAI,qBAAqB,CAAC,eAAe,EAAE,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7F,CAAC;IAMD;;OAEG;IACH,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAED,YAAoB,eAAuB,EAAE,MAAoC;QAChF,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAA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,CAAC,CAAC;gBACjG,CAAC,CAAC,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;gBACvE,4BAA4B,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,EAAE;oBAC9D,OAAO,CAAC,KAAK,CAAC,8FAA8F,CAAC,CAAC;gBAC/G,CAAC,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;;AAGF,MAAM,OAAO,gBAAgB;IAI5B,YAAY,MAAmB;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,QAAQ;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAChC,CAAC;IAEM,iBAAiB,CAAC,UAAkB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;IAEM,eAAe,CAAC,UAAkB;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;IAEM,WAAW,CAAC,UAAkB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;CACD","file":"sparseMultilineTokens.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 { CharCode } from '../../../base/common/charCode.js';\nimport { Position } from '../core/position.js';\nimport { IRange, Range } from '../core/range.js';\nimport { countEOL } from '../core/misc/eolCounter.js';\nimport { ITextModel } from '../model.js';\nimport { RateLimiter } from './common.js';\n\n/**\n * Represents sparse tokens over a contiguous range of lines.\n */\nexport class SparseMultilineTokens {\n\n\tpublic static create(startLineNumber: number, tokens: Uint32Array): SparseMultilineTokens {\n\t\treturn new SparseMultilineTokens(startLineNumber, new SparseMultilineTokensStorage(tokens));\n\t}\n\n\tprivate _startLineNumber: number;\n\tprivate _endLineNumber: number;\n\tprivate readonly _tokens: SparseMultilineTokensStorage;\n\n\t/**\n\t * (Inclusive) start line number for these tokens.\n\t */\n\tpublic get startLineNumber(): number {\n\t\treturn this._startLineNumber;\n\t}\n\n\t/**\n\t * (Inclusive) end line number for these tokens.\n\t */\n\tpublic get endLineNumber(): number {\n\t\treturn this._endLineNumber;\n\t}\n\n\tprivate constructor(startLineNumber: number, tokens: SparseMultilineTokensStorage) {\n\t\tthis._startLineNumber = startLineNumber;\n\t\tthis._tokens = tokens;\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic toString(): string {\n\t\treturn this._tokens.toString(this._startLineNumber);\n\t}\n\n\tprivate _updateEndLineNumber(): void {\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this._tokens.isEmpty();\n\t}\n\n\tpublic getLineTokens(lineNumber: number): SparseLineTokens | null {\n\t\tif (this._startLineNumber <= lineNumber && lineNumber <= this._endLineNumber) {\n\t\t\treturn this._tokens.getLineTokens(lineNumber - this._startLineNumber);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst deltaRange = this._tokens.getRange();\n\t\tif (!deltaRange) {\n\t\t\treturn deltaRange;\n\t\t}\n\t\treturn new Range(this._startLineNumber + deltaRange.startLineNumber, deltaRange.startColumn, this._startLineNumber + deltaRange.endLineNumber, deltaRange.endColumn);\n\t}\n\n\tpublic removeTokens(range: Range): void {\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tthis._startLineNumber += this._tokens.removeTokens(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tpublic split(range: Range): [SparseMultilineTokens, SparseMultilineTokens] {\n\t\t// split tokens to two:\n\t\t// a) all the tokens before `range`\n\t\t// b) all the tokens after `range`\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tconst [a, b, bDeltaLine] = this._tokens.split(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\treturn [new SparseMultilineTokens(this._startLineNumber, a), new SparseMultilineTokens(this._startLineNumber + bDeltaLine, b)];\n\t}\n\n\tpublic applyEdit(range: IRange, text: string): void {\n\t\tconst [eolCount, firstLineLength, lastLineLength] = countEOL(text);\n\t\tthis.acceptEdit(range, eolCount, firstLineLength, lastLineLength, text.length > 0 ? text.charCodeAt(0) : CharCode.Null);\n\t}\n\n\tpublic acceptEdit(range: IRange, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\tthis._acceptDeleteRange(range);\n\t\tthis._acceptInsertText(new Position(range.startLineNumber, range.startColumn), eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tprivate _acceptDeleteRange(range: IRange): void {\n\t\tif (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) {\n\t\t\t// Nothing to delete\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst lastLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tif (lastLineIndex < 0) {\n\t\t\t// this deletion occurs entirely before this block, so we only need to adjust line numbers\n\t\t\tconst deletedLinesCount = lastLineIndex - firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedLinesCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (firstLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion occurs entirely after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0 && lastLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion completely encompasses this block\n\t\t\tthis._startLineNumber = 0;\n\t\t\tthis._tokens.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0) {\n\t\t\tconst deletedBefore = -firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedBefore;\n\n\t\t\tthis._tokens.acceptDeleteRange(range.startColumn - 1, 0, 0, lastLineIndex, range.endColumn - 1);\n\t\t} else {\n\t\t\tthis._tokens.acceptDeleteRange(0, firstLineIndex, range.startColumn - 1, lastLineIndex, range.endColumn - 1);\n\t\t}\n\t}\n\n\tprivate _acceptInsertText(position: Position, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\n\t\tif (eolCount === 0 && firstLineLength === 0) {\n\t\t\t// Nothing to insert\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineIndex = position.lineNumber - this._startLineNumber;\n\n\t\tif (lineIndex < 0) {\n\t\t\t// this insertion occurs before this block, so we only need to adjust line numbers\n\t\t\tthis._startLineNumber += eolCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (lineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this insertion occurs after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tokens.acceptInsertText(lineIndex, position.column - 1, eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t}\n\n\tpublic reportIfInvalid(model: ITextModel): void {\n\t\tthis._tokens.reportIfInvalid(model, this._startLineNumber);\n\t}\n}\n\nclass SparseMultilineTokensStorage {\n\t/**\n\t * The encoding of tokens is:\n\t * 4*i deltaLine (from `startLineNumber`)\n\t * 4*i+1 startCharacter (from the line start)\n\t * 4*i+2 endCharacter (from the line start)\n\t * 4*i+3 metadata\n\t */\n\tprivate readonly _tokens: Uint32Array;\n\tprivate _tokenCount: number;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t\tthis._tokenCount = tokens.length / 4;\n\t}\n\n\tpublic toString(startLineNumber: number): string {\n\t\tconst pieces: string[] = [];\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tpieces.push(`(${this._getDeltaLine(i) + startLineNumber},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);\n\t\t}\n\t\treturn `[${pieces.join(',')}]`;\n\t}\n\n\tpublic getMaxDeltaLine(): number {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._getDeltaLine(tokenCount - 1);\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst startChar = this._getStartCharacter(0);\n\t\tconst maxDeltaLine = this._getDeltaLine(tokenCount - 1);\n\t\tconst endChar = this._getEndCharacter(tokenCount - 1);\n\t\treturn new Range(0, startChar + 1, maxDeltaLine, endChar + 1);\n\t}\n\n\tprivate _getTokenCount(): number {\n\t\treturn this._tokenCount;\n\t}\n\n\tprivate _getDeltaLine(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex];\n\t}\n\n\tprivate _getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tprivate _getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn (this._getTokenCount() === 0);\n\t}\n\n\tpublic getLineTokens(deltaLine: number): SparseLineTokens | null {\n\t\tlet low = 0;\n\t\tlet high = this._getTokenCount() - 1;\n\n\t\twhile (low < high) {\n\t\t\tconst mid = low + Math.floor((high - low) / 2);\n\t\t\tconst midDeltaLine = this._getDeltaLine(mid);\n\n\t\t\tif (midDeltaLine < deltaLine) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else if (midDeltaLine > deltaLine) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else {\n\t\t\t\tlet min = mid;\n\t\t\t\twhile (min > low && this._getDeltaLine(min - 1) === deltaLine) {\n\t\t\t\t\tmin--;\n\t\t\t\t}\n\t\t\t\tlet max = mid;\n\t\t\t\twhile (max < high && this._getDeltaLine(max + 1) === deltaLine) {\n\t\t\t\t\tmax++;\n\t\t\t\t}\n\t\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * min, 4 * max + 4));\n\t\t\t}\n\t\t}\n\n\t\tif (this._getDeltaLine(low) === deltaLine) {\n\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * low, 4 * low + 4));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic clear(): void {\n\t\tthis._tokenCount = 0;\n\t}\n\n\tpublic removeTokens(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): number {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tlet firstDeltaLine = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (\n\t\t\t\t(tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))\n\t\t\t\t&& (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))\n\t\t\t) {\n\t\t\t\thasDeletedTokens = true;\n\t\t\t} else {\n\t\t\t\tif (newTokenCount === 0) {\n\t\t\t\t\tfirstDeltaLine = tokenDeltaLine;\n\t\t\t\t}\n\t\t\t\tif (hasDeletedTokens) {\n\t\t\t\t\t// must move the token to the left\n\t\t\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\t\t\ttokens[destOffset] = tokenDeltaLine - firstDeltaLine;\n\t\t\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\t\t}\n\t\t\t\tnewTokenCount++;\n\t\t\t}\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\n\t\treturn firstDeltaLine;\n\t}\n\n\tpublic split(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): [SparseMultilineTokensStorage, SparseMultilineTokensStorage, number] {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst aTokens: number[] = [];\n\t\tconst bTokens: number[] = [];\n\t\tlet destTokens: number[] = aTokens;\n\t\tlet destOffset = 0;\n\t\tlet destFirstDeltaLine: number = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif ((tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))) {\n\t\t\t\tif ((tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))) {\n\t\t\t\t\t// this token is touching the range\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t// this token is after the range\n\t\t\t\t\tif (destTokens !== bTokens) {\n\t\t\t\t\t\t// this token is the first token after the range\n\t\t\t\t\t\tdestTokens = bTokens;\n\t\t\t\t\t\tdestOffset = 0;\n\t\t\t\t\t\tdestFirstDeltaLine = tokenDeltaLine;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdestTokens[destOffset++] = tokenDeltaLine - destFirstDeltaLine;\n\t\t\tdestTokens[destOffset++] = tokenStartCharacter;\n\t\t\tdestTokens[destOffset++] = tokenEndCharacter;\n\t\t\tdestTokens[destOffset++] = tokenMetadata;\n\t\t}\n\n\t\treturn [new SparseMultilineTokensStorage(new Uint32Array(aTokens)), new SparseMultilineTokensStorage(new Uint32Array(bTokens)), destFirstDeltaLine];\n\t}\n\n\tpublic acceptDeleteRange(horizontalShiftForFirstLineTokens: number, startDeltaLine: number, startCharacter: number, endDeltaLine: number, endCharacter: number): void {\n\t\t// This is a bit complex, here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token starts before the deletion range\n\t\t// 1a. The token is completely before the deletion range\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t// ---------------\n\t\t// xxxxxxxx\n\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t// ---------------\n\t\t// xxxxx\n\t\t//\n\t\t// 2. The token starts at the same position with the deletion range\n\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxx\n\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxx\n\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t// -------------\n\t\t// xxxxxxx\n\t\t//\n\t\t// 3. The token starts inside the deletion range\n\t\t// 3a. The token is inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t// ------------\n\t\t// xxxxxxxxxxx\n\t\t//\n\t\t// 4. The token starts after the deletion range\n\t\t// -----------\n\t\t// xxxxxxxx\n\t\t//\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst deletedLineCount = (endDeltaLine - startDeltaLine);\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[srcOffset];\n\t\t\tlet tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tlet tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (tokenDeltaLine < startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter <= startCharacter)) {\n\t\t\t\t// 1a. The token is completely before the deletion range\n\t\t\t\t// => nothing to do\n\t\t\t\tnewTokenCount++;\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter < startCharacter) {\n\t\t\t\t// 1b, 1c, 1d\n\t\t\t\t// => the token survives, but it needs to shrink\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t\t\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t\t\t\t// => the token shrinks its ending to the deletion start\n\t\t\t\t\ttokenEndCharacter = startCharacter;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter === startCharacter) {\n\t\t\t\t// 2a, 2b, 2c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t\t\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter < endCharacter)) {\n\t\t\t\t// 3a, 3b, 3c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t\t\t\t// => the token moves to continue right after the deletion\n\t\t\t\t\ttokenDeltaLine = startDeltaLine;\n\t\t\t\t\ttokenStartCharacter = startCharacter;\n\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 3a. The token is inside the deletion range\n\t\t\t\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine > endDeltaLine) {\n\t\t\t\t// 4. (partial) The token starts after the deletion range, on a line below...\n\t\t\t\tif (deletedLineCount === 0 && !hasDeletedTokens) {\n\t\t\t\t\t// early stop, there is no need to walk all the tokens and do nothing...\n\t\t\t\t\tnewTokenCount = tokenCount;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t} else if (tokenDeltaLine === endDeltaLine && tokenStartCharacter >= endCharacter) {\n\t\t\t\t// 4. (continued) The token starts after the deletion range, on the last line where a deletion occurs\n\t\t\t\tif (horizontalShiftForFirstLineTokens && tokenDeltaLine === 0) {\n\t\t\t\t\ttokenStartCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t\ttokenEndCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t\ttokenStartCharacter -= (endCharacter - startCharacter);\n\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Not possible!`);\n\t\t\t}\n\n\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\ttokens[destOffset] = tokenDeltaLine;\n\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\tnewTokenCount++;\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\t}\n\n\tpublic acceptInsertText(deltaLine: number, character: number, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\t// Here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token is completely before the insertion point\n\t\t// ----------- |\n\t\t// 2. The token ends precisely at the insertion point\n\t\t// -----------|\n\t\t// 3. The token contains the insertion point\n\t\t// -----|------\n\t\t// 4. The token starts precisely at the insertion point\n\t\t// |-----------\n\t\t// 5. The token is completely after the insertion point\n\t\t// | -----------\n\t\t//\n\t\tconst isInsertingPreciselyOneWordCharacter = (\n\t\t\teolCount === 0\n\t\t\t&& firstLineLength === 1\n\t\t\t&& (\n\t\t\t\t(firstCharCode >= CharCode.Digit0 && firstCharCode <= CharCode.Digit9)\n\t\t\t\t|| (firstCharCode >= CharCode.A && firstCharCode <= CharCode.Z)\n\t\t\t\t|| (firstCharCode >= CharCode.a && firstCharCode <= CharCode.z)\n\t\t\t)\n\t\t);\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst offset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[offset];\n\t\t\tlet tokenStartCharacter = tokens[offset + 1];\n\t\t\tlet tokenEndCharacter = tokens[offset + 2];\n\n\t\t\tif (tokenDeltaLine < deltaLine || (tokenDeltaLine === deltaLine && tokenEndCharacter < character)) {\n\t\t\t\t// 1. The token is completely before the insertion point\n\t\t\t\t// => nothing to do\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenEndCharacter === character) {\n\t\t\t\t// 2. The token ends precisely at the insertion point\n\t\t\t\t// => expand the end character only if inserting precisely one character that is a word character\n\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\ttokenEndCharacter += 1;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenStartCharacter < character && character < tokenEndCharacter) {\n\t\t\t\t// 3. The token contains the insertion point\n\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t// => just expand the end character\n\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t} else {\n\t\t\t\t\t// => cut off the token\n\t\t\t\t\ttokenEndCharacter = character;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// 4. or 5.\n\t\t\t\tif (tokenDeltaLine === deltaLine && tokenStartCharacter === character) {\n\t\t\t\t\t// 4. The token starts precisely at the insertion point\n\t\t\t\t\t// => grow the token (by keeping its start constant) only if inserting precisely one character that is a word character\n\t\t\t\t\t// => otherwise behave as in case 5.\n\t\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// => the token must move and keep its size constant\n\t\t\t\tif (tokenDeltaLine === deltaLine) {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t\t// this token is on the line where the insertion is taking place\n\t\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t\ttokenStartCharacter += firstLineLength;\n\t\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst tokenLength = tokenEndCharacter - tokenStartCharacter;\n\t\t\t\t\t\ttokenStartCharacter = lastLineLength + (tokenStartCharacter - character);\n\t\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + tokenLength;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttokens[offset] = tokenDeltaLine;\n\t\t\ttokens[offset + 1] = tokenStartCharacter;\n\t\t\ttokens[offset + 2] = tokenEndCharacter;\n\t\t}\n\t}\n\n\tprivate static _rateLimiter = new RateLimiter(10 / 60); // limit to 10 times per minute\n\n\tpublic reportIfInvalid(model: ITextModel, startLineNumber: number): void {\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tconst lineNumber = this._getDeltaLine(i) + startLineNumber;\n\n\t\t\tif (lineNumber < 1) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: lineNumber < 1');\n\t\t\t\t});\n\t\t\t} else if (lineNumber > model.getLineCount()) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()');\n\t\t\t\t});\n\t\t\t} else if (this._getEndCharacter(i) > model.getLineLength(lineNumber)) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class SparseLineTokens {\n\n\tprivate readonly _tokens: Uint32Array;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._tokens.length / 4;\n\t}\n\n\tpublic getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tpublic getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic getMetadata(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 3];\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 { CharCode } from '../../../base/common/charCode.js';\nimport { Position } from '../core/position.js';\nimport { IRange, Range } from '../core/range.js';\nimport { countEOL } from '../core/misc/eolCounter.js';\nimport { ITextModel } from '../model.js';\nimport { RateLimiter } from './common.js';\n\n/**\n * Represents sparse tokens over a contiguous range of lines.\n */\nexport class SparseMultilineTokens {\n\n\tpublic static create(startLineNumber: number, tokens: Uint32Array): SparseMultilineTokens {\n\t\treturn new SparseMultilineTokens(startLineNumber, new SparseMultilineTokensStorage(tokens));\n\t}\n\n\tprivate _startLineNumber: number;\n\tprivate _endLineNumber: number;\n\tprivate readonly _tokens: SparseMultilineTokensStorage;\n\n\t/**\n\t * (Inclusive) start line number for these tokens.\n\t */\n\tpublic get startLineNumber(): number {\n\t\treturn this._startLineNumber;\n\t}\n\n\t/**\n\t * (Inclusive) end line number for these tokens.\n\t */\n\tpublic get endLineNumber(): number {\n\t\treturn this._endLineNumber;\n\t}\n\n\tprivate constructor(startLineNumber: number, tokens: SparseMultilineTokensStorage) {\n\t\tthis._startLineNumber = startLineNumber;\n\t\tthis._tokens = tokens;\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic toString(): string {\n\t\treturn this._tokens.toString(this._startLineNumber);\n\t}\n\n\tprivate _updateEndLineNumber(): void {\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this._tokens.isEmpty();\n\t}\n\n\tpublic getLineTokens(lineNumber: number): SparseLineTokens | null {\n\t\tif (this._startLineNumber <= lineNumber && lineNumber <= this._endLineNumber) {\n\t\t\treturn this._tokens.getLineTokens(lineNumber - this._startLineNumber);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst deltaRange = this._tokens.getRange();\n\t\tif (!deltaRange) {\n\t\t\treturn deltaRange;\n\t\t}\n\t\treturn new Range(this._startLineNumber + deltaRange.startLineNumber, deltaRange.startColumn, this._startLineNumber + deltaRange.endLineNumber, deltaRange.endColumn);\n\t}\n\n\tpublic removeTokens(range: Range): void {\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tthis._startLineNumber += this._tokens.removeTokens(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tpublic split(range: Range): [SparseMultilineTokens, SparseMultilineTokens] {\n\t\t// split tokens to two:\n\t\t// a) all the tokens before `range`\n\t\t// b) all the tokens after `range`\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tconst [a, b, bDeltaLine] = this._tokens.split(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\treturn [new SparseMultilineTokens(this._startLineNumber, a), new SparseMultilineTokens(this._startLineNumber + bDeltaLine, b)];\n\t}\n\n\tpublic applyEdit(range: IRange, text: string): void {\n\t\tconst [eolCount, firstLineLength, lastLineLength] = countEOL(text);\n\t\tthis.acceptEdit(range, eolCount, firstLineLength, lastLineLength, text.length > 0 ? text.charCodeAt(0) : CharCode.Null);\n\t}\n\n\tpublic acceptEdit(range: IRange, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\tthis._acceptDeleteRange(range);\n\t\tthis._acceptInsertText(new Position(range.startLineNumber, range.startColumn), eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tprivate _acceptDeleteRange(range: IRange): void {\n\t\tif (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) {\n\t\t\t// Nothing to delete\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst lastLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tif (lastLineIndex < 0) {\n\t\t\t// this deletion occurs entirely before this block, so we only need to adjust line numbers\n\t\t\tconst deletedLinesCount = lastLineIndex - firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedLinesCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (firstLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion occurs entirely after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0 && lastLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion completely encompasses this block\n\t\t\tthis._startLineNumber = 0;\n\t\t\tthis._tokens.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0) {\n\t\t\tconst deletedBefore = -firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedBefore;\n\n\t\t\tthis._tokens.acceptDeleteRange(range.startColumn - 1, 0, 0, lastLineIndex, range.endColumn - 1);\n\t\t} else {\n\t\t\tthis._tokens.acceptDeleteRange(0, firstLineIndex, range.startColumn - 1, lastLineIndex, range.endColumn - 1);\n\t\t}\n\t}\n\n\tprivate _acceptInsertText(position: Position, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\n\t\tif (eolCount === 0 && firstLineLength === 0) {\n\t\t\t// Nothing to insert\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineIndex = position.lineNumber - this._startLineNumber;\n\n\t\tif (lineIndex < 0) {\n\t\t\t// this insertion occurs before this block, so we only need to adjust line numbers\n\t\t\tthis._startLineNumber += eolCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (lineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this insertion occurs after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tokens.acceptInsertText(lineIndex, position.column - 1, eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t}\n\n\tpublic reportIfInvalid(model: ITextModel): void {\n\t\tthis._tokens.reportIfInvalid(model, this._startLineNumber);\n\t}\n}\n\nclass SparseMultilineTokensStorage {\n\t/**\n\t * The encoding of tokens is:\n\t * 4*i deltaLine (from `startLineNumber`)\n\t * 4*i+1 startCharacter (from the line start)\n\t * 4*i+2 endCharacter (from the line start)\n\t * 4*i+3 metadata\n\t */\n\tprivate readonly _tokens: Uint32Array;\n\tprivate _tokenCount: number;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t\tthis._tokenCount = tokens.length / 4;\n\t}\n\n\tpublic toString(startLineNumber: number): string {\n\t\tconst pieces: string[] = [];\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tpieces.push(`(${this._getDeltaLine(i) + startLineNumber},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);\n\t\t}\n\t\treturn `[${pieces.join(',')}]`;\n\t}\n\n\tpublic getMaxDeltaLine(): number {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._getDeltaLine(tokenCount - 1);\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst startChar = this._getStartCharacter(0);\n\t\tconst maxDeltaLine = this._getDeltaLine(tokenCount - 1);\n\t\tconst endChar = this._getEndCharacter(tokenCount - 1);\n\t\treturn new Range(0, startChar + 1, maxDeltaLine, endChar + 1);\n\t}\n\n\tprivate _getTokenCount(): number {\n\t\treturn this._tokenCount;\n\t}\n\n\tprivate _getDeltaLine(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex];\n\t}\n\n\tprivate _getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tprivate _getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn (this._getTokenCount() === 0);\n\t}\n\n\tpublic getLineTokens(deltaLine: number): SparseLineTokens | null {\n\t\tlet low = 0;\n\t\tlet high = this._getTokenCount() - 1;\n\n\t\twhile (low < high) {\n\t\t\tconst mid = low + Math.floor((high - low) / 2);\n\t\t\tconst midDeltaLine = this._getDeltaLine(mid);\n\n\t\t\tif (midDeltaLine < deltaLine) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else if (midDeltaLine > deltaLine) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else {\n\t\t\t\tlet min = mid;\n\t\t\t\twhile (min > low && this._getDeltaLine(min - 1) === deltaLine) {\n\t\t\t\t\tmin--;\n\t\t\t\t}\n\t\t\t\tlet max = mid;\n\t\t\t\twhile (max < high && this._getDeltaLine(max + 1) === deltaLine) {\n\t\t\t\t\tmax++;\n\t\t\t\t}\n\t\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * min, 4 * max + 4));\n\t\t\t}\n\t\t}\n\n\t\tif (this._getDeltaLine(low) === deltaLine) {\n\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * low, 4 * low + 4));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic clear(): void {\n\t\tthis._tokenCount = 0;\n\t}\n\n\tpublic removeTokens(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): number {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tlet firstDeltaLine = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (\n\t\t\t\t(tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))\n\t\t\t\t&& (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))\n\t\t\t) {\n\t\t\t\thasDeletedTokens = true;\n\t\t\t} else {\n\t\t\t\tif (newTokenCount === 0) {\n\t\t\t\t\tfirstDeltaLine = tokenDeltaLine;\n\t\t\t\t}\n\t\t\t\tif (hasDeletedTokens) {\n\t\t\t\t\t// must move the token to the left\n\t\t\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\t\t\ttokens[destOffset] = tokenDeltaLine - firstDeltaLine;\n\t\t\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\t\t}\n\t\t\t\tnewTokenCount++;\n\t\t\t}\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\n\t\treturn firstDeltaLine;\n\t}\n\n\tpublic split(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): [SparseMultilineTokensStorage, SparseMultilineTokensStorage, number] {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst aTokens: number[] = [];\n\t\tconst bTokens: number[] = [];\n\t\tlet destTokens: number[] = aTokens;\n\t\tlet destOffset = 0;\n\t\tlet destFirstDeltaLine: number = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif ((tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))) {\n\t\t\t\tif ((tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))) {\n\t\t\t\t\t// this token is touching the range\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t// this token is after the range\n\t\t\t\t\tif (destTokens !== bTokens) {\n\t\t\t\t\t\t// this token is the first token after the range\n\t\t\t\t\t\tdestTokens = bTokens;\n\t\t\t\t\t\tdestOffset = 0;\n\t\t\t\t\t\tdestFirstDeltaLine = tokenDeltaLine;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdestTokens[destOffset++] = tokenDeltaLine - destFirstDeltaLine;\n\t\t\tdestTokens[destOffset++] = tokenStartCharacter;\n\t\t\tdestTokens[destOffset++] = tokenEndCharacter;\n\t\t\tdestTokens[destOffset++] = tokenMetadata;\n\t\t}\n\n\t\treturn [new SparseMultilineTokensStorage(new Uint32Array(aTokens)), new SparseMultilineTokensStorage(new Uint32Array(bTokens)), destFirstDeltaLine];\n\t}\n\n\tpublic acceptDeleteRange(horizontalShiftForFirstLineTokens: number, startDeltaLine: number, startCharacter: number, endDeltaLine: number, endCharacter: number): void {\n\t\t// This is a bit complex, here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token starts before the deletion range\n\t\t// 1a. The token is completely before the deletion range\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t// ---------------\n\t\t// xxxxxxxx\n\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t// ---------------\n\t\t// xxxxx\n\t\t//\n\t\t// 2. The token starts at the same position with the deletion range\n\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxx\n\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxx\n\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t// -------------\n\t\t// xxxxxxx\n\t\t//\n\t\t// 3. The token starts inside the deletion range\n\t\t// 3a. The token is inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t// ------------\n\t\t// xxxxxxxxxxx\n\t\t//\n\t\t// 4. The token starts after the deletion range\n\t\t// -----------\n\t\t// xxxxxxxx\n\t\t//\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst deletedLineCount = (endDeltaLine - startDeltaLine);\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[srcOffset];\n\t\t\tlet tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tlet tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (tokenDeltaLine < startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter <= startCharacter)) {\n\t\t\t\t// 1a. The token is completely before the deletion range\n\t\t\t\t// => nothing to do\n\t\t\t\tnewTokenCount++;\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter < startCharacter) {\n\t\t\t\t// 1b, 1c, 1d\n\t\t\t\t// => the token survives, but it needs to shrink\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t\t\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t\t\t\t// => the token shrinks its ending to the deletion start\n\t\t\t\t\ttokenEndCharacter = startCharacter;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter === startCharacter) {\n\t\t\t\t// 2a, 2b, 2c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t\t\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter < endCharacter)) {\n\t\t\t\t// 3a, 3b, 3c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t\t\t\t// => the token moves to continue right after the deletion\n\t\t\t\t\ttokenDeltaLine = startDeltaLine;\n\t\t\t\t\ttokenStartCharacter = startCharacter;\n\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 3a. The token is inside the deletion range\n\t\t\t\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine > endDeltaLine) {\n\t\t\t\t// 4. (partial) The token starts after the deletion range, on a line below...\n\t\t\t\tif (deletedLineCount === 0 && !hasDeletedTokens) {\n\t\t\t\t\t// early stop, there is no need to walk all the tokens and do nothing...\n\t\t\t\t\tnewTokenCount = tokenCount;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t} else if (tokenDeltaLine === endDeltaLine && tokenStartCharacter >= endCharacter) {\n\t\t\t\t// 4. (continued) The token starts after the deletion range, on the last line where a deletion occurs\n\t\t\t\tif (horizontalShiftForFirstLineTokens && tokenDeltaLine === 0) {\n\t\t\t\t\ttokenStartCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t\ttokenEndCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t\ttokenStartCharacter -= (endCharacter - startCharacter);\n\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Not possible!`);\n\t\t\t}\n\n\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\ttokens[destOffset] = tokenDeltaLine;\n\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\tnewTokenCount++;\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\t}\n\n\tpublic acceptInsertText(deltaLine: number, character: number, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\t// Here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token is completely before the insertion point\n\t\t// ----------- |\n\t\t// 2. The token ends precisely at the insertion point\n\t\t// -----------|\n\t\t// 3. The token contains the insertion point\n\t\t// -----|------\n\t\t// 4. The token starts precisely at the insertion point\n\t\t// |-----------\n\t\t// 5. The token is completely after the insertion point\n\t\t// | -----------\n\t\t//\n\t\tconst isInsertingPreciselyOneWordCharacter = (\n\t\t\teolCount === 0\n\t\t\t&& firstLineLength === 1\n\t\t\t&& (\n\t\t\t\t(firstCharCode >= CharCode.Digit0 && firstCharCode <= CharCode.Digit9)\n\t\t\t\t|| (firstCharCode >= CharCode.A && firstCharCode <= CharCode.Z)\n\t\t\t\t|| (firstCharCode >= CharCode.a && firstCharCode <= CharCode.z)\n\t\t\t)\n\t\t);\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst offset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[offset];\n\t\t\tlet tokenStartCharacter = tokens[offset + 1];\n\t\t\tlet tokenEndCharacter = tokens[offset + 2];\n\n\t\t\tif (tokenDeltaLine < deltaLine || (tokenDeltaLine === deltaLine && tokenEndCharacter < character)) {\n\t\t\t\t// 1. The token is completely before the insertion point\n\t\t\t\t// => nothing to do\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenEndCharacter === character) {\n\t\t\t\t// 2. The token ends precisely at the insertion point\n\t\t\t\t// => expand the end character only if inserting precisely one character that is a word character\n\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\ttokenEndCharacter += 1;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenStartCharacter < character && character < tokenEndCharacter) {\n\t\t\t\t// 3. The token contains the insertion point\n\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t// => just expand the end character\n\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t} else {\n\t\t\t\t\t// => cut off the token\n\t\t\t\t\ttokenEndCharacter = character;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// 4. or 5.\n\t\t\t\tif (tokenDeltaLine === deltaLine && tokenStartCharacter === character) {\n\t\t\t\t\t// 4. The token starts precisely at the insertion point\n\t\t\t\t\t// => grow the token (by keeping its start constant) only if inserting precisely one character that is a word character\n\t\t\t\t\t// => otherwise behave as in case 5.\n\t\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// => the token must move and keep its size constant\n\t\t\t\tif (tokenDeltaLine === deltaLine) {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t\t// this token is on the line where the insertion is taking place\n\t\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t\ttokenStartCharacter += firstLineLength;\n\t\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst tokenLength = tokenEndCharacter - tokenStartCharacter;\n\t\t\t\t\t\ttokenStartCharacter = lastLineLength + (tokenStartCharacter - character);\n\t\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + tokenLength;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttokens[offset] = tokenDeltaLine;\n\t\t\ttokens[offset + 1] = tokenStartCharacter;\n\t\t\ttokens[offset + 2] = tokenEndCharacter;\n\t\t}\n\t}\n\n\tprivate static _rateLimiter = new RateLimiter(10 / 60); // limit to 10 times per minute\n\n\tpublic reportIfInvalid(model: ITextModel, startLineNumber: number): void {\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tconst lineNumber = this._getDeltaLine(i) + startLineNumber;\n\n\t\t\tif (lineNumber < 1) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: lineNumber < 1');\n\t\t\t\t});\n\t\t\t} else if (lineNumber > model.getLineCount()) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()');\n\t\t\t\t});\n\t\t\t} else if (this._getEndCharacter(i) > model.getLineLength(lineNumber)) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class SparseLineTokens {\n\n\tprivate readonly _tokens: Uint32Array;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._tokens.length / 4;\n\t}\n\n\tpublic getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tpublic getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic getMetadata(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 3];\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/tokens/sparseMultilineTokens.ts","vs/editor/common/tokens/sparseMultilineTokens.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAU,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,aA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Ae,CAAC,UAAkB;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;IAEM,WAAW,CAAC,UAAkB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;CACD","file":"sparseMultilineTokens.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 { CharCode } from '../../../base/common/charCode.js';\nimport { Position } from '../core/position.js';\nimport { IRange, Range } from '../core/range.js';\nimport { countEOL } from '../core/misc/eolCounter.js';\nimport { ITextModel } from '../model.js';\nimport { RateLimiter } from './common.js';\n\n/**\n * Represents sparse tokens over a contiguous range of lines.\n */\nexport class SparseMultilineTokens {\n\n\tpublic static create(startLineNumber: number, tokens: Uint32Array): SparseMultilineTokens {\n\t\treturn new SparseMultilineTokens(startLineNumber, new SparseMultilineTokensStorage(tokens));\n\t}\n\n\tprivate _startLineNumber: number;\n\tprivate _endLineNumber: number;\n\tprivate readonly _tokens: SparseMultilineTokensStorage;\n\n\t/**\n\t * (Inclusive) start line number for these tokens.\n\t */\n\tpublic get startLineNumber(): number {\n\t\treturn this._startLineNumber;\n\t}\n\n\t/**\n\t * (Inclusive) end line number for these tokens.\n\t */\n\tpublic get endLineNumber(): number {\n\t\treturn this._endLineNumber;\n\t}\n\n\tprivate constructor(startLineNumber: number, tokens: SparseMultilineTokensStorage) {\n\t\tthis._startLineNumber = startLineNumber;\n\t\tthis._tokens = tokens;\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic toString(): string {\n\t\treturn this._tokens.toString(this._startLineNumber);\n\t}\n\n\tprivate _updateEndLineNumber(): void {\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this._tokens.isEmpty();\n\t}\n\n\tpublic getLineTokens(lineNumber: number): SparseLineTokens | null {\n\t\tif (this._startLineNumber <= lineNumber && lineNumber <= this._endLineNumber) {\n\t\t\treturn this._tokens.getLineTokens(lineNumber - this._startLineNumber);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst deltaRange = this._tokens.getRange();\n\t\tif (!deltaRange) {\n\t\t\treturn deltaRange;\n\t\t}\n\t\treturn new Range(this._startLineNumber + deltaRange.startLineNumber, deltaRange.startColumn, this._startLineNumber + deltaRange.endLineNumber, deltaRange.endColumn);\n\t}\n\n\tpublic removeTokens(range: Range): void {\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tthis._startLineNumber += this._tokens.removeTokens(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tpublic split(range: Range): [SparseMultilineTokens, SparseMultilineTokens] {\n\t\t// split tokens to two:\n\t\t// a) all the tokens before `range`\n\t\t// b) all the tokens after `range`\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tconst [a, b, bDeltaLine] = this._tokens.split(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\treturn [new SparseMultilineTokens(this._startLineNumber, a), new SparseMultilineTokens(this._startLineNumber + bDeltaLine, b)];\n\t}\n\n\tpublic applyEdit(range: IRange, text: string): void {\n\t\tconst [eolCount, firstLineLength, lastLineLength] = countEOL(text);\n\t\tthis.acceptEdit(range, eolCount, firstLineLength, lastLineLength, text.length > 0 ? text.charCodeAt(0) : CharCode.Null);\n\t}\n\n\tpublic acceptEdit(range: IRange, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\tthis._acceptDeleteRange(range);\n\t\tthis._acceptInsertText(new Position(range.startLineNumber, range.startColumn), eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tprivate _acceptDeleteRange(range: IRange): void {\n\t\tif (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) {\n\t\t\t// Nothing to delete\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst lastLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tif (lastLineIndex < 0) {\n\t\t\t// this deletion occurs entirely before this block, so we only need to adjust line numbers\n\t\t\tconst deletedLinesCount = lastLineIndex - firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedLinesCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (firstLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion occurs entirely after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0 && lastLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion completely encompasses this block\n\t\t\tthis._startLineNumber = 0;\n\t\t\tthis._tokens.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0) {\n\t\t\tconst deletedBefore = -firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedBefore;\n\n\t\t\tthis._tokens.acceptDeleteRange(range.startColumn - 1, 0, 0, lastLineIndex, range.endColumn - 1);\n\t\t} else {\n\t\t\tthis._tokens.acceptDeleteRange(0, firstLineIndex, range.startColumn - 1, lastLineIndex, range.endColumn - 1);\n\t\t}\n\t}\n\n\tprivate _acceptInsertText(position: Position, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\n\t\tif (eolCount === 0 && firstLineLength === 0) {\n\t\t\t// Nothing to insert\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineIndex = position.lineNumber - this._startLineNumber;\n\n\t\tif (lineIndex < 0) {\n\t\t\t// this insertion occurs before this block, so we only need to adjust line numbers\n\t\t\tthis._startLineNumber += eolCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (lineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this insertion occurs after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tokens.acceptInsertText(lineIndex, position.column - 1, eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t}\n\n\tpublic reportIfInvalid(model: ITextModel): void {\n\t\tthis._tokens.reportIfInvalid(model, this._startLineNumber);\n\t}\n}\n\nclass SparseMultilineTokensStorage {\n\t/**\n\t * The encoding of tokens is:\n\t * 4*i deltaLine (from `startLineNumber`)\n\t * 4*i+1 startCharacter (from the line start)\n\t * 4*i+2 endCharacter (from the line start)\n\t * 4*i+3 metadata\n\t */\n\tprivate readonly _tokens: Uint32Array;\n\tprivate _tokenCount: number;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t\tthis._tokenCount = tokens.length / 4;\n\t}\n\n\tpublic toString(startLineNumber: number): string {\n\t\tconst pieces: string[] = [];\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tpieces.push(`(${this._getDeltaLine(i) + startLineNumber},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);\n\t\t}\n\t\treturn `[${pieces.join(',')}]`;\n\t}\n\n\tpublic getMaxDeltaLine(): number {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._getDeltaLine(tokenCount - 1);\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst startChar = this._getStartCharacter(0);\n\t\tconst maxDeltaLine = this._getDeltaLine(tokenCount - 1);\n\t\tconst endChar = this._getEndCharacter(tokenCount - 1);\n\t\treturn new Range(0, startChar + 1, maxDeltaLine, endChar + 1);\n\t}\n\n\tprivate _getTokenCount(): number {\n\t\treturn this._tokenCount;\n\t}\n\n\tprivate _getDeltaLine(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex];\n\t}\n\n\tprivate _getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tprivate _getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn (this._getTokenCount() === 0);\n\t}\n\n\tpublic getLineTokens(deltaLine: number): SparseLineTokens | null {\n\t\tlet low = 0;\n\t\tlet high = this._getTokenCount() - 1;\n\n\t\twhile (low < high) {\n\t\t\tconst mid = low + Math.floor((high - low) / 2);\n\t\t\tconst midDeltaLine = this._getDeltaLine(mid);\n\n\t\t\tif (midDeltaLine < deltaLine) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else if (midDeltaLine > deltaLine) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else {\n\t\t\t\tlet min = mid;\n\t\t\t\twhile (min > low && this._getDeltaLine(min - 1) === deltaLine) {\n\t\t\t\t\tmin--;\n\t\t\t\t}\n\t\t\t\tlet max = mid;\n\t\t\t\twhile (max < high && this._getDeltaLine(max + 1) === deltaLine) {\n\t\t\t\t\tmax++;\n\t\t\t\t}\n\t\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * min, 4 * max + 4));\n\t\t\t}\n\t\t}\n\n\t\tif (this._getDeltaLine(low) === deltaLine) {\n\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * low, 4 * low + 4));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic clear(): void {\n\t\tthis._tokenCount = 0;\n\t}\n\n\tpublic removeTokens(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): number {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tlet firstDeltaLine = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (\n\t\t\t\t(tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))\n\t\t\t\t&& (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))\n\t\t\t) {\n\t\t\t\thasDeletedTokens = true;\n\t\t\t} else {\n\t\t\t\tif (newTokenCount === 0) {\n\t\t\t\t\tfirstDeltaLine = tokenDeltaLine;\n\t\t\t\t}\n\t\t\t\tif (hasDeletedTokens) {\n\t\t\t\t\t// must move the token to the left\n\t\t\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\t\t\ttokens[destOffset] = tokenDeltaLine - firstDeltaLine;\n\t\t\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\t\t} else if (firstDeltaLine !== 0) {\n\t\t\t\t\t// must adjust the delta line in place\n\t\t\t\t\ttokens[srcOffset] = tokenDeltaLine - firstDeltaLine;\n\t\t\t\t}\n\t\t\t\tnewTokenCount++;\n\t\t\t}\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\n\t\treturn firstDeltaLine;\n\t}\n\n\tpublic split(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): [SparseMultilineTokensStorage, SparseMultilineTokensStorage, number] {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst aTokens: number[] = [];\n\t\tconst bTokens: number[] = [];\n\t\tlet destTokens: number[] = aTokens;\n\t\tlet destOffset = 0;\n\t\tlet destFirstDeltaLine: number = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif ((tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))) {\n\t\t\t\tif ((tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))) {\n\t\t\t\t\t// this token is touching the range\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t// this token is after the range\n\t\t\t\t\tif (destTokens !== bTokens) {\n\t\t\t\t\t\t// this token is the first token after the range\n\t\t\t\t\t\tdestTokens = bTokens;\n\t\t\t\t\t\tdestOffset = 0;\n\t\t\t\t\t\tdestFirstDeltaLine = tokenDeltaLine;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdestTokens[destOffset++] = tokenDeltaLine - destFirstDeltaLine;\n\t\t\tdestTokens[destOffset++] = tokenStartCharacter;\n\t\t\tdestTokens[destOffset++] = tokenEndCharacter;\n\t\t\tdestTokens[destOffset++] = tokenMetadata;\n\t\t}\n\n\t\treturn [new SparseMultilineTokensStorage(new Uint32Array(aTokens)), new SparseMultilineTokensStorage(new Uint32Array(bTokens)), destFirstDeltaLine];\n\t}\n\n\tpublic acceptDeleteRange(horizontalShiftForFirstLineTokens: number, startDeltaLine: number, startCharacter: number, endDeltaLine: number, endCharacter: number): void {\n\t\t// This is a bit complex, here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token starts before the deletion range\n\t\t// 1a. The token is completely before the deletion range\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t// ---------------\n\t\t// xxxxxxxx\n\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t// ---------------\n\t\t// xxxxx\n\t\t//\n\t\t// 2. The token starts at the same position with the deletion range\n\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxx\n\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxx\n\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t// -------------\n\t\t// xxxxxxx\n\t\t//\n\t\t// 3. The token starts inside the deletion range\n\t\t// 3a. The token is inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t// ------------\n\t\t// xxxxxxxxxxx\n\t\t//\n\t\t// 4. The token starts after the deletion range\n\t\t// -----------\n\t\t// xxxxxxxx\n\t\t//\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst deletedLineCount = (endDeltaLine - startDeltaLine);\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[srcOffset];\n\t\t\tlet tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tlet tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (tokenDeltaLine < startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter <= startCharacter)) {\n\t\t\t\t// 1a. The token is completely before the deletion range\n\t\t\t\t// => nothing to do\n\t\t\t\tnewTokenCount++;\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter < startCharacter) {\n\t\t\t\t// 1b, 1c, 1d\n\t\t\t\t// => the token survives, but it needs to shrink\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t\t\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t\t\t\t// => the token shrinks its ending to the deletion start\n\t\t\t\t\ttokenEndCharacter = startCharacter;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter === startCharacter) {\n\t\t\t\t// 2a, 2b, 2c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t\t\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter < endCharacter)) {\n\t\t\t\t// 3a, 3b, 3c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t\t\t\t// => the token moves to continue right after the deletion\n\t\t\t\t\ttokenDeltaLine = startDeltaLine;\n\t\t\t\t\ttokenStartCharacter = startCharacter;\n\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 3a. The token is inside the deletion range\n\t\t\t\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine > endDeltaLine) {\n\t\t\t\t// 4. (partial) The token starts after the deletion range, on a line below...\n\t\t\t\tif (deletedLineCount === 0 && !hasDeletedTokens) {\n\t\t\t\t\t// early stop, there is no need to walk all the tokens and do nothing...\n\t\t\t\t\tnewTokenCount = tokenCount;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t} else if (tokenDeltaLine === endDeltaLine && tokenStartCharacter >= endCharacter) {\n\t\t\t\t// 4. (continued) The token starts after the deletion range, on the last line where a deletion occurs\n\t\t\t\tif (horizontalShiftForFirstLineTokens && tokenDeltaLine === 0) {\n\t\t\t\t\ttokenStartCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t\ttokenEndCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t\ttokenStartCharacter -= (endCharacter - startCharacter);\n\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Not possible!`);\n\t\t\t}\n\n\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\ttokens[destOffset] = tokenDeltaLine;\n\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\tnewTokenCount++;\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\t}\n\n\tpublic acceptInsertText(deltaLine: number, character: number, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\t// Here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token is completely before the insertion point\n\t\t// ----------- |\n\t\t// 2. The token ends precisely at the insertion point\n\t\t// -----------|\n\t\t// 3. The token contains the insertion point\n\t\t// -----|------\n\t\t// 4. The token starts precisely at the insertion point\n\t\t// |-----------\n\t\t// 5. The token is completely after the insertion point\n\t\t// | -----------\n\t\t//\n\t\tconst isInsertingPreciselyOneWordCharacter = (\n\t\t\teolCount === 0\n\t\t\t&& firstLineLength === 1\n\t\t\t&& (\n\t\t\t\t(firstCharCode >= CharCode.Digit0 && firstCharCode <= CharCode.Digit9)\n\t\t\t\t|| (firstCharCode >= CharCode.A && firstCharCode <= CharCode.Z)\n\t\t\t\t|| (firstCharCode >= CharCode.a && firstCharCode <= CharCode.z)\n\t\t\t)\n\t\t);\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst offset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[offset];\n\t\t\tlet tokenStartCharacter = tokens[offset + 1];\n\t\t\tlet tokenEndCharacter = tokens[offset + 2];\n\n\t\t\tif (tokenDeltaLine < deltaLine || (tokenDeltaLine === deltaLine && tokenEndCharacter < character)) {\n\t\t\t\t// 1. The token is completely before the insertion point\n\t\t\t\t// => nothing to do\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenEndCharacter === character) {\n\t\t\t\t// 2. The token ends precisely at the insertion point\n\t\t\t\t// => expand the end character only if inserting precisely one character that is a word character\n\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\ttokenEndCharacter += 1;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenStartCharacter < character && character < tokenEndCharacter) {\n\t\t\t\t// 3. The token contains the insertion point\n\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t// => just expand the end character\n\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t} else {\n\t\t\t\t\t// => cut off the token\n\t\t\t\t\ttokenEndCharacter = character;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// 4. or 5.\n\t\t\t\tif (tokenDeltaLine === deltaLine && tokenStartCharacter === character) {\n\t\t\t\t\t// 4. The token starts precisely at the insertion point\n\t\t\t\t\t// => grow the token (by keeping its start constant) only if inserting precisely one character that is a word character\n\t\t\t\t\t// => otherwise behave as in case 5.\n\t\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// => the token must move and keep its size constant\n\t\t\t\tif (tokenDeltaLine === deltaLine) {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t\t// this token is on the line where the insertion is taking place\n\t\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t\ttokenStartCharacter += firstLineLength;\n\t\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst tokenLength = tokenEndCharacter - tokenStartCharacter;\n\t\t\t\t\t\ttokenStartCharacter = lastLineLength + (tokenStartCharacter - character);\n\t\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + tokenLength;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttokens[offset] = tokenDeltaLine;\n\t\t\ttokens[offset + 1] = tokenStartCharacter;\n\t\t\ttokens[offset + 2] = tokenEndCharacter;\n\t\t}\n\t}\n\n\tprivate static _rateLimiter = new RateLimiter(10 / 60); // limit to 10 times per minute\n\n\tpublic reportIfInvalid(model: ITextModel, startLineNumber: number): void {\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tconst lineNumber = this._getDeltaLine(i) + startLineNumber;\n\n\t\t\tif (lineNumber < 1) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: lineNumber < 1');\n\t\t\t\t});\n\t\t\t} else if (lineNumber > model.getLineCount()) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()');\n\t\t\t\t});\n\t\t\t} else if (this._getEndCharacter(i) > model.getLineLength(lineNumber)) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class SparseLineTokens {\n\n\tprivate readonly _tokens: Uint32Array;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._tokens.length / 4;\n\t}\n\n\tpublic getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tpublic getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic getMetadata(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 3];\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 { CharCode } from '../../../base/common/charCode.js';\nimport { Position } from '../core/position.js';\nimport { IRange, Range } from '../core/range.js';\nimport { countEOL } from '../core/misc/eolCounter.js';\nimport { ITextModel } from '../model.js';\nimport { RateLimiter } from './common.js';\n\n/**\n * Represents sparse tokens over a contiguous range of lines.\n */\nexport class SparseMultilineTokens {\n\n\tpublic static create(startLineNumber: number, tokens: Uint32Array): SparseMultilineTokens {\n\t\treturn new SparseMultilineTokens(startLineNumber, new SparseMultilineTokensStorage(tokens));\n\t}\n\n\tprivate _startLineNumber: number;\n\tprivate _endLineNumber: number;\n\tprivate readonly _tokens: SparseMultilineTokensStorage;\n\n\t/**\n\t * (Inclusive) start line number for these tokens.\n\t */\n\tpublic get startLineNumber(): number {\n\t\treturn this._startLineNumber;\n\t}\n\n\t/**\n\t * (Inclusive) end line number for these tokens.\n\t */\n\tpublic get endLineNumber(): number {\n\t\treturn this._endLineNumber;\n\t}\n\n\tprivate constructor(startLineNumber: number, tokens: SparseMultilineTokensStorage) {\n\t\tthis._startLineNumber = startLineNumber;\n\t\tthis._tokens = tokens;\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic toString(): string {\n\t\treturn this._tokens.toString(this._startLineNumber);\n\t}\n\n\tprivate _updateEndLineNumber(): void {\n\t\tthis._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this._tokens.isEmpty();\n\t}\n\n\tpublic getLineTokens(lineNumber: number): SparseLineTokens | null {\n\t\tif (this._startLineNumber <= lineNumber && lineNumber <= this._endLineNumber) {\n\t\t\treturn this._tokens.getLineTokens(lineNumber - this._startLineNumber);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst deltaRange = this._tokens.getRange();\n\t\tif (!deltaRange) {\n\t\t\treturn deltaRange;\n\t\t}\n\t\treturn new Range(this._startLineNumber + deltaRange.startLineNumber, deltaRange.startColumn, this._startLineNumber + deltaRange.endLineNumber, deltaRange.endColumn);\n\t}\n\n\tpublic removeTokens(range: Range): void {\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tthis._startLineNumber += this._tokens.removeTokens(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tpublic split(range: Range): [SparseMultilineTokens, SparseMultilineTokens] {\n\t\t// split tokens to two:\n\t\t// a) all the tokens before `range`\n\t\t// b) all the tokens after `range`\n\t\tconst startLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst endLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tconst [a, b, bDeltaLine] = this._tokens.split(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1);\n\t\treturn [new SparseMultilineTokens(this._startLineNumber, a), new SparseMultilineTokens(this._startLineNumber + bDeltaLine, b)];\n\t}\n\n\tpublic applyEdit(range: IRange, text: string): void {\n\t\tconst [eolCount, firstLineLength, lastLineLength] = countEOL(text);\n\t\tthis.acceptEdit(range, eolCount, firstLineLength, lastLineLength, text.length > 0 ? text.charCodeAt(0) : CharCode.Null);\n\t}\n\n\tpublic acceptEdit(range: IRange, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\tthis._acceptDeleteRange(range);\n\t\tthis._acceptInsertText(new Position(range.startLineNumber, range.startColumn), eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t\tthis._updateEndLineNumber();\n\t}\n\n\tprivate _acceptDeleteRange(range: IRange): void {\n\t\tif (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) {\n\t\t\t// Nothing to delete\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstLineIndex = range.startLineNumber - this._startLineNumber;\n\t\tconst lastLineIndex = range.endLineNumber - this._startLineNumber;\n\n\t\tif (lastLineIndex < 0) {\n\t\t\t// this deletion occurs entirely before this block, so we only need to adjust line numbers\n\t\t\tconst deletedLinesCount = lastLineIndex - firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedLinesCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (firstLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion occurs entirely after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0 && lastLineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this deletion completely encompasses this block\n\t\t\tthis._startLineNumber = 0;\n\t\t\tthis._tokens.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tif (firstLineIndex < 0) {\n\t\t\tconst deletedBefore = -firstLineIndex;\n\t\t\tthis._startLineNumber -= deletedBefore;\n\n\t\t\tthis._tokens.acceptDeleteRange(range.startColumn - 1, 0, 0, lastLineIndex, range.endColumn - 1);\n\t\t} else {\n\t\t\tthis._tokens.acceptDeleteRange(0, firstLineIndex, range.startColumn - 1, lastLineIndex, range.endColumn - 1);\n\t\t}\n\t}\n\n\tprivate _acceptInsertText(position: Position, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\n\t\tif (eolCount === 0 && firstLineLength === 0) {\n\t\t\t// Nothing to insert\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineIndex = position.lineNumber - this._startLineNumber;\n\n\t\tif (lineIndex < 0) {\n\t\t\t// this insertion occurs before this block, so we only need to adjust line numbers\n\t\t\tthis._startLineNumber += eolCount;\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokenMaxDeltaLine = this._tokens.getMaxDeltaLine();\n\n\t\tif (lineIndex >= tokenMaxDeltaLine + 1) {\n\t\t\t// this insertion occurs after this block, so there is nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tokens.acceptInsertText(lineIndex, position.column - 1, eolCount, firstLineLength, lastLineLength, firstCharCode);\n\t}\n\n\tpublic reportIfInvalid(model: ITextModel): void {\n\t\tthis._tokens.reportIfInvalid(model, this._startLineNumber);\n\t}\n}\n\nclass SparseMultilineTokensStorage {\n\t/**\n\t * The encoding of tokens is:\n\t * 4*i deltaLine (from `startLineNumber`)\n\t * 4*i+1 startCharacter (from the line start)\n\t * 4*i+2 endCharacter (from the line start)\n\t * 4*i+3 metadata\n\t */\n\tprivate readonly _tokens: Uint32Array;\n\tprivate _tokenCount: number;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t\tthis._tokenCount = tokens.length / 4;\n\t}\n\n\tpublic toString(startLineNumber: number): string {\n\t\tconst pieces: string[] = [];\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tpieces.push(`(${this._getDeltaLine(i) + startLineNumber},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);\n\t\t}\n\t\treturn `[${pieces.join(',')}]`;\n\t}\n\n\tpublic getMaxDeltaLine(): number {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._getDeltaLine(tokenCount - 1);\n\t}\n\n\tpublic getRange(): Range | null {\n\t\tconst tokenCount = this._getTokenCount();\n\t\tif (tokenCount === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst startChar = this._getStartCharacter(0);\n\t\tconst maxDeltaLine = this._getDeltaLine(tokenCount - 1);\n\t\tconst endChar = this._getEndCharacter(tokenCount - 1);\n\t\treturn new Range(0, startChar + 1, maxDeltaLine, endChar + 1);\n\t}\n\n\tprivate _getTokenCount(): number {\n\t\treturn this._tokenCount;\n\t}\n\n\tprivate _getDeltaLine(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex];\n\t}\n\n\tprivate _getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tprivate _getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn (this._getTokenCount() === 0);\n\t}\n\n\tpublic getLineTokens(deltaLine: number): SparseLineTokens | null {\n\t\tlet low = 0;\n\t\tlet high = this._getTokenCount() - 1;\n\n\t\twhile (low < high) {\n\t\t\tconst mid = low + Math.floor((high - low) / 2);\n\t\t\tconst midDeltaLine = this._getDeltaLine(mid);\n\n\t\t\tif (midDeltaLine < deltaLine) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else if (midDeltaLine > deltaLine) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else {\n\t\t\t\tlet min = mid;\n\t\t\t\twhile (min > low && this._getDeltaLine(min - 1) === deltaLine) {\n\t\t\t\t\tmin--;\n\t\t\t\t}\n\t\t\t\tlet max = mid;\n\t\t\t\twhile (max < high && this._getDeltaLine(max + 1) === deltaLine) {\n\t\t\t\t\tmax++;\n\t\t\t\t}\n\t\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * min, 4 * max + 4));\n\t\t\t}\n\t\t}\n\n\t\tif (this._getDeltaLine(low) === deltaLine) {\n\t\t\treturn new SparseLineTokens(this._tokens.subarray(4 * low, 4 * low + 4));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic clear(): void {\n\t\tthis._tokenCount = 0;\n\t}\n\n\tpublic removeTokens(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): number {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tlet firstDeltaLine = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (\n\t\t\t\t(tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))\n\t\t\t\t&& (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))\n\t\t\t) {\n\t\t\t\thasDeletedTokens = true;\n\t\t\t} else {\n\t\t\t\tif (newTokenCount === 0) {\n\t\t\t\t\tfirstDeltaLine = tokenDeltaLine;\n\t\t\t\t}\n\t\t\t\tif (hasDeletedTokens) {\n\t\t\t\t\t// must move the token to the left\n\t\t\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\t\t\ttokens[destOffset] = tokenDeltaLine - firstDeltaLine;\n\t\t\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\t\t} else if (firstDeltaLine !== 0) {\n\t\t\t\t\t// must adjust the delta line in place\n\t\t\t\t\ttokens[srcOffset] = tokenDeltaLine - firstDeltaLine;\n\t\t\t\t}\n\t\t\t\tnewTokenCount++;\n\t\t\t}\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\n\t\treturn firstDeltaLine;\n\t}\n\n\tpublic split(startDeltaLine: number, startChar: number, endDeltaLine: number, endChar: number): [SparseMultilineTokensStorage, SparseMultilineTokensStorage, number] {\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst aTokens: number[] = [];\n\t\tconst bTokens: number[] = [];\n\t\tlet destTokens: number[] = aTokens;\n\t\tlet destOffset = 0;\n\t\tlet destFirstDeltaLine: number = 0;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tconst tokenDeltaLine = tokens[srcOffset];\n\t\t\tconst tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tconst tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif ((tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))) {\n\t\t\t\tif ((tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))) {\n\t\t\t\t\t// this token is touching the range\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t// this token is after the range\n\t\t\t\t\tif (destTokens !== bTokens) {\n\t\t\t\t\t\t// this token is the first token after the range\n\t\t\t\t\t\tdestTokens = bTokens;\n\t\t\t\t\t\tdestOffset = 0;\n\t\t\t\t\t\tdestFirstDeltaLine = tokenDeltaLine;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdestTokens[destOffset++] = tokenDeltaLine - destFirstDeltaLine;\n\t\t\tdestTokens[destOffset++] = tokenStartCharacter;\n\t\t\tdestTokens[destOffset++] = tokenEndCharacter;\n\t\t\tdestTokens[destOffset++] = tokenMetadata;\n\t\t}\n\n\t\treturn [new SparseMultilineTokensStorage(new Uint32Array(aTokens)), new SparseMultilineTokensStorage(new Uint32Array(bTokens)), destFirstDeltaLine];\n\t}\n\n\tpublic acceptDeleteRange(horizontalShiftForFirstLineTokens: number, startDeltaLine: number, startCharacter: number, endDeltaLine: number, endCharacter: number): void {\n\t\t// This is a bit complex, here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token starts before the deletion range\n\t\t// 1a. The token is completely before the deletion range\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t// -----------\n\t\t// xxxxxxxxxxx\n\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t// ---------------\n\t\t// xxxxxxxx\n\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t// ---------------\n\t\t// xxxxx\n\t\t//\n\t\t// 2. The token starts at the same position with the deletion range\n\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxx\n\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxx\n\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t// -------------\n\t\t// xxxxxxx\n\t\t//\n\t\t// 3. The token starts inside the deletion range\n\t\t// 3a. The token is inside the deletion range\n\t\t// -------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t// ----------\n\t\t// xxxxxxxxxxxxx\n\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t// ------------\n\t\t// xxxxxxxxxxx\n\t\t//\n\t\t// 4. The token starts after the deletion range\n\t\t// -----------\n\t\t// xxxxxxxx\n\t\t//\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tconst deletedLineCount = (endDeltaLine - startDeltaLine);\n\t\tlet newTokenCount = 0;\n\t\tlet hasDeletedTokens = false;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst srcOffset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[srcOffset];\n\t\t\tlet tokenStartCharacter = tokens[srcOffset + 1];\n\t\t\tlet tokenEndCharacter = tokens[srcOffset + 2];\n\t\t\tconst tokenMetadata = tokens[srcOffset + 3];\n\n\t\t\tif (tokenDeltaLine < startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter <= startCharacter)) {\n\t\t\t\t// 1a. The token is completely before the deletion range\n\t\t\t\t// => nothing to do\n\t\t\t\tnewTokenCount++;\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter < startCharacter) {\n\t\t\t\t// 1b, 1c, 1d\n\t\t\t\t// => the token survives, but it needs to shrink\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 1d. The token starts before, the deletion range is inside the token\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 1b. The token starts before, the deletion range ends after the token\n\t\t\t\t\t// 1c. The token starts before, the deletion range ends precisely with the token\n\t\t\t\t\t// => the token shrinks its ending to the deletion start\n\t\t\t\t\ttokenEndCharacter = startCharacter;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter === startCharacter) {\n\t\t\t\t// 2a, 2b, 2c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 2c. The token starts at the same position, and ends after the deletion range\n\t\t\t\t\t// => the token shrinks by the deletion character count\n\t\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 2a. The token starts at the same position, and ends inside the deletion range\n\t\t\t\t\t// 2b. The token starts at the same position, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter < endCharacter)) {\n\t\t\t\t// 3a, 3b, 3c\n\t\t\t\tif (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {\n\t\t\t\t\t// 3c. The token starts inside the deletion range, and ends after the deletion range\n\t\t\t\t\t// => the token moves to continue right after the deletion\n\t\t\t\t\ttokenDeltaLine = startDeltaLine;\n\t\t\t\t\ttokenStartCharacter = startCharacter;\n\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter);\n\t\t\t\t} else {\n\t\t\t\t\t// 3a. The token is inside the deletion range\n\t\t\t\t\t// 3b. The token starts inside the deletion range, and ends at the same position as the deletion range\n\t\t\t\t\t// => the token is deleted\n\t\t\t\t\thasDeletedTokens = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine > endDeltaLine) {\n\t\t\t\t// 4. (partial) The token starts after the deletion range, on a line below...\n\t\t\t\tif (deletedLineCount === 0 && !hasDeletedTokens) {\n\t\t\t\t\t// early stop, there is no need to walk all the tokens and do nothing...\n\t\t\t\t\tnewTokenCount = tokenCount;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t} else if (tokenDeltaLine === endDeltaLine && tokenStartCharacter >= endCharacter) {\n\t\t\t\t// 4. (continued) The token starts after the deletion range, on the last line where a deletion occurs\n\t\t\t\tif (horizontalShiftForFirstLineTokens && tokenDeltaLine === 0) {\n\t\t\t\t\ttokenStartCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t\ttokenEndCharacter += horizontalShiftForFirstLineTokens;\n\t\t\t\t}\n\t\t\t\ttokenDeltaLine -= deletedLineCount;\n\t\t\t\ttokenStartCharacter -= (endCharacter - startCharacter);\n\t\t\t\ttokenEndCharacter -= (endCharacter - startCharacter);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Not possible!`);\n\t\t\t}\n\n\t\t\tconst destOffset = 4 * newTokenCount;\n\t\t\ttokens[destOffset] = tokenDeltaLine;\n\t\t\ttokens[destOffset + 1] = tokenStartCharacter;\n\t\t\ttokens[destOffset + 2] = tokenEndCharacter;\n\t\t\ttokens[destOffset + 3] = tokenMetadata;\n\t\t\tnewTokenCount++;\n\t\t}\n\n\t\tthis._tokenCount = newTokenCount;\n\t}\n\n\tpublic acceptInsertText(deltaLine: number, character: number, eolCount: number, firstLineLength: number, lastLineLength: number, firstCharCode: number): void {\n\t\t// Here are the cases I used to think about this:\n\t\t//\n\t\t// 1. The token is completely before the insertion point\n\t\t// ----------- |\n\t\t// 2. The token ends precisely at the insertion point\n\t\t// -----------|\n\t\t// 3. The token contains the insertion point\n\t\t// -----|------\n\t\t// 4. The token starts precisely at the insertion point\n\t\t// |-----------\n\t\t// 5. The token is completely after the insertion point\n\t\t// | -----------\n\t\t//\n\t\tconst isInsertingPreciselyOneWordCharacter = (\n\t\t\teolCount === 0\n\t\t\t&& firstLineLength === 1\n\t\t\t&& (\n\t\t\t\t(firstCharCode >= CharCode.Digit0 && firstCharCode <= CharCode.Digit9)\n\t\t\t\t|| (firstCharCode >= CharCode.A && firstCharCode <= CharCode.Z)\n\t\t\t\t|| (firstCharCode >= CharCode.a && firstCharCode <= CharCode.z)\n\t\t\t)\n\t\t);\n\t\tconst tokens = this._tokens;\n\t\tconst tokenCount = this._tokenCount;\n\t\tfor (let i = 0; i < tokenCount; i++) {\n\t\t\tconst offset = 4 * i;\n\t\t\tlet tokenDeltaLine = tokens[offset];\n\t\t\tlet tokenStartCharacter = tokens[offset + 1];\n\t\t\tlet tokenEndCharacter = tokens[offset + 2];\n\n\t\t\tif (tokenDeltaLine < deltaLine || (tokenDeltaLine === deltaLine && tokenEndCharacter < character)) {\n\t\t\t\t// 1. The token is completely before the insertion point\n\t\t\t\t// => nothing to do\n\t\t\t\tcontinue;\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenEndCharacter === character) {\n\t\t\t\t// 2. The token ends precisely at the insertion point\n\t\t\t\t// => expand the end character only if inserting precisely one character that is a word character\n\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\ttokenEndCharacter += 1;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (tokenDeltaLine === deltaLine && tokenStartCharacter < character && character < tokenEndCharacter) {\n\t\t\t\t// 3. The token contains the insertion point\n\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t// => just expand the end character\n\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t} else {\n\t\t\t\t\t// => cut off the token\n\t\t\t\t\ttokenEndCharacter = character;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// 4. or 5.\n\t\t\t\tif (tokenDeltaLine === deltaLine && tokenStartCharacter === character) {\n\t\t\t\t\t// 4. The token starts precisely at the insertion point\n\t\t\t\t\t// => grow the token (by keeping its start constant) only if inserting precisely one character that is a word character\n\t\t\t\t\t// => otherwise behave as in case 5.\n\t\t\t\t\tif (isInsertingPreciselyOneWordCharacter) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// => the token must move and keep its size constant\n\t\t\t\tif (tokenDeltaLine === deltaLine) {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t\t// this token is on the line where the insertion is taking place\n\t\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\t\ttokenStartCharacter += firstLineLength;\n\t\t\t\t\t\ttokenEndCharacter += firstLineLength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst tokenLength = tokenEndCharacter - tokenStartCharacter;\n\t\t\t\t\t\ttokenStartCharacter = lastLineLength + (tokenStartCharacter - character);\n\t\t\t\t\t\ttokenEndCharacter = tokenStartCharacter + tokenLength;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttokenDeltaLine += eolCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttokens[offset] = tokenDeltaLine;\n\t\t\ttokens[offset + 1] = tokenStartCharacter;\n\t\t\ttokens[offset + 2] = tokenEndCharacter;\n\t\t}\n\t}\n\n\tprivate static _rateLimiter = new RateLimiter(10 / 60); // limit to 10 times per minute\n\n\tpublic reportIfInvalid(model: ITextModel, startLineNumber: number): void {\n\t\tfor (let i = 0; i < this._tokenCount; i++) {\n\t\t\tconst lineNumber = this._getDeltaLine(i) + startLineNumber;\n\n\t\t\tif (lineNumber < 1) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: lineNumber < 1');\n\t\t\t\t});\n\t\t\t} else if (lineNumber > model.getLineCount()) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()');\n\t\t\t\t});\n\t\t\t} else if (this._getEndCharacter(i) > model.getLineLength(lineNumber)) {\n\t\t\t\tSparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => {\n\t\t\t\t\tconsole.error('Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class SparseLineTokens {\n\n\tprivate readonly _tokens: Uint32Array;\n\n\tconstructor(tokens: Uint32Array) {\n\t\tthis._tokens = tokens;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this._tokens.length / 4;\n\t}\n\n\tpublic getStartCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 1];\n\t}\n\n\tpublic getEndCharacter(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 2];\n\t}\n\n\tpublic getMetadata(tokenIndex: number): number {\n\t\treturn this._tokens[4 * tokenIndex + 3];\n\t}\n}\n"]}
|
|
@@ -366,22 +366,25 @@ let HoverService = class HoverService extends Disposable {
|
|
|
366
366
|
// track the mouse position
|
|
367
367
|
const onMouseMove = (e) => {
|
|
368
368
|
target.x = e.x + 10;
|
|
369
|
-
if ((
|
|
369
|
+
if (!eventIsRelatedToTarget(e, targetElement)) {
|
|
370
370
|
hideHover(true, true);
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
373
|
mouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));
|
|
374
374
|
}
|
|
375
375
|
hoverPreparation = mouseOverStore;
|
|
376
|
-
if ((
|
|
376
|
+
if (!eventIsRelatedToTarget(e, targetElement)) {
|
|
377
377
|
return; // Do not show hover when the mouse is over another hover target
|
|
378
378
|
}
|
|
379
379
|
mouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));
|
|
380
380
|
}, true));
|
|
381
|
-
const onFocus = () => {
|
|
381
|
+
const onFocus = (e) => {
|
|
382
382
|
if (isMouseDown || hoverPreparation) {
|
|
383
383
|
return;
|
|
384
384
|
}
|
|
385
|
+
if (!eventIsRelatedToTarget(e, targetElement)) {
|
|
386
|
+
return; // Do not show hover when the focus is on another hover target
|
|
387
|
+
}
|
|
385
388
|
const target = {
|
|
386
389
|
targetElements: [targetElement],
|
|
387
390
|
dispose: () => { }
|
|
@@ -507,6 +510,9 @@ class HoverContextViewDelegate {
|
|
|
507
510
|
this._hover.layout();
|
|
508
511
|
}
|
|
509
512
|
}
|
|
513
|
+
function eventIsRelatedToTarget(event, target) {
|
|
514
|
+
return isHTMLElement(event.target) && getHoverTargetElement(event.target, target) === target;
|
|
515
|
+
}
|
|
510
516
|
function getHoverTargetElement(element, stopElement) {
|
|
511
517
|
stopElement = stopElement ?? getWindow(element).document.body;
|
|
512
518
|
while (!element.hasAttribute('custom-hover') && element !== stopElement) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/hover/browser/hoverService.ts","vs/platform/hover/browser/hoverService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtL,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,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,SAAS,EAAE,EAAE;IAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACtD,IAAI,WAAW,EAAE,CAAC;QACjB,SAAS,CAAC,OAAO,CAAC,kGAAkG,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvJ,SAAS,CAAC,OAAO,CAAC,4DAA4D,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClH,CAAC;AACF,CAAC,CAAC,CAAC","file":"hoverService.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 { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif ((isHTMLElement(e.target)) && getHoverTargetElement(e.target, targetElement) !== targetElement) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif ((isHTMLElement(e.target)) && getHoverTargetElement(e.target as HTMLElement, targetElement) !== targetElement) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = () => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\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 { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif ((isHTMLElement(e.target)) && getHoverTargetElement(e.target, targetElement) !== targetElement) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif ((isHTMLElement(e.target)) && getHoverTargetElement(e.target as HTMLElement, targetElement) !== targetElement) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = () => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/hover/browser/hoverService.ts","vs/platform/hover/browser/hoverService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AACh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,MAAM,CAAC,CAAC;YAChB,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SAChB,CAAC;IACH,CAAC;IAED,MAAM;QACL,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC;CACD;AAED,SAAS,sBAAsB,CAAC,KAAc,EAAE,MAAmB;IAClE,OAAO,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,qBAAqB,CAAC,KAAK,CAAC,MAAqB,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;AAC7G,CAAC;AAED,SAAS,qBAAqB,CAAC,OAAoB,EAAE,WAAyB;IAC7E,WAAW,GAAG,WAAW,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9D,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QACzE,OAAO,GAAG,OAAO,CAAC,aAAc,CAAC;IAClC,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,iBAAiB,CAAC,aAAa,EAAE,YAAY,oCAA4B,CAAC;AAE1E,0BAA0B,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;IAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACtD,IAAI,WAAW,EAAE,CAAC;QACjB,SAAS,CAAC,OAAO,CAAC,kGAAkG,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvJ,SAAS,CAAC,OAAO,CAAC,4DAA4D,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClH,CAAC;AACF,CAAC,CAAC,CAAC","file":"hoverService.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 { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target as HTMLElement, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\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 { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target as HTMLElement, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n"]}
|
|
@@ -144,7 +144,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
144
144
|
when: ContextKeyExpr.and(
|
|
145
145
|
// All other kinds of Quick things handle Accept, except Widget. In other words, Accepting is a detail on the things
|
|
146
146
|
// that extend IQuickInput
|
|
147
|
-
ContextKeyExpr.notEquals(quickInputTypeContextKeyValue, "quickWidget" /* QuickInputType.QuickWidget */), inQuickInputContext),
|
|
147
|
+
ContextKeyExpr.notEquals(quickInputTypeContextKeyValue, "quickWidget" /* QuickInputType.QuickWidget */), inQuickInputContext, ContextKeyExpr.not('isComposing')),
|
|
148
148
|
metadata: { description: localize(1760, "Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.") },
|
|
149
149
|
handler: (accessor) => {
|
|
150
150
|
const currentQuickPick = accessor.get(IQuickInputService).currentQuickInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/platform/quickinput/browser/quickInputActions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAA+C,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAClI,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAa,kBAAkB,EAA0C,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEhI,SAAS,0CAA0C,CAAC,IAAgE,EAAE,UAAiF,EAAE;IACxM,mBAAmB,CAAC,gCAAgC,CAAC;QACpD,MAAM,6CAAmC;QACzC,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,IAAY,EAAE,kMAAkM,CAAC,EAAE;QACrP,GAAG,IAAI;QACP,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,OAAQ,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE,EAAE,OAAO,CAAC;KACrE,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,yCAAyC,CAAC,IAAgE,EAAE,UAAiF,EAAE;IACvM,mBAAmB,CAAC,gCAAgC,CAAC;QACpD,MAAM,6CAAmC;QACzC,IAAI,EAAE,cAAc,CAAC,GAAG,CACvB,cAAc,CAAC,EAAE;QAChB,oCAAoC;QACpC,cAAc,CA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F,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACD,EACD,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CACzD,CAAC;AAEF,YAAY;AAEZ,cAAc;AAEd,0CAA0C,CACzC;IACC,EAAE,EAAE,iBAAiB;IACrB,OAAO,wBAAgB;IACvB,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE;QACrB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,CAAC;QAC5E,gBAAgB,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;CACD,EACD,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CACzD,CAAC;AAEF,YAAY;AAEZ,sBAAsB;AAEtB,yCAAyC,CACxC;IACC,EAAE,EAAE,wBAAwB;IAC5B,OAAO,EAAE,UAAU,yBAAgB;IACnC,OAAO,EAAE,QAAQ,CAAC,EAAE;QACnB,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3D,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;CACD,CACD,CAAC;AAEF,YAAY","file":"quickInputActions.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 { KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { isMacintosh } from '../../../base/common/platform.js';\nimport { PartialExcept } from '../../../base/common/types.js';\nimport { localize } from '../../../nls.js';\nimport { ICommandHandler } from '../../commands/common/commands.js';\nimport { ContextKeyExpr } from '../../contextkey/common/contextkey.js';\nimport { InputFocusedContext } from '../../contextkey/common/contextkeys.js';\nimport { ICommandAndKeybindingRule, KeybindingWeight, KeybindingsRegistry } from '../../keybinding/common/keybindingsRegistry.js';\nimport { endOfQuickInputBoxContext, inQuickInputContext, quickInputTypeContextKeyValue } from './quickInput.js';\nimport { IInputBox, IQuickInputService, IQuickPick, IQuickTree, QuickInputType, QuickPickFocus } from '../common/quickInput.js';\n\nfunction registerQuickInputCommandAndKeybindingRule(rule: PartialExcept<ICommandAndKeybindingRule, 'id' | 'handler'>, options: { withAltMod?: boolean; withCtrlMod?: boolean; withCmdMod?: boolean } = {}) {\n\tKeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\tweight: KeybindingWeight.WorkbenchContrib,\n\t\twhen: inQuickInputContext,\n\t\tmetadata: { description: localize('quickInput', \"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.\") },\n\t\t...rule,\n\t\tsecondary: getSecondary(rule.primary!, rule.secondary ?? [], options)\n\t});\n}\n\nfunction registerQuickPickCommandAndKeybindingRule(rule: PartialExcept<ICommandAndKeybindingRule, 'id' | 'handler'>, options: { withAltMod?: boolean; withCtrlMod?: boolean; withCmdMod?: boolean } = {}) {\n\tKeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\tweight: KeybindingWeight.WorkbenchContrib,\n\t\twhen: ContextKeyExpr.and(\n\t\t\tContextKeyExpr.or(\n\t\t\t\t// Only things that use Tree widgets\n\t\t\t\tContextKeyExpr.equals(quickInputTypeContextKeyValue, QuickInputType.QuickPick),\n\t\t\t\tContextKeyExpr.equals(quickInputTypeContextKeyValue, QuickInputType.QuickTree),\n\t\t\t),\n\t\t\tinQuickInputContext\n\t\t),\n\t\tmetadata: { description: localize('quickPick', \"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.\") },\n\t\t...rule,\n\t\tsecondary: getSecondary(rule.primary!, rule.secondary ?? [], options)\n\t});\n}\n\nconst ctrlKeyMod = isMacintosh ? KeyMod.WinCtrl : KeyMod.CtrlCmd;\n\n// This function will generate all the combinations of keybindings for the given primary keybinding\nfunction getSecondary(primary: number, secondary: number[], options: { withAltMod?: boolean; withCtrlMod?: boolean; withCmdMod?: boolean } = {}): number[] {\n\tif (options.withAltMod) {\n\t\tsecondary.push(KeyMod.Alt + primary);\n\t}\n\tif (options.withCtrlMod) {\n\t\tsecondary.push(ctrlKeyMod + primary);\n\t\tif (options.withAltMod) {\n\t\t\tsecondary.push(KeyMod.Alt + ctrlKeyMod + primary);\n\t\t}\n\t}\n\n\tif (options.withCmdMod && isMacintosh) {\n\t\tsecondary.push(KeyMod.CtrlCmd + primary);\n\t\tif (options.withCtrlMod) {\n\t\t\tsecondary.push(KeyMod.CtrlCmd + KeyMod.WinCtrl + primary);\n\t\t}\n\t\tif (options.withAltMod) {\n\t\t\tsecondary.push(KeyMod.CtrlCmd + KeyMod.Alt + primary);\n\t\t\tif (options.withCtrlMod) {\n\t\t\t\tsecondary.push(KeyMod.CtrlCmd + KeyMod.Alt + KeyMod.WinCtrl + primary);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn secondary;\n}\n\n//#region Navigation\n\nfunction focusHandler(focus: QuickPickFocus, focusOnQuickNatigate?: QuickPickFocus): ICommandHandler {\n\treturn accessor => {\n\t\t// Assuming this is a quick pick due to above when clause\n\t\tconst currentQuickPick = accessor.get(IQuickInputService).currentQuickInput as IQuickPick<any> | IQuickTree<any> | undefined;\n\t\tif (!currentQuickPick) {\n\t\t\treturn;\n\t\t}\n\t\tif (focusOnQuickNatigate && (currentQuickPick as IQuickPick<any>).quickNavigate) {\n\t\t\treturn currentQuickPick.focus(focusOnQuickNatigate);\n\t\t}\n\t\treturn currentQuickPick.focus(focus);\n\t};\n}\n\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.pageNext', primary: KeyCode.PageDown, handler: focusHandler(QuickPickFocus.NextPage) },\n\t{ withAltMod: true, withCtrlMod: true, withCmdMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.pagePrevious', primary: KeyCode.PageUp, handler: focusHandler(QuickPickFocus.PreviousPage) },\n\t{ withAltMod: true, withCtrlMod: true, withCmdMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.first', primary: ctrlKeyMod + KeyCode.Home, handler: focusHandler(QuickPickFocus.First) },\n\t{ withAltMod: true, withCmdMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.last', primary: ctrlKeyMod + KeyCode.End, handler: focusHandler(QuickPickFocus.Last) },\n\t{ withAltMod: true, withCmdMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.next', primary: KeyCode.DownArrow, handler: focusHandler(QuickPickFocus.Next) },\n\t{ withCtrlMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.previous', primary: KeyCode.UpArrow, handler: focusHandler(QuickPickFocus.Previous) },\n\t{ withCtrlMod: true }\n);\n\n// The next & previous separator commands are interesting because if we are in quick access mode, we are already holding a modifier key down.\n// In this case, we want that modifier key+up/down to navigate to the next/previous item, not the next/previous separator.\n// To handle this, we have a separate command for navigating to the next/previous separator when we are not in quick access mode.\n// If, however, we are in quick access mode, and you hold down an additional modifier key, we will navigate to the next/previous separator.\n\nconst nextSeparatorFallbackDesc = localize('quickInput.nextSeparatorWithQuickAccessFallback', \"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator.\");\nconst prevSeparatorFallbackDesc = localize('quickInput.previousSeparatorWithQuickAccessFallback', \"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.\");\nif (isMacintosh) {\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.nextSeparatorWithQuickAccessFallback',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyCode.DownArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.NextSeparator, QuickPickFocus.Next),\n\t\t\tmetadata: { description: nextSeparatorFallbackDesc }\n\t\t},\n\t);\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.nextSeparator',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyMod.Alt + KeyCode.DownArrow,\n\t\t\t// Since macOS has the cmd key as the primary modifier, we need to add this additional\n\t\t\t// keybinding to capture cmd+ctrl+upArrow\n\t\t\tsecondary: [KeyMod.CtrlCmd + KeyMod.WinCtrl + KeyCode.DownArrow],\n\t\t\thandler: focusHandler(QuickPickFocus.NextSeparator)\n\t\t},\n\t\t{ withCtrlMod: true }\n\t);\n\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.previousSeparatorWithQuickAccessFallback',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyCode.UpArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.PreviousSeparator, QuickPickFocus.Previous),\n\t\t\tmetadata: { description: prevSeparatorFallbackDesc }\n\t\t},\n\t);\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.previousSeparator',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyMod.Alt + KeyCode.UpArrow,\n\t\t\t// Since macOS has the cmd key as the primary modifier, we need to add this additional\n\t\t\t// keybinding to capture cmd+ctrl+upArrow\n\t\t\tsecondary: [KeyMod.CtrlCmd + KeyMod.WinCtrl + KeyCode.UpArrow],\n\t\t\thandler: focusHandler(QuickPickFocus.PreviousSeparator)\n\t\t},\n\t\t{ withCtrlMod: true }\n\t);\n} else {\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.nextSeparatorWithQuickAccessFallback',\n\t\t\tprimary: KeyMod.Alt + KeyCode.DownArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.NextSeparator, QuickPickFocus.Next),\n\t\t\tmetadata: { description: nextSeparatorFallbackDesc }\n\t\t},\n\t);\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.nextSeparator',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyMod.Alt + KeyCode.DownArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.NextSeparator)\n\t\t},\n\t);\n\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.previousSeparatorWithQuickAccessFallback',\n\t\t\tprimary: KeyMod.Alt + KeyCode.UpArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.PreviousSeparator, QuickPickFocus.Previous),\n\t\t\tmetadata: { description: prevSeparatorFallbackDesc }\n\t\t},\n\t);\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.previousSeparator',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyMod.Alt + KeyCode.UpArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.PreviousSeparator)\n\t\t},\n\t);\n}\n\n//#endregion\n\n//#region Accept\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'quickInput.accept',\n\tprimary: KeyCode.Enter,\n\tweight: KeybindingWeight.WorkbenchContrib,\n\twhen: ContextKeyExpr.and(\n\t\t// All other kinds of Quick things handle Accept, except Widget. In other words, Accepting is a detail on the things\n\t\t// that extend IQuickInput\n\t\tContextKeyExpr.notEquals(quickInputTypeContextKeyValue, QuickInputType.QuickWidget),\n\t\tinQuickInputContext\n\t),\n\tmetadata: { description: localize('nonQuickWidget', \"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.\") },\n\thandler: (accessor) => {\n\t\tconst currentQuickPick = accessor.get(IQuickInputService).currentQuickInput as IQuickPick<any> | IQuickTree<any> | IInputBox;\n\t\tcurrentQuickPick?.accept();\n\t},\n\tsecondary: getSecondary(KeyCode.Enter, [], { withAltMod: true, withCtrlMod: true, withCmdMod: true })\n});\n\nregisterQuickPickCommandAndKeybindingRule(\n\t{\n\t\tid: 'quickInput.acceptInBackground',\n\t\t// If we are in the quick pick but the input box is not focused or our cursor is at the end of the input box\n\t\twhen: ContextKeyExpr.and(\n\t\t\tinQuickInputContext,\n\t\t\tContextKeyExpr.equals(quickInputTypeContextKeyValue, QuickInputType.QuickPick),\n\t\t\tContextKeyExpr.or(InputFocusedContext.negate(), endOfQuickInputBoxContext)\n\t\t),\n\t\tprimary: KeyCode.RightArrow,\n\t\t// Need a little extra weight to ensure this keybinding is preferred over the default cmd+alt+right arrow keybinding\n\t\t// https://github.com/microsoft/vscode/blob/1451e4fbbbf074a4355cc537c35b547b80ce1c52/src/vs/workbench/browser/parts/editor/editorActions.ts#L1178-L1195\n\t\tweight: KeybindingWeight.WorkbenchContrib + 50,\n\t\thandler: (accessor) => {\n\t\t\tconst currentQuickPick = accessor.get(IQuickInputService).currentQuickInput as IQuickPick<any>;\n\t\t\tcurrentQuickPick?.accept(true);\n\t\t},\n\t},\n\t{ withAltMod: true, withCtrlMod: true, withCmdMod: true }\n);\n\n//#endregion\n\n//#region Hide\n\nregisterQuickInputCommandAndKeybindingRule(\n\t{\n\t\tid: 'quickInput.hide',\n\t\tprimary: KeyCode.Escape,\n\t\thandler: (accessor) => {\n\t\t\tconst currentQuickPick = accessor.get(IQuickInputService).currentQuickInput;\n\t\t\tcurrentQuickPick?.hide();\n\t\t}\n\t},\n\t{ withAltMod: true, withCtrlMod: true, withCmdMod: true }\n);\n\n//#endregion\n\n//#region Toggle Hover\n\nregisterQuickPickCommandAndKeybindingRule(\n\t{\n\t\tid: 'quickInput.toggleHover',\n\t\tprimary: ctrlKeyMod | KeyCode.Space,\n\t\thandler: accessor => {\n\t\t\tconst quickInputService = accessor.get(IQuickInputService);\n\t\t\tquickInputService.toggleHover();\n\t\t}\n\t}\n);\n\n//#endregion\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/platform/quickinput/browser/quickInputActions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,WAAW,EAAE,MAAM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B;IACvB,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE;QACrB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,CAAC;QAC5E,gBAAgB,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;CACD,EACD,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CACzD,CAAC;AAEF,YAAY;AAEZ,sBAAsB;AAEtB,yCAAyC,CACxC;IACC,EAAE,EAAE,wBAAwB;IAC5B,OAAO,EAAE,UAAU,yBAAgB;IACnC,OAAO,EAAE,QAAQ,CAAC,EAAE;QACnB,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3D,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;CACD,CACD,CAAC;AAEF,YAAY","file":"quickInputActions.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 { KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { isMacintosh } from '../../../base/common/platform.js';\nimport { PartialExcept } from '../../../base/common/types.js';\nimport { localize } from '../../../nls.js';\nimport { ICommandHandler } from '../../commands/common/commands.js';\nimport { ContextKeyExpr } from '../../contextkey/common/contextkey.js';\nimport { InputFocusedContext } from '../../contextkey/common/contextkeys.js';\nimport { ICommandAndKeybindingRule, KeybindingWeight, KeybindingsRegistry } from '../../keybinding/common/keybindingsRegistry.js';\nimport { endOfQuickInputBoxContext, inQuickInputContext, quickInputTypeContextKeyValue } from './quickInput.js';\nimport { IInputBox, IQuickInputService, IQuickPick, IQuickTree, QuickInputType, QuickPickFocus } from '../common/quickInput.js';\n\nfunction registerQuickInputCommandAndKeybindingRule(rule: PartialExcept<ICommandAndKeybindingRule, 'id' | 'handler'>, options: { withAltMod?: boolean; withCtrlMod?: boolean; withCmdMod?: boolean } = {}) {\n\tKeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\tweight: KeybindingWeight.WorkbenchContrib,\n\t\twhen: inQuickInputContext,\n\t\tmetadata: { description: localize('quickInput', \"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.\") },\n\t\t...rule,\n\t\tsecondary: getSecondary(rule.primary!, rule.secondary ?? [], options)\n\t});\n}\n\nfunction registerQuickPickCommandAndKeybindingRule(rule: PartialExcept<ICommandAndKeybindingRule, 'id' | 'handler'>, options: { withAltMod?: boolean; withCtrlMod?: boolean; withCmdMod?: boolean } = {}) {\n\tKeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\tweight: KeybindingWeight.WorkbenchContrib,\n\t\twhen: ContextKeyExpr.and(\n\t\t\tContextKeyExpr.or(\n\t\t\t\t// Only things that use Tree widgets\n\t\t\t\tContextKeyExpr.equals(quickInputTypeContextKeyValue, QuickInputType.QuickPick),\n\t\t\t\tContextKeyExpr.equals(quickInputTypeContextKeyValue, QuickInputType.QuickTree),\n\t\t\t),\n\t\t\tinQuickInputContext\n\t\t),\n\t\tmetadata: { description: localize('quickPick', \"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.\") },\n\t\t...rule,\n\t\tsecondary: getSecondary(rule.primary!, rule.secondary ?? [], options)\n\t});\n}\n\nconst ctrlKeyMod = isMacintosh ? KeyMod.WinCtrl : KeyMod.CtrlCmd;\n\n// This function will generate all the combinations of keybindings for the given primary keybinding\nfunction getSecondary(primary: number, secondary: number[], options: { withAltMod?: boolean; withCtrlMod?: boolean; withCmdMod?: boolean } = {}): number[] {\n\tif (options.withAltMod) {\n\t\tsecondary.push(KeyMod.Alt + primary);\n\t}\n\tif (options.withCtrlMod) {\n\t\tsecondary.push(ctrlKeyMod + primary);\n\t\tif (options.withAltMod) {\n\t\t\tsecondary.push(KeyMod.Alt + ctrlKeyMod + primary);\n\t\t}\n\t}\n\n\tif (options.withCmdMod && isMacintosh) {\n\t\tsecondary.push(KeyMod.CtrlCmd + primary);\n\t\tif (options.withCtrlMod) {\n\t\t\tsecondary.push(KeyMod.CtrlCmd + KeyMod.WinCtrl + primary);\n\t\t}\n\t\tif (options.withAltMod) {\n\t\t\tsecondary.push(KeyMod.CtrlCmd + KeyMod.Alt + primary);\n\t\t\tif (options.withCtrlMod) {\n\t\t\t\tsecondary.push(KeyMod.CtrlCmd + KeyMod.Alt + KeyMod.WinCtrl + primary);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn secondary;\n}\n\n//#region Navigation\n\nfunction focusHandler(focus: QuickPickFocus, focusOnQuickNatigate?: QuickPickFocus): ICommandHandler {\n\treturn accessor => {\n\t\t// Assuming this is a quick pick due to above when clause\n\t\tconst currentQuickPick = accessor.get(IQuickInputService).currentQuickInput as IQuickPick<any> | IQuickTree<any> | undefined;\n\t\tif (!currentQuickPick) {\n\t\t\treturn;\n\t\t}\n\t\tif (focusOnQuickNatigate && (currentQuickPick as IQuickPick<any>).quickNavigate) {\n\t\t\treturn currentQuickPick.focus(focusOnQuickNatigate);\n\t\t}\n\t\treturn currentQuickPick.focus(focus);\n\t};\n}\n\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.pageNext', primary: KeyCode.PageDown, handler: focusHandler(QuickPickFocus.NextPage) },\n\t{ withAltMod: true, withCtrlMod: true, withCmdMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.pagePrevious', primary: KeyCode.PageUp, handler: focusHandler(QuickPickFocus.PreviousPage) },\n\t{ withAltMod: true, withCtrlMod: true, withCmdMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.first', primary: ctrlKeyMod + KeyCode.Home, handler: focusHandler(QuickPickFocus.First) },\n\t{ withAltMod: true, withCmdMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.last', primary: ctrlKeyMod + KeyCode.End, handler: focusHandler(QuickPickFocus.Last) },\n\t{ withAltMod: true, withCmdMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.next', primary: KeyCode.DownArrow, handler: focusHandler(QuickPickFocus.Next) },\n\t{ withCtrlMod: true }\n);\nregisterQuickPickCommandAndKeybindingRule(\n\t{ id: 'quickInput.previous', primary: KeyCode.UpArrow, handler: focusHandler(QuickPickFocus.Previous) },\n\t{ withCtrlMod: true }\n);\n\n// The next & previous separator commands are interesting because if we are in quick access mode, we are already holding a modifier key down.\n// In this case, we want that modifier key+up/down to navigate to the next/previous item, not the next/previous separator.\n// To handle this, we have a separate command for navigating to the next/previous separator when we are not in quick access mode.\n// If, however, we are in quick access mode, and you hold down an additional modifier key, we will navigate to the next/previous separator.\n\nconst nextSeparatorFallbackDesc = localize('quickInput.nextSeparatorWithQuickAccessFallback', \"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator.\");\nconst prevSeparatorFallbackDesc = localize('quickInput.previousSeparatorWithQuickAccessFallback', \"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.\");\nif (isMacintosh) {\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.nextSeparatorWithQuickAccessFallback',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyCode.DownArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.NextSeparator, QuickPickFocus.Next),\n\t\t\tmetadata: { description: nextSeparatorFallbackDesc }\n\t\t},\n\t);\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.nextSeparator',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyMod.Alt + KeyCode.DownArrow,\n\t\t\t// Since macOS has the cmd key as the primary modifier, we need to add this additional\n\t\t\t// keybinding to capture cmd+ctrl+upArrow\n\t\t\tsecondary: [KeyMod.CtrlCmd + KeyMod.WinCtrl + KeyCode.DownArrow],\n\t\t\thandler: focusHandler(QuickPickFocus.NextSeparator)\n\t\t},\n\t\t{ withCtrlMod: true }\n\t);\n\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.previousSeparatorWithQuickAccessFallback',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyCode.UpArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.PreviousSeparator, QuickPickFocus.Previous),\n\t\t\tmetadata: { description: prevSeparatorFallbackDesc }\n\t\t},\n\t);\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.previousSeparator',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyMod.Alt + KeyCode.UpArrow,\n\t\t\t// Since macOS has the cmd key as the primary modifier, we need to add this additional\n\t\t\t// keybinding to capture cmd+ctrl+upArrow\n\t\t\tsecondary: [KeyMod.CtrlCmd + KeyMod.WinCtrl + KeyCode.UpArrow],\n\t\t\thandler: focusHandler(QuickPickFocus.PreviousSeparator)\n\t\t},\n\t\t{ withCtrlMod: true }\n\t);\n} else {\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.nextSeparatorWithQuickAccessFallback',\n\t\t\tprimary: KeyMod.Alt + KeyCode.DownArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.NextSeparator, QuickPickFocus.Next),\n\t\t\tmetadata: { description: nextSeparatorFallbackDesc }\n\t\t},\n\t);\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.nextSeparator',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyMod.Alt + KeyCode.DownArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.NextSeparator)\n\t\t},\n\t);\n\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.previousSeparatorWithQuickAccessFallback',\n\t\t\tprimary: KeyMod.Alt + KeyCode.UpArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.PreviousSeparator, QuickPickFocus.Previous),\n\t\t\tmetadata: { description: prevSeparatorFallbackDesc }\n\t\t},\n\t);\n\tregisterQuickPickCommandAndKeybindingRule(\n\t\t{\n\t\t\tid: 'quickInput.previousSeparator',\n\t\t\tprimary: KeyMod.CtrlCmd + KeyMod.Alt + KeyCode.UpArrow,\n\t\t\thandler: focusHandler(QuickPickFocus.PreviousSeparator)\n\t\t},\n\t);\n}\n\n//#endregion\n\n//#region Accept\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'quickInput.accept',\n\tprimary: KeyCode.Enter,\n\tweight: KeybindingWeight.WorkbenchContrib,\n\twhen: ContextKeyExpr.and(\n\t\t// All other kinds of Quick things handle Accept, except Widget. In other words, Accepting is a detail on the things\n\t\t// that extend IQuickInput\n\t\tContextKeyExpr.notEquals(quickInputTypeContextKeyValue, QuickInputType.QuickWidget),\n\t\tinQuickInputContext,\n\t\tContextKeyExpr.not('isComposing')\n\t),\n\tmetadata: { description: localize('nonQuickWidget', \"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.\") },\n\thandler: (accessor) => {\n\t\tconst currentQuickPick = accessor.get(IQuickInputService).currentQuickInput as IQuickPick<any> | IQuickTree<any> | IInputBox;\n\t\tcurrentQuickPick?.accept();\n\t},\n\tsecondary: getSecondary(KeyCode.Enter, [], { withAltMod: true, withCtrlMod: true, withCmdMod: true })\n});\n\nregisterQuickPickCommandAndKeybindingRule(\n\t{\n\t\tid: 'quickInput.acceptInBackground',\n\t\t// If we are in the quick pick but the input box is not focused or our cursor is at the end of the input box\n\t\twhen: ContextKeyExpr.and(\n\t\t\tinQuickInputContext,\n\t\t\tContextKeyExpr.equals(quickInputTypeContextKeyValue, QuickInputType.QuickPick),\n\t\t\tContextKeyExpr.or(InputFocusedContext.negate(), endOfQuickInputBoxContext)\n\t\t),\n\t\tprimary: KeyCode.RightArrow,\n\t\t// Need a little extra weight to ensure this keybinding is preferred over the default cmd+alt+right arrow keybinding\n\t\t// https://github.com/microsoft/vscode/blob/1451e4fbbbf074a4355cc537c35b547b80ce1c52/src/vs/workbench/browser/parts/editor/editorActions.ts#L1178-L1195\n\t\tweight: KeybindingWeight.WorkbenchContrib + 50,\n\t\thandler: (accessor) => {\n\t\t\tconst currentQuickPick = accessor.get(IQuickInputService).currentQuickInput as IQuickPick<any>;\n\t\t\tcurrentQuickPick?.accept(true);\n\t\t},\n\t},\n\t{ withAltMod: true, withCtrlMod: true, withCmdMod: true }\n);\n\n//#endregion\n\n//#region Hide\n\nregisterQuickInputCommandAndKeybindingRule(\n\t{\n\t\tid: 'quickInput.hide',\n\t\tprimary: KeyCode.Escape,\n\t\thandler: (accessor) => {\n\t\t\tconst currentQuickPick = accessor.get(IQuickInputService).currentQuickInput;\n\t\t\tcurrentQuickPick?.hide();\n\t\t}\n\t},\n\t{ withAltMod: true, withCtrlMod: true, withCmdMod: true }\n);\n\n//#endregion\n\n//#region Toggle Hover\n\nregisterQuickPickCommandAndKeybindingRule(\n\t{\n\t\tid: 'quickInput.toggleHover',\n\t\tprimary: ctrlKeyMod | KeyCode.Space,\n\t\thandler: accessor => {\n\t\t\tconst quickInputService = accessor.get(IQuickInputService);\n\t\t\tquickInputService.toggleHover();\n\t\t}\n\t}\n);\n\n//#endregion\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monaco-editor-core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.55.0-dev-
|
|
4
|
+
"version": "0.55.0-dev-20251101",
|
|
5
5
|
"description": "A browser based code editor",
|
|
6
6
|
"author": "Microsoft Corporation",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/microsoft/vscode/issues"
|
|
16
16
|
},
|
|
17
|
-
"vscodeCommitId": "
|
|
17
|
+
"vscodeCommitId": "63553dfa3606b86c35e6035f1223fcfece592f41",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"marked": "14.0.0",
|
|
20
20
|
"dompurify": "3.2.7"
|