monaco-editor-core 0.56.0-dev-20260626 → 0.56.0-dev-20260627

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260626(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
3
+ * Version: 0.56.0-dev-20260627(d8c9ff06b7bcbd0c07d1ccb16e3d30f5e5962d08)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -99,6 +99,7 @@ let ColorDetector = class ColorDetector extends Disposable {
99
99
  updateColors() {
100
100
  this.stop();
101
101
  if (!this._isColorDecoratorsEnabled) {
102
+ this.removeAllDecorations();
102
103
  return;
103
104
  }
104
105
  const model = this._editor.getModel();
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorDetector.ts","vs/editor/contrib/colorPicker/browser/colorDetector.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAqB,uBAAuB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAGtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CA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AAG,QAAQ,CAAC;YAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1B,CAAC;IACF,CAAC;CACD","file":"colorDetector.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 { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/colorPicker/browser/colorDetector.ts","vs/editor/contrib/colorPicker/browser/colorDetector.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAqB,uBAAuB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAGtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAA+B,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACnI,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,SAAS,EAAc,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAEnG,MAAM,CAA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scode/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 { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\tthis.removeAllDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { RGBA } from '../../../../base/common/color.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { noBreakWhitespace } from '../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { DynamicCssRules } from '../../../browser/editorDom.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js';\nimport { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { getColors, IColorData } from './color.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const ColorDecorationInjectedTextMarker = Object.create({});\n\n\nexport class ColorDetector extends Disposable implements IEditorContribution {\n\n\tpublic static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic readonly RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly _localToDispose = this._register(new DisposableStore());\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\tprivate _debounceInformation: IFeatureDebounceInformation;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate readonly _colorDecoratorIds: IEditorDecorationsCollection;\n\n\tprivate _isColorDecoratorsEnabled: boolean;\n\tprivate _defaultColorDecoratorsEnablement: 'auto' | 'always' | 'never';\n\n\tprivate readonly _ruleFactory: DynamicCssRules;\n\n\tprivate readonly _decoratorLimitReporter = this._register(new DecoratorLimitReporter());\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ILanguageFeatureDebounceService languageFeatureDebounceService: ILanguageFeatureDebounceService,\n\t) {\n\t\tsuper();\n\t\tthis._colorDecoratorIds = this._editor.createDecorationsCollection();\n\t\tthis._ruleFactory = this._register(new DynamicCssRules(this._editor));\n\t\tthis._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, 'Document Colors', { min: ColorDetector.RECOMPUTE_TIME });\n\t\tthis._register(_editor.onDidChangeModel(() => {\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis.updateColors();\n\t\t}));\n\t\tthis._register(_editor.onDidChangeModelLanguage(() => this.updateColors()));\n\t\tthis._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors()));\n\t\tthis._register(_editor.onDidChangeConfiguration((e) => {\n\t\t\tconst prevIsEnabled = this._isColorDecoratorsEnabled;\n\t\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\t\tconst updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged(EditorOption.colorDecoratorsLimit);\n\t\t\tconst updatedDefaultColorDecoratorsSetting = e.hasChanged(EditorOption.defaultColorDecorators);\n\t\t\tif (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) {\n\t\t\t\tif (this._isColorDecoratorsEnabled) {\n\t\t\t\t\tthis.updateColors();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.removeAllDecorations();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._timeoutTimer = null;\n\t\tthis._computePromise = null;\n\t\tthis._isColorDecoratorsEnabled = this.isEnabled();\n\t\tthis._defaultColorDecoratorsEnablement = this._editor.getOption(EditorOption.defaultColorDecorators);\n\t\tthis.updateColors();\n\t}\n\n\tisEnabled(): boolean {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\t\tconst languageId = model.getLanguageId();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tconst deprecatedConfig = this._configurationService.getValue(languageId);\n\t\tif (deprecatedConfig && typeof deprecatedConfig === 'object') {\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst colorDecorators = (deprecatedConfig as any)['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');\n\t\t\tif (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {\n\t\t\t\treturn colorDecorators['enable'];\n\t\t\t}\n\t\t}\n\n\t\treturn this._editor.getOption(EditorOption.colorDecorators);\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector | null {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateColors(): void {\n\t\tthis.stop();\n\n\t\tif (!this._isColorDecoratorsEnabled) {\n\t\t\tthis.removeAllDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!model || !this._languageFeaturesService.colorProvider.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.add(this._editor.onDidChangeModelContent(() => {\n\t\t\tif (!this._timeoutTimer) {\n\t\t\t\tthis._timeoutTimer = new TimeoutTimer();\n\t\t\t\tthis._timeoutTimer.cancelAndSet(() => {\n\t\t\t\t\tthis._timeoutTimer = null;\n\t\t\t\t\tthis.beginCompute();\n\t\t\t\t}, this._debounceInformation.get(model));\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tthis._computePromise = createCancelablePromise(async token => {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst sw = new StopWatch(false);\n\t\t\tconst colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement);\n\t\t\tthis._debounceInformation.update(model, sw.elapsed());\n\t\t\treturn colors;\n\t\t});\n\t\ttry {\n\t\t\tconst colors = await this._computePromise;\n\t\t\tthis.updateDecorations(colors);\n\t\t\tthis.updateColorDecorators(colors);\n\t\t\tthis._computePromise = null;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\t}\n\n\tprivate stop(): void {\n\t\tif (this._timeoutTimer) {\n\t\t\tthis._timeoutTimer.cancel();\n\t\t\tthis._timeoutTimer = null;\n\t\t}\n\t\tif (this._computePromise) {\n\t\t\tthis._computePromise.cancel();\n\t\t\tthis._computePromise = null;\n\t\t}\n\t\tthis._localToDispose.clear();\n\t}\n\n\tprivate updateDecorations(colorDatas: IColorData[]): void {\n\t\tconst decorations = colorDatas.map(c => ({\n\t\t\trange: {\n\t\t\t\tstartLineNumber: c.colorInfo.range.startLineNumber,\n\t\t\t\tstartColumn: c.colorInfo.range.startColumn,\n\t\t\t\tendLineNumber: c.colorInfo.range.endLineNumber,\n\t\t\t\tendColumn: c.colorInfo.range.endColumn\n\t\t\t},\n\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t}));\n\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations);\n\n\t\t\tthis._colorDatas = new Map<string, IColorData>();\n\t\t\tthis._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i]));\n\t\t});\n\t}\n\n\tprivate readonly _colorDecorationClassRefs = this._register(new DisposableStore());\n\n\tprivate updateColorDecorators(colorData: IColorData[]): void {\n\t\tthis._colorDecorationClassRefs.clear();\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst limit = this._editor.getOption(EditorOption.colorDecoratorsLimit);\n\n\t\tfor (let i = 0; i < colorData.length && decorations.length < limit; i++) {\n\t\t\tconst { red, green, blue, alpha } = colorData[i].colorInfo.color;\n\t\t\tconst rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha);\n\t\t\tconst color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\n\t\t\tconst ref = this._colorDecorationClassRefs.add(\n\t\t\t\tthis._ruleFactory.createClassNameRef({\n\t\t\t\t\tbackgroundColor: color\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tdecorations.push({\n\t\t\t\trange: {\n\t\t\t\t\tstartLineNumber: colorData[i].colorInfo.range.startLineNumber,\n\t\t\t\t\tstartColumn: colorData[i].colorInfo.range.startColumn,\n\t\t\t\t\tendLineNumber: colorData[i].colorInfo.range.endLineNumber,\n\t\t\t\t\tendColumn: colorData[i].colorInfo.range.endColumn\n\t\t\t\t},\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'colorDetector',\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontent: noBreakWhitespace,\n\t\t\t\t\t\tinlineClassName: `${ref.className} colorpicker-color-decoration`,\n\t\t\t\t\t\tinlineClassNameAffectsLetterSpacing: true,\n\t\t\t\t\t\tattachedData: ColorDecorationInjectedTextMarker\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst limited = limit < colorData.length ? limit : false;\n\t\tthis._decoratorLimitReporter.update(colorData.length, limited);\n\n\t\tthis._colorDecoratorIds.set(decorations);\n\t}\n\n\tprivate removeAllDecorations(): void {\n\t\tthis._editor.removeDecorations(this._decorationsIds);\n\t\tthis._decorationsIds = [];\n\t\tthis._colorDecoratorIds.clear();\n\t\tthis._colorDecorationClassRefs.clear();\n\t}\n\n\tgetColorData(position: Position): IColorData | null {\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst decorations = model\n\t\t\t.getDecorationsInRange(Range.fromPositions(position, position))\n\t\t\t.filter(d => this._colorDatas.has(d.id));\n\n\t\tif (decorations.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._colorDatas.get(decorations[0].id)!;\n\t}\n\n\tisColorDecoration(decoration: IModelDecoration): boolean {\n\t\treturn this._colorDecoratorIds.has(decoration);\n\t}\n}\n\nexport class DecoratorLimitReporter extends Disposable {\n\tprivate _onDidChange = this._register(new Emitter<void>());\n\n\tprivate _computed: number = 0;\n\tprivate _limited: number | false = false;\n\tpublic update(computed: number, limited: number | false) {\n\t\tif (computed !== this._computed || limited !== this._limited) {\n\t\t\tthis._computed = computed;\n\t\t\tthis._limited = limited;\n\t\t\tthis._onDidChange.fire();\n\t\t}\n\t}\n}\n"]}
@@ -22,7 +22,7 @@ import { Position } from '../../../common/core/position.js';
22
22
  import { Range } from '../../../common/core/range.js';
23
23
  import * as dom from '../../../../base/browser/dom.js';
24
24
  import { MarkdownHoverParticipant } from './markdownHoverParticipant.js';
25
- import { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';
25
+ import { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';
26
26
  import { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';
27
27
  import { BugIndicatingError } from '../../../../base/common/errors.js';
28
28
  import { IHoverService } from '../../../../platform/hover/browser/hover.js';
@@ -229,7 +229,7 @@ let RenderedContentHoverParts = class RenderedContentHoverParts extends Disposab
229
229
  this._focusedHoverPartIndex = -1;
230
230
  }));
231
231
  // Add copy button for marker hovers
232
- if (renderedPart.type === 'hoverPart' && !renderedPart.participant.hideCopyButton) {
232
+ if (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {
233
233
  disposables.add(new HoverCopyButton(element, () => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart), this._clipboardService, this._hoverService));
234
234
  }
235
235
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverRendered.ts","vs/editor/contrib/hover/browser/contentHoverRendered.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAA4G,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/J,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,sCAAsC,CAAC;AA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AG,mBAAmB,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC7K,MAAM,iCAAiC,GAAG,mBAAmB,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC9L,MAAM,yBAAyB,GAAG,iCAAiC,IAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,GAAG,iCAAiC,CAAC,CAAC,CAAC,iCAAiC,CAAC;QAC9K,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,yBAAyB,GAAG,CAAC,EAAE,CAAC;IAC3F,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACnC,CAAC;;AAjOI,yBAAyB;IAoB5B,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;IACb,WAAA,iBAAiB,CAAA;GAtBd,yBAAyB,CAkO9B","file":"contentHoverRendered.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 { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t\t// Add copy button for marker hovers\n\t\t\tif (renderedPart.type === 'hoverPart' && !renderedPart.participant.hideCopyButton) {\n\t\t\t\tdisposables.add(new HoverCopyButton(\n\t\t\t\t\telement,\n\t\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\tthis._hoverService\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\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 { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t\t// Add copy button for marker hovers\n\t\t\tif (renderedPart.type === 'hoverPart' && !renderedPart.participant.hideCopyButton) {\n\t\t\t\tdisposables.add(new HoverCopyButton(\n\t\t\t\t\telement,\n\t\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\tthis._hoverService\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverRendered.ts","vs/editor/contrib/hover/browser/contentHoverRendered.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAA4G,kBAAkB,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QACD,OAAO,KAAK,GAAG,0BAA0B,CAAC;IAC3C,CAAC;IAEO,8BAA8B,CAAC,wBAAkD;QACxF,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QACxD,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC7K,MAAM,iCAAiC,GAAG,mBAAmB,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC9L,MAAM,yBAAyB,GAAG,iCAAiC,IAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,GAAG,iCAAiC,CAAC,CAAC,CAAC,iCAAiC,CAAC;QAC9K,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,yBAAyB,GAAG,CAAC,EAAE,CAAC;IAC3F,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACnC,CAAC;;AAjOI,yBAAyB;IAoB5B,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;IACb,WAAA,iBAAiB,CAAA;GAtBd,yBAAyB,CAkO9B","file":"contentHoverRendered.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 { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t\t// Add copy button for marker hovers\n\t\t\tif (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {\n\t\t\t\tdisposables.add(new HoverCopyButton(\n\t\t\t\t\telement,\n\t\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\tthis._hoverService\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\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 { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t\t// Add copy button for marker hovers\n\t\t\tif (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {\n\t\t\t\tdisposables.add(new HoverCopyButton(\n\t\t\t\t\telement,\n\t\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\tthis._hoverService\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n"]}
@@ -83,8 +83,8 @@
83
83
  border-top: 1px solid var(--vscode-editorHoverWidget-border);
84
84
  color: var(--vscode-descriptionForeground);
85
85
  font-size: 12px;
86
- margin: 4px 0px;
87
- width: 100%;
86
+ margin: 4px 6px;
87
+ width: calc(100% - 12px);
88
88
  cursor: default;
89
89
  -webkit-user-select: none;
90
90
  user-select: none;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "monaco-editor-core",
3
3
  "private": false,
4
- "version": "0.56.0-dev-20260626",
4
+ "version": "0.56.0-dev-20260627",
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": "2fb1c411a7933676c4efd18140f2a98fc910c945",
17
+ "vscodeCommitId": "9d449b8048ce4a267d5e26ae1bfdff1d82fcdd95",
18
18
  "dependencies": {
19
19
  "marked": "14.0.0",
20
20
  "dompurify": "3.4.8"