monaco-editor-core 0.56.0-dev-20260127 → 0.56.0-dev-20260128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.messages.cs.js +1 -1
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +6 -2
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/package.json +2 -2
package/esm/nls.messages.cs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.de.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.fr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.it.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ja.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ko.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.pl.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
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-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ru.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.tr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
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-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
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-
|
|
3
|
+
* Version: 0.56.0-dev-20260128(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/hover/hover.ts","vs/base/browser/ui/hover/hover.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AA0ZhG,MAAM,UAAU,mCAAmC,CAAC,GAAY;IAC/D,MAAM,SAAS,GAAG,GAAyC,CAAC;IAC5D,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,UAAU,IAAI,SAAS,IAAI,8BAA8B,IAAI,SAAS,CAAC;AAChH,CAAC;AA8BD,2BAA2B","file":"hover.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 { IHoverDelegate } from './hoverDelegate.js';\nimport { HoverPosition } from './hoverWidget.js';\nimport { CancellationToken } from '../../../common/cancellation.js';\nimport { IMarkdownString } from '../../../common/htmlContent.js';\nimport { IDisposable } from '../../../common/lifecycle.js';\n\n/**\n * Enables the convenient display of rich markdown-based hovers in the workbench.\n */\nexport interface IHoverDelegate2 {\n\t/**\n\t * Shows a hover after a delay, or immediately if the {@link groupId} matches the currently\n\t * shown hover.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Control showing the hover yourself.\n\t * - Show the hover after the standard delay.\n\t *\n\t * @param options The options of the hover.\n\t * @param groupId The group ID of the hover. If the group ID is the same as the currently shown\n\t * hover, the hover will be shown immediately, skipping the delay.\n\t */\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined;\n\n\t/**\n\t * A simple wrapper around showDelayedHover that includes listening to events on the\n\t * {@link target} element that shows the hover.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Let the hover service handle showing the hover.\n\t * - Show the hover after the standard delay.\n\t * - Want the hover positioned beside the {@link target} element.\n\t *\n\t * @param target The target element to listener for mouseover events on.\n\t * @param hoverOptions The options of the hover.\n\t * @param lifecycleOptions The options of the hover's lifecycle.\n\t */\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\thoverOptions: (() => IDelayedHoverOptions) | IDelayedHoverOptions,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable;\n\n\t/**\n\t * A simple wrapper around showDelayedHover that includes listening to events on the\n\t * {@link target} element that shows the hover. This differs from {@link setupDelayedHover} in\n\t * that the hover will be shown at the mouse position instead of the\n\t * {@link target target} element's position, ignoring any\n\t * {@link IHoverOptions.position position options} that are passed in.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Let the hover service handle showing the hover.\n\t * - Show the hover after the standard delay.\n\t * - Want the hover positioned beside the mouse.\n\t *\n\t * @param target The target element to listener for mouseover events on.\n\t * @param hoverOptions The options of the hover.\n\t * @param lifecycleOptions The options of the hover's lifecycle.\n\t */\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\thoverOptions: (() => IDelayedHoverAtMouseOptions) | IDelayedHoverAtMouseOptions,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable;\n\n\t/**\n\t * Shows a hover immediately, provided a hover with the same {@link options} object is not\n\t * already visible.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Control showing the hover yourself.\n\t * - Show the hover immediately.\n\t *\n\t * @param options A set of options defining the characteristics of the hover.\n\t * @param focus Whether to focus the hover (useful for keyboard accessibility).\n\t *\n\t * @example A simple usage with a single element target.\n\t *\n\t * ```typescript\n\t * showInstantHover({\n\t * text: new MarkdownString('Hello world'),\n\t * target: someElement\n\t * });\n\t * ```\n\t */\n\tshowInstantHover(\n\t\toptions: IHoverOptions,\n\t\tfocus?: boolean\n\t): IHoverWidget | undefined;\n\n\t/**\n\t * Hides the hover if it was visible. This call will be ignored if the hover is currently\n\t * \"locked\" via the alt/option key unless `force` is set.\n\t */\n\thideHover(force?: boolean): void;\n\n\t/**\n\t * This should only be used until we have the ability to show multiple context views\n\t * simultaneously. #188822\n\t */\n\tshowAndFocusLastHover(): void;\n\n\t/**\n\t * Sets up a managed hover for the given element. A managed hover will set up listeners for\n\t * mouse events, show the hover after a delay and provide hooks to easily update the content.\n\t *\n\t * This should be used over {@link showInstantHover} when fine-grained control is not needed. The\n\t * managed hover also does not scale well, consider using {@link showInstantHover} when showing hovers\n\t * for many elements.\n\t *\n\t * @param hoverDelegate The hover delegate containing hooks and configuration for the hover.\n\t * @param targetElement The target element to show the hover for.\n\t * @param content The content of the hover or a factory that creates it at the time it's shown.\n\t * @param options Additional options for the managed hover.\n\t *\n\t * @deprecated Use {@link setupDelayedHover} or {@link setupDelayedHoverAtMouse} instead where\n\t * possible.\n\t */\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions): IManagedHover;\n\n\t/**\n\t * Shows the hover for the given element if one has been setup.\n\t *\n\t * @param targetElement The target element of the hover, as set up in {@link setupManagedHover}.\n\t *\n\t * @deprecated Use {@link setupDelayedHover} or {@link setupDelayedHoverAtMouse} instead where\n\t * possible.\n\t */\n\tshowManagedHover(targetElement: HTMLElement): void;\n}\n\nexport interface IHoverWidget extends IDisposable {\n\t/**\n\t * Whether the hover widget has been disposed.\n\t */\n\treadonly isDisposed: boolean;\n}\n\nexport const enum HoverStyle {\n\t/**\n\t * The hover is anchored below the element with a pointer above it pointing at the target.\n\t */\n\tPointer = 1,\n\t/**\n\t * The hover is anchored to the bottom right of the cursor's location.\n\t */\n\tMouse = 2,\n}\n\nexport interface IHoverOptions {\n\t/**\n\t * The content to display in the primary section of the hover. The type of text determines the\n\t * default `hideOnHover` behavior.\n\t */\n\tcontent: IMarkdownString | string | HTMLElement;\n\n\t/**\n\t * The target for the hover. This determines the position of the hover and it will only be\n\t * hidden when the mouse leaves both the hover and the target. A HTMLElement can be used for\n\t * simple cases and a IHoverTarget for more complex cases where multiple elements and/or a\n\t * dispose method is required.\n\t */\n\ttarget: IHoverTarget | HTMLElement;\n\n\t/*\n\t * The container to pass to {@link IContextViewProvider.showContextView} which renders the hover\n\t * in. This is particularly useful for more natural tab focusing behavior, where the hover is\n\t * created as the next tab index after the element being hovered and/or to workaround the\n\t * element's container hiding on `focusout`.\n\t */\n\tcontainer?: HTMLElement;\n\n\t/**\n\t * An ID to associate with the hover to be used as an equality check. Normally when calling\n\t * {@link IHoverService.showHover} the options object itself is used to determine if the hover\n\t * is the same one that is already showing, when this is set, the ID will be used instead.\n\t *\n\t * When `undefined`, this will default to a serialized version of {@link content}. In this case\n\t * it will remain `undefined` if {@link content} is a `HTMLElement`.\n\t */\n\tid?: string;\n\n\t/**\n\t * A set of actions for the hover's \"status bar\".\n\t */\n\tactions?: IHoverAction[];\n\n\t/**\n\t * An optional array of classes to add to the hover element.\n\t */\n\tadditionalClasses?: string[];\n\n\t/**\n\t * An optional link handler for markdown links, if this is not provided the IOpenerService will\n\t * be used to open the links using its default options.\n\t */\n\tlinkHandler?(url: string): void;\n\n\t/**\n\t * Whether to trap focus in the following ways:\n\t * - When the hover closes, focus goes to the element that had focus before the hover opened\n\t * - If there are elements in the hover to focus, focus stays inside of the hover when tabbing\n\t * Note that this is overridden to true when in screen reader optimized mode.\n\t */\n\ttrapFocus?: boolean;\n\n\t/**\n\t * The style of the hover, this sets default values of {@link position} and {@link appearance}:\n\t */\n\tstyle?: HoverStyle;\n\n\t/**\n\t * Options that defines where the hover is positioned.\n\t */\n\tposition?: IHoverPositionOptions;\n\n\t/**\n\t * Options that defines how long the hover is shown and when it hides.\n\t */\n\tpersistence?: IHoverPersistenceOptions;\n\n\t/**\n\t * Options that define how the hover looks.\n\t */\n\tappearance?: IHoverAppearanceOptions;\n\n\t/**\n\t * An optional callback that is called when the hover is shown. This is called\n\t * later for delayed hovers.\n\t */\n\tonDidShow?(): void;\n}\n\n// `target` is ignored for delayed hover methods as it's included in the method and added\n// automatically when the hover options get resolved.\nexport type IDelayedHoverOptions = Omit<IHoverOptions, 'target'>;\n\n// `position` is ignored for delayed at mouse hover methods as it's overwritten by the mouse event.\n// `showPointer` is always false when using mouse positioning\nexport type IDelayedHoverAtMouseOptions = Omit<IDelayedHoverOptions, 'position' | 'appearance'> & { appearance?: Omit<IHoverAppearanceOptions, 'showPointer'> };\n\nexport interface IHoverLifecycleOptions {\n\t/**\n\t * The group ID of the hover. If the group ID is the same as the currently shown hover, the\n\t * hover will be shown immediately, skipping the delay.\n\t *\n\t * @example Use a UUID to set a unique `groupId` for related hovers\n\t *\n\t * ```typescript\n\t * const groupId = generateUuid();\n\t * showDelayedHover({ content: 'Button 1', target: someElement1 }, { groupId });\n\t * showDelayedHover({ content: 'Button 2', target: someElement2 }, { groupId });\n\t * ```\n\t *\n\t * @example Use a feature-specific string to set a unqiue `groupId` for related hovers\n\t *\n\t * ```typescript\n\t * showDelayedHover({ content: 'Button 1', target: someElement1 }, { groupId: 'my-feature-items' });\n\t * showDelayedHover({ content: 'Button 2', target: someElement2 }, { groupId: 'my-feature-items' });\n\t * ```\n\t */\n\tgroupId?: string;\n\n\t/**\n\t * Whether to set up space and enter keyboard events for the hover, when these are pressed when\n\t * the hover's target is focused it will show and focus the hover.\n\t *\n\t * Typically this should _not_ be used when the space or enter events are already handled by\n\t * something else.\n\t */\n\tsetupKeyboardEvents?: boolean;\n}\n\nexport interface IHoverPositionOptions {\n\t/**\n\t * Position of the hover. The default is to show above the target. This option will be ignored\n\t * if there is not enough room to layout the hover in the specified position, unless the\n\t * forcePosition option is set.\n\t */\n\thoverPosition?: HoverPosition | MouseEvent;\n\n\t/**\n\t * Force the hover position, reducing the size of the hover instead of adjusting the hover\n\t * position.\n\t */\n\tforcePosition?: boolean;\n}\n\nexport interface IHoverPersistenceOptions {\n\t/**\n\t * Whether to hide the hover when the mouse leaves the `target` and enters the actual hover.\n\t * This is false by default when text is an `IMarkdownString` and true when `text` is a\n\t * `string`. Note that this will be ignored if any `actions` are provided as hovering is\n\t * required to make them accessible.\n\t *\n\t * In general hiding on hover is desired for:\n\t * - Regular text where selection is not important\n\t * - Markdown that contains no links where selection is not important\n\t */\n\thideOnHover?: boolean;\n\n\t/**\n\t * Whether to hide the hover when a key is pressed.\n\t */\n\thideOnKeyDown?: boolean;\n\n\t/**\n\t * Whether to make the hover sticky, this means it will not be hidden when the mouse leaves the\n\t * hover.\n\t */\n\tsticky?: boolean;\n}\n\nexport interface IHoverAppearanceOptions {\n\t/**\n\t * Whether to show the hover pointer, a little arrow that connects the target and the hover.\n\t */\n\tshowPointer?: boolean;\n\n\t/**\n\t * Whether to show a compact hover, reducing the font size and padding of the hover.\n\t */\n\tcompact?: boolean;\n\n\t/**\n\t * When {@link hideOnHover} is explicitly true or undefined and its auto value is detected to\n\t * hide, show a hint at the bottom of the hover explaining how to mouse over the widget. This\n\t * should be used in the cases where despite the hover having no interactive content, it's\n\t * likely the user may want to interact with it somehow.\n\t */\n\tshowHoverHint?: boolean;\n\n\t/**\n\t * Whether to skip the fade in animation, this should be used when hovering from one hover to\n\t * another in the same group so it looks like the hover is moving from one element to the other.\n\t */\n\tskipFadeInAnimation?: boolean;\n\n\t/**\n\t * The max height of the hover relative to the window height.\n\t * Accepted values: (0,1]\n\t * Default: 0.5\n\t */\n\tmaxHeightRatio?: number;\n}\n\nexport interface IHoverAction {\n\t/**\n\t * The label to use in the hover's status bar.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The command ID of the action, this is used to resolve the keybinding to display after the\n\t * action label.\n\t */\n\tcommandId: string;\n\n\t/**\n\t * An optional class of an icon that will be displayed before the label.\n\t */\n\ticonClass?: string;\n\n\t/**\n\t * The callback to run the action.\n\t * @param target The action element that was activated.\n\t */\n\trun(target: HTMLElement): void;\n}\n\n/**\n * A target for a hover.\n */\nexport interface IHoverTarget extends Partial<IDisposable> {\n\t/**\n\t * A set of target elements used to position the hover. If multiple elements are used the hover\n\t * will try to not overlap any target element. An example use case for this is show a hover for\n\t * wrapped text.\n\t */\n\treadonly targetElements: readonly HTMLElement[];\n\n\t/**\n\t * An optional absolute x coordinate to position the hover with, for example to position the\n\t * hover using `MouseEvent.pageX`.\n\t */\n\treadonly x?: number;\n\n\t/**\n\t * An optional absolute y coordinate to position the hover with, for example to position the\n\t * hover using `MouseEvent.pageY`.\n\t */\n\treadonly y?: number;\n}\n\n// #region Managed hover\n\nexport interface IManagedHoverTooltipMarkdownString {\n\tmarkdown: IMarkdownString | string | undefined | ((token: CancellationToken) => Promise<IMarkdownString | string | undefined>);\n\tmarkdownNotSupportedFallback: string | undefined;\n}\n\nexport function isManagedHoverTooltipMarkdownString(obj: unknown): obj is IManagedHoverTooltipMarkdownString {\n\tconst candidate = obj as IManagedHoverTooltipMarkdownString;\n\treturn typeof candidate === 'object' && 'markdown' in candidate && 'markdownNotSupportedFallback' in candidate;\n}\n\nexport interface IManagedHoverTooltipHTMLElement {\n\telement: (token: CancellationToken) => HTMLElement | Promise<HTMLElement>;\n}\n\nexport type IManagedHoverContent = string | IManagedHoverTooltipMarkdownString | IManagedHoverTooltipHTMLElement | HTMLElement | undefined;\nexport type IManagedHoverContentOrFactory = IManagedHoverContent | (() => IManagedHoverContent);\n\nexport interface IManagedHoverOptions extends Pick<IHoverOptions, 'actions' | 'linkHandler' | 'trapFocus'> {\n\tappearance?: Pick<IHoverAppearanceOptions, 'showHoverHint'>;\n}\n\nexport interface IManagedHover extends IDisposable {\n\t/**\n\t * Allows to programmatically open the hover.\n\t */\n\tshow(focus?: boolean): void;\n\n\t/**\n\t * Allows to programmatically hide the hover.\n\t */\n\thide(): void;\n\n\t/**\n\t * Updates the contents of the hover.\n\t */\n\tupdate(tooltip: IManagedHoverContent, options?: IManagedHoverOptions): void;\n}\n\n// #endregion Managed hover\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 { IHoverDelegate } from './hoverDelegate.js';\nimport { HoverPosition } from './hoverWidget.js';\nimport { CancellationToken } from '../../../common/cancellation.js';\nimport { IMarkdownString } from '../../../common/htmlContent.js';\nimport { IDisposable } from '../../../common/lifecycle.js';\n\n/**\n * Enables the convenient display of rich markdown-based hovers in the workbench.\n */\nexport interface IHoverDelegate2 {\n\t/**\n\t * Shows a hover after a delay, or immediately if the {@link groupId} matches the currently\n\t * shown hover.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Control showing the hover yourself.\n\t * - Show the hover after the standard delay.\n\t *\n\t * @param options The options of the hover.\n\t * @param groupId The group ID of the hover. If the group ID is the same as the currently shown\n\t * hover, the hover will be shown immediately, skipping the delay.\n\t */\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined;\n\n\t/**\n\t * A simple wrapper around showDelayedHover that includes listening to events on the\n\t * {@link target} element that shows the hover.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Let the hover service handle showing the hover.\n\t * - Show the hover after the standard delay.\n\t * - Want the hover positioned beside the {@link target} element.\n\t *\n\t * @param target The target element to listener for mouseover events on.\n\t * @param hoverOptions The options of the hover.\n\t * @param lifecycleOptions The options of the hover's lifecycle.\n\t */\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\thoverOptions: (() => IDelayedHoverOptions) | IDelayedHoverOptions,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable;\n\n\t/**\n\t * A simple wrapper around showDelayedHover that includes listening to events on the\n\t * {@link target} element that shows the hover. This differs from {@link setupDelayedHover} in\n\t * that the hover will be shown at the mouse position instead of the\n\t * {@link target target} element's position, ignoring any\n\t * {@link IHoverOptions.position position options} that are passed in.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Let the hover service handle showing the hover.\n\t * - Show the hover after the standard delay.\n\t * - Want the hover positioned beside the mouse.\n\t *\n\t * @param target The target element to listener for mouseover events on.\n\t * @param hoverOptions The options of the hover.\n\t * @param lifecycleOptions The options of the hover's lifecycle.\n\t */\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\thoverOptions: (() => IDelayedHoverAtMouseOptions) | IDelayedHoverAtMouseOptions,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable;\n\n\t/**\n\t * Shows a hover immediately, provided a hover with the same {@link options} object is not\n\t * already visible.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Control showing the hover yourself.\n\t * - Show the hover immediately.\n\t *\n\t * @param options A set of options defining the characteristics of the hover.\n\t * @param focus Whether to focus the hover (useful for keyboard accessibility).\n\t *\n\t * @example A simple usage with a single element target.\n\t *\n\t * ```typescript\n\t * showInstantHover({\n\t * text: new MarkdownString('Hello world'),\n\t * target: someElement\n\t * });\n\t * ```\n\t */\n\tshowInstantHover(\n\t\toptions: IHoverOptions,\n\t\tfocus?: boolean\n\t): IHoverWidget | undefined;\n\n\t/**\n\t * Hides the hover if it was visible. This call will be ignored if the hover is currently\n\t * \"locked\" via the alt/option key unless `force` is set.\n\t */\n\thideHover(force?: boolean): void;\n\n\t/**\n\t * This should only be used until we have the ability to show multiple context views\n\t * simultaneously. #188822\n\t */\n\tshowAndFocusLastHover(): void;\n\n\t/**\n\t * Sets up a managed hover for the given element. A managed hover will set up listeners for\n\t * mouse events, show the hover after a delay and provide hooks to easily update the content.\n\t *\n\t * This should be used over {@link showInstantHover} when fine-grained control is not needed. The\n\t * managed hover also does not scale well, consider using {@link showInstantHover} when showing hovers\n\t * for many elements.\n\t *\n\t * @param hoverDelegate The hover delegate containing hooks and configuration for the hover.\n\t * @param targetElement The target element to show the hover for.\n\t * @param content The content of the hover or a factory that creates it at the time it's shown.\n\t * @param options Additional options for the managed hover.\n\t *\n\t * @deprecated Use {@link setupDelayedHover} or {@link setupDelayedHoverAtMouse} instead where\n\t * possible.\n\t */\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions): IManagedHover;\n\n\t/**\n\t * Shows the hover for the given element if one has been setup.\n\t *\n\t * @param targetElement The target element of the hover, as set up in {@link setupManagedHover}.\n\t *\n\t * @deprecated Use {@link setupDelayedHover} or {@link setupDelayedHoverAtMouse} instead where\n\t * possible.\n\t */\n\tshowManagedHover(targetElement: HTMLElement): void;\n}\n\nexport interface IHoverWidget extends IDisposable {\n\t/**\n\t * Whether the hover widget has been disposed.\n\t */\n\treadonly isDisposed: boolean;\n}\n\nexport const enum HoverStyle {\n\t/**\n\t * The hover is anchored below the element with a pointer above it pointing at the target.\n\t */\n\tPointer = 1,\n\t/**\n\t * The hover is anchored to the bottom right of the cursor's location.\n\t */\n\tMouse = 2,\n}\n\nexport interface IHoverOptions {\n\t/**\n\t * The content to display in the primary section of the hover. The type of text determines the\n\t * default `hideOnHover` behavior.\n\t */\n\tcontent: IMarkdownString | string | HTMLElement;\n\n\t/**\n\t * The target for the hover. This determines the position of the hover and it will only be\n\t * hidden when the mouse leaves both the hover and the target. A HTMLElement can be used for\n\t * simple cases and a IHoverTarget for more complex cases where multiple elements and/or a\n\t * dispose method is required.\n\t */\n\ttarget: IHoverTarget | HTMLElement;\n\n\t/*\n\t * The container to pass to {@link IContextViewProvider.showContextView} which renders the hover\n\t * in. This is particularly useful for more natural tab focusing behavior, where the hover is\n\t * created as the next tab index after the element being hovered and/or to workaround the\n\t * element's container hiding on `focusout`.\n\t */\n\tcontainer?: HTMLElement;\n\n\t/**\n\t * An ID to associate with the hover to be used as an equality check. Normally when calling\n\t * {@link IHoverService.showHover} the options object itself is used to determine if the hover\n\t * is the same one that is already showing, when this is set, the ID will be used instead.\n\t *\n\t * When `undefined`, this will default to a serialized version of {@link content}. In this case\n\t * it will remain `undefined` if {@link content} is a `HTMLElement`.\n\t */\n\tid?: string;\n\n\t/**\n\t * A set of actions for the hover's \"status bar\".\n\t */\n\tactions?: IHoverAction[];\n\n\t/**\n\t * An optional array of classes to add to the hover element.\n\t */\n\tadditionalClasses?: string[];\n\n\t/**\n\t * An optional link handler for markdown links, if this is not provided the IOpenerService will\n\t * be used to open the links using its default options.\n\t */\n\tlinkHandler?(url: string): void;\n\n\t/**\n\t * Whether to trap focus in the following ways:\n\t * - When the hover closes, focus goes to the element that had focus before the hover opened\n\t * - If there are elements in the hover to focus, focus stays inside of the hover when tabbing\n\t * Note that this is overridden to true when in screen reader optimized mode.\n\t */\n\ttrapFocus?: boolean;\n\n\t/**\n\t * The style of the hover, this sets default values of {@link position} and {@link appearance}:\n\t */\n\tstyle?: HoverStyle;\n\n\t/**\n\t * Options that defines where the hover is positioned.\n\t */\n\tposition?: IHoverPositionOptions;\n\n\t/**\n\t * Options that defines how long the hover is shown and when it hides.\n\t */\n\tpersistence?: IHoverPersistenceOptions;\n\n\t/**\n\t * Options that define how the hover looks.\n\t */\n\tappearance?: IHoverAppearanceOptions;\n\n\t/**\n\t * An optional callback that is called when the hover is shown. This is called\n\t * later for delayed hovers.\n\t */\n\tonDidShow?(): void;\n}\n\n// `target` is ignored for delayed hover methods as it's included in the method and added\n// automatically when the hover options get resolved.\nexport type IDelayedHoverOptions = Omit<IHoverOptions, 'target'>;\n\n// `position` is ignored for delayed at mouse hover methods as it's overwritten by the mouse event.\n// `showPointer` is always false when using mouse positioning\nexport type IDelayedHoverAtMouseOptions = Omit<IDelayedHoverOptions, 'position' | 'appearance'> & { appearance?: Omit<IHoverAppearanceOptions, 'showPointer'> };\n\nexport interface IHoverLifecycleOptions {\n\t/**\n\t * The group ID of the hover. If the group ID is the same as the currently shown hover, the\n\t * hover will be shown immediately, skipping the delay.\n\t *\n\t * @example Use a UUID to set a unique `groupId` for related hovers\n\t *\n\t * ```typescript\n\t * const groupId = generateUuid();\n\t * showDelayedHover({ content: 'Button 1', target: someElement1 }, { groupId });\n\t * showDelayedHover({ content: 'Button 2', target: someElement2 }, { groupId });\n\t * ```\n\t *\n\t * @example Use a feature-specific string to set a unqiue `groupId` for related hovers\n\t *\n\t * ```typescript\n\t * showDelayedHover({ content: 'Button 1', target: someElement1 }, { groupId: 'my-feature-items' });\n\t * showDelayedHover({ content: 'Button 2', target: someElement2 }, { groupId: 'my-feature-items' });\n\t * ```\n\t */\n\tgroupId?: string;\n\n\t/**\n\t * Whether to set up space and enter keyboard events for the hover, when these are pressed when\n\t * the hover's target is focused it will show and focus the hover.\n\t *\n\t * Typically this should _not_ be used when the space or enter events are already handled by\n\t * something else.\n\t */\n\tsetupKeyboardEvents?: boolean;\n}\n\nexport interface IHoverPositionOptions {\n\t/**\n\t * Position of the hover. The default is to show above the target. This option will be ignored\n\t * if there is not enough room to layout the hover in the specified position, unless the\n\t * forcePosition option is set.\n\t */\n\thoverPosition?: HoverPosition | MouseEvent;\n\n\t/**\n\t * Force the hover position, reducing the size of the hover instead of adjusting the hover\n\t * position.\n\t */\n\tforcePosition?: boolean;\n}\n\nexport interface IHoverPersistenceOptions {\n\t/**\n\t * Whether to hide the hover when the mouse leaves the `target` and enters the actual hover.\n\t * This is false by default when text is an `IMarkdownString` and true when `text` is a\n\t * `string`. Note that this will be ignored if any `actions` are provided as hovering is\n\t * required to make them accessible.\n\t *\n\t * In general hiding on hover is desired for:\n\t * - Regular text where selection is not important\n\t * - Markdown that contains no links where selection is not important\n\t */\n\thideOnHover?: boolean;\n\n\t/**\n\t * Whether to hide the hover when a key is pressed.\n\t */\n\thideOnKeyDown?: boolean;\n\n\t/**\n\t * Whether to make the hover sticky, this means it will not be hidden when the mouse leaves the\n\t * hover.\n\t */\n\tsticky?: boolean;\n}\n\nexport interface IHoverAppearanceOptions {\n\t/**\n\t * Whether to show the hover pointer, a little arrow that connects the target and the hover.\n\t */\n\tshowPointer?: boolean;\n\n\t/**\n\t * Whether to show a compact hover, reducing the font size and padding of the hover.\n\t */\n\tcompact?: boolean;\n\n\t/**\n\t * When {@link hideOnHover} is explicitly true or undefined and its auto value is detected to\n\t * hide, show a hint at the bottom of the hover explaining how to mouse over the widget. This\n\t * should be used in the cases where despite the hover having no interactive content, it's\n\t * likely the user may want to interact with it somehow.\n\t */\n\tshowHoverHint?: boolean;\n\n\t/**\n\t * Whether to skip the fade in animation, this should be used when hovering from one hover to\n\t * another in the same group so it looks like the hover is moving from one element to the other.\n\t */\n\tskipFadeInAnimation?: boolean;\n\n\t/**\n\t * The max height of the hover relative to the window height.\n\t * Accepted values: (0,1]\n\t * Default: 0.5\n\t */\n\tmaxHeightRatio?: number;\n}\n\nexport interface IHoverAction {\n\t/**\n\t * The label to use in the hover's status bar.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The command ID of the action, this is used to resolve the keybinding to display after the\n\t * action label.\n\t */\n\tcommandId: string;\n\n\t/**\n\t * An optional class of an icon that will be displayed before the label.\n\t */\n\ticonClass?: string;\n\n\t/**\n\t * The callback to run the action.\n\t * @param target The action element that was activated.\n\t */\n\trun(target: HTMLElement): void;\n}\n\n/**\n * A target for a hover.\n */\nexport interface IHoverTarget extends Partial<IDisposable> {\n\t/**\n\t * A set of target elements used to position the hover. If multiple elements are used the hover\n\t * will try to not overlap any target element. An example use case for this is show a hover for\n\t * wrapped text.\n\t */\n\treadonly targetElements: readonly HTMLElement[];\n\n\t/**\n\t * An optional absolute x coordinate to position the hover with, for example to position the\n\t * hover using `MouseEvent.pageX`.\n\t */\n\treadonly x?: number;\n\n\t/**\n\t * An optional absolute y coordinate to position the hover with, for example to position the\n\t * hover using `MouseEvent.pageY`.\n\t */\n\treadonly y?: number;\n}\n\n// #region Managed hover\n\nexport interface IManagedHoverTooltipMarkdownString {\n\tmarkdown: IMarkdownString | string | undefined | ((token: CancellationToken) => Promise<IMarkdownString | string | undefined>);\n\tmarkdownNotSupportedFallback: string | undefined;\n}\n\nexport function isManagedHoverTooltipMarkdownString(obj: unknown): obj is IManagedHoverTooltipMarkdownString {\n\tconst candidate = obj as IManagedHoverTooltipMarkdownString;\n\treturn typeof candidate === 'object' && 'markdown' in candidate && 'markdownNotSupportedFallback' in candidate;\n}\n\nexport interface IManagedHoverTooltipHTMLElement {\n\telement: (token: CancellationToken) => HTMLElement | Promise<HTMLElement>;\n}\n\nexport type IManagedHoverContent = string | IManagedHoverTooltipMarkdownString | IManagedHoverTooltipHTMLElement | HTMLElement | undefined;\nexport type IManagedHoverContentOrFactory = IManagedHoverContent | (() => IManagedHoverContent);\n\nexport interface IManagedHoverOptions extends Pick<IHoverOptions, 'actions' | 'linkHandler' | 'trapFocus'> {\n\tappearance?: Pick<IHoverAppearanceOptions, 'showHoverHint'>;\n}\n\nexport interface IManagedHover extends IDisposable {\n\t/**\n\t * Allows to programmatically open the hover.\n\t */\n\tshow(focus?: boolean): void;\n\n\t/**\n\t * Allows to programmatically hide the hover.\n\t */\n\thide(): void;\n\n\t/**\n\t * Updates the contents of the hover.\n\t */\n\tupdate(tooltip: IManagedHoverContent, options?: IManagedHoverOptions): void;\n}\n\n// #endregion Managed hover\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/hover/hover.ts","vs/base/browser/ui/hover/hover.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAgahG,MAAM,UAAU,mCAAmC,CAAC,GAAY;IAC/D,MAAM,SAAS,GAAG,GAAyC,CAAC;IAC5D,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,UAAU,IAAI,SAAS,IAAI,8BAA8B,IAAI,SAAS,CAAC;AAChH,CAAC;AA8BD,2BAA2B","file":"hover.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 { IHoverDelegate } from './hoverDelegate.js';\nimport { HoverPosition } from './hoverWidget.js';\nimport { CancellationToken } from '../../../common/cancellation.js';\nimport { IMarkdownString } from '../../../common/htmlContent.js';\nimport { IDisposable } from '../../../common/lifecycle.js';\n\n/**\n * Enables the convenient display of rich markdown-based hovers in the workbench.\n */\nexport interface IHoverDelegate2 {\n\t/**\n\t * Shows a hover after a delay, or immediately if the {@link groupId} matches the currently\n\t * shown hover.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Control showing the hover yourself.\n\t * - Show the hover after the standard delay.\n\t *\n\t * @param options The options of the hover.\n\t * @param groupId The group ID of the hover. If the group ID is the same as the currently shown\n\t * hover, the hover will be shown immediately, skipping the delay.\n\t */\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined;\n\n\t/**\n\t * A simple wrapper around showDelayedHover that includes listening to events on the\n\t * {@link target} element that shows the hover.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Let the hover service handle showing the hover.\n\t * - Show the hover after the standard delay.\n\t * - Want the hover positioned beside the {@link target} element.\n\t *\n\t * @param target The target element to listener for mouseover events on.\n\t * @param hoverOptions The options of the hover.\n\t * @param lifecycleOptions The options of the hover's lifecycle.\n\t */\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\thoverOptions: (() => IDelayedHoverOptions) | IDelayedHoverOptions,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable;\n\n\t/**\n\t * A simple wrapper around showDelayedHover that includes listening to events on the\n\t * {@link target} element that shows the hover. This differs from {@link setupDelayedHover} in\n\t * that the hover will be shown at the mouse position instead of the\n\t * {@link target target} element's position, ignoring any\n\t * {@link IHoverOptions.position position options} that are passed in.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Let the hover service handle showing the hover.\n\t * - Show the hover after the standard delay.\n\t * - Want the hover positioned beside the mouse.\n\t *\n\t * @param target The target element to listener for mouseover events on.\n\t * @param hoverOptions The options of the hover.\n\t * @param lifecycleOptions The options of the hover's lifecycle.\n\t */\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\thoverOptions: (() => IDelayedHoverAtMouseOptions) | IDelayedHoverAtMouseOptions,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable;\n\n\t/**\n\t * Shows a hover immediately, provided a hover with the same {@link options} object is not\n\t * already visible.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Control showing the hover yourself.\n\t * - Show the hover immediately.\n\t *\n\t * @param options A set of options defining the characteristics of the hover.\n\t * @param focus Whether to focus the hover (useful for keyboard accessibility).\n\t *\n\t * @example A simple usage with a single element target.\n\t *\n\t * ```typescript\n\t * showInstantHover({\n\t * text: new MarkdownString('Hello world'),\n\t * target: someElement\n\t * });\n\t * ```\n\t */\n\tshowInstantHover(\n\t\toptions: IHoverOptions,\n\t\tfocus?: boolean\n\t): IHoverWidget | undefined;\n\n\t/**\n\t * Hides the hover if it was visible. This call will be ignored if the hover is currently\n\t * \"locked\" via the alt/option key unless `force` is set.\n\t */\n\thideHover(force?: boolean): void;\n\n\t/**\n\t * This should only be used until we have the ability to show multiple context views\n\t * simultaneously. #188822\n\t */\n\tshowAndFocusLastHover(): void;\n\n\t/**\n\t * Sets up a managed hover for the given element. A managed hover will set up listeners for\n\t * mouse events, show the hover after a delay and provide hooks to easily update the content.\n\t *\n\t * This should be used over {@link showInstantHover} when fine-grained control is not needed. The\n\t * managed hover also does not scale well, consider using {@link showInstantHover} when showing hovers\n\t * for many elements.\n\t *\n\t * @param hoverDelegate The hover delegate containing hooks and configuration for the hover.\n\t * @param targetElement The target element to show the hover for.\n\t * @param content The content of the hover or a factory that creates it at the time it's shown.\n\t * @param options Additional options for the managed hover.\n\t *\n\t * @deprecated Use {@link setupDelayedHover} or {@link setupDelayedHoverAtMouse} instead where\n\t * possible.\n\t */\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions): IManagedHover;\n\n\t/**\n\t * Shows the hover for the given element if one has been setup.\n\t *\n\t * @param targetElement The target element of the hover, as set up in {@link setupManagedHover}.\n\t *\n\t * @deprecated Use {@link setupDelayedHover} or {@link setupDelayedHoverAtMouse} instead where\n\t * possible.\n\t */\n\tshowManagedHover(targetElement: HTMLElement): void;\n}\n\nexport interface IHoverWidget extends IDisposable {\n\t/**\n\t * Whether the hover widget has been disposed.\n\t */\n\treadonly isDisposed: boolean;\n}\n\nexport const enum HoverStyle {\n\t/**\n\t * The hover is anchored below the element with a pointer above it pointing at the target.\n\t */\n\tPointer = 1,\n\t/**\n\t * The hover is anchored to the bottom right of the cursor's location.\n\t */\n\tMouse = 2,\n}\n\nexport interface IHoverOptions {\n\t/**\n\t * The content to display in the primary section of the hover. The type of text determines the\n\t * default `hideOnHover` behavior.\n\t */\n\tcontent: IMarkdownString | string | HTMLElement;\n\n\t/**\n\t * The target for the hover. This determines the position of the hover and it will only be\n\t * hidden when the mouse leaves both the hover and the target. A HTMLElement can be used for\n\t * simple cases and a IHoverTarget for more complex cases where multiple elements and/or a\n\t * dispose method is required.\n\t */\n\ttarget: IHoverTarget | HTMLElement;\n\n\t/*\n\t * The container to pass to {@link IContextViewProvider.showContextView} which renders the hover\n\t * in. This is particularly useful for more natural tab focusing behavior, where the hover is\n\t * created as the next tab index after the element being hovered and/or to workaround the\n\t * element's container hiding on `focusout`.\n\t */\n\tcontainer?: HTMLElement;\n\n\t/**\n\t * An ID to associate with the hover to be used as an equality check. Normally when calling\n\t * {@link IHoverService.showHover} the options object itself is used to determine if the hover\n\t * is the same one that is already showing, when this is set, the ID will be used instead.\n\t *\n\t * When `undefined`, this will default to a serialized version of {@link content}. In this case\n\t * it will remain `undefined` if {@link content} is a `HTMLElement`.\n\t */\n\tid?: string;\n\n\t/**\n\t * A set of actions for the hover's \"status bar\".\n\t */\n\tactions?: IHoverAction[];\n\n\t/**\n\t * An optional array of classes to add to the hover element.\n\t */\n\tadditionalClasses?: string[];\n\n\t/**\n\t * An optional link handler for markdown links, if this is not provided the IOpenerService will\n\t * be used to open the links using its default options.\n\t */\n\tlinkHandler?(url: string): void;\n\n\t/**\n\t * Whether to trap focus in the following ways:\n\t * - When the hover closes, focus goes to the element that had focus before the hover opened\n\t * - If there are elements in the hover to focus, focus stays inside of the hover when tabbing\n\t * Note that this is overridden to true when in screen reader optimized mode.\n\t */\n\ttrapFocus?: boolean;\n\n\t/**\n\t * The style of the hover, this sets default values of {@link position} and {@link appearance}:\n\t */\n\tstyle?: HoverStyle;\n\n\t/**\n\t * Options that defines where the hover is positioned.\n\t */\n\tposition?: IHoverPositionOptions;\n\n\t/**\n\t * Options that defines how long the hover is shown and when it hides.\n\t */\n\tpersistence?: IHoverPersistenceOptions;\n\n\t/**\n\t * Options that define how the hover looks.\n\t */\n\tappearance?: IHoverAppearanceOptions;\n\n\t/**\n\t * An optional callback that is called when the hover is shown. This is called\n\t * later for delayed hovers.\n\t */\n\tonDidShow?(): void;\n}\n\n// `target` is ignored for delayed hover methods as it's included in the method and added\n// automatically when the hover options get resolved.\nexport type IDelayedHoverOptions = Omit<IHoverOptions, 'target'>;\n\n// `position` is ignored for delayed at mouse hover methods as it's overwritten by the mouse event.\n// `showPointer` is always false when using mouse positioning\nexport type IDelayedHoverAtMouseOptions = Omit<IDelayedHoverOptions, 'position' | 'appearance'> & { appearance?: Omit<IHoverAppearanceOptions, 'showPointer'> };\n\nexport interface IHoverLifecycleOptions {\n\t/**\n\t * The group ID of the hover. If the group ID is the same as the currently shown hover, the\n\t * hover will be shown immediately, skipping the delay.\n\t *\n\t * @example Use a UUID to set a unique `groupId` for related hovers\n\t *\n\t * ```typescript\n\t * const groupId = generateUuid();\n\t * showDelayedHover({ content: 'Button 1', target: someElement1 }, { groupId });\n\t * showDelayedHover({ content: 'Button 2', target: someElement2 }, { groupId });\n\t * ```\n\t *\n\t * @example Use a feature-specific string to set a unqiue `groupId` for related hovers\n\t *\n\t * ```typescript\n\t * showDelayedHover({ content: 'Button 1', target: someElement1 }, { groupId: 'my-feature-items' });\n\t * showDelayedHover({ content: 'Button 2', target: someElement2 }, { groupId: 'my-feature-items' });\n\t * ```\n\t */\n\tgroupId?: string;\n\n\t/**\n\t * Whether to use a reduced delay before showing the hover. If true, the\n\t * `workbench.hover.reducedDelay` setting is used instead of `workbench.hover.delay`.\n\t */\n\treducedDelay?: boolean;\n\n\t/**\n\t * Whether to set up space and enter keyboard events for the hover, when these are pressed when\n\t * the hover's target is focused it will show and focus the hover.\n\t *\n\t * Typically this should _not_ be used when the space or enter events are already handled by\n\t * something else.\n\t */\n\tsetupKeyboardEvents?: boolean;\n}\n\nexport interface IHoverPositionOptions {\n\t/**\n\t * Position of the hover. The default is to show above the target. This option will be ignored\n\t * if there is not enough room to layout the hover in the specified position, unless the\n\t * forcePosition option is set.\n\t */\n\thoverPosition?: HoverPosition | MouseEvent;\n\n\t/**\n\t * Force the hover position, reducing the size of the hover instead of adjusting the hover\n\t * position.\n\t */\n\tforcePosition?: boolean;\n}\n\nexport interface IHoverPersistenceOptions {\n\t/**\n\t * Whether to hide the hover when the mouse leaves the `target` and enters the actual hover.\n\t * This is false by default when text is an `IMarkdownString` and true when `text` is a\n\t * `string`. Note that this will be ignored if any `actions` are provided as hovering is\n\t * required to make them accessible.\n\t *\n\t * In general hiding on hover is desired for:\n\t * - Regular text where selection is not important\n\t * - Markdown that contains no links where selection is not important\n\t */\n\thideOnHover?: boolean;\n\n\t/**\n\t * Whether to hide the hover when a key is pressed.\n\t */\n\thideOnKeyDown?: boolean;\n\n\t/**\n\t * Whether to make the hover sticky, this means it will not be hidden when the mouse leaves the\n\t * hover.\n\t */\n\tsticky?: boolean;\n}\n\nexport interface IHoverAppearanceOptions {\n\t/**\n\t * Whether to show the hover pointer, a little arrow that connects the target and the hover.\n\t */\n\tshowPointer?: boolean;\n\n\t/**\n\t * Whether to show a compact hover, reducing the font size and padding of the hover.\n\t */\n\tcompact?: boolean;\n\n\t/**\n\t * When {@link hideOnHover} is explicitly true or undefined and its auto value is detected to\n\t * hide, show a hint at the bottom of the hover explaining how to mouse over the widget. This\n\t * should be used in the cases where despite the hover having no interactive content, it's\n\t * likely the user may want to interact with it somehow.\n\t */\n\tshowHoverHint?: boolean;\n\n\t/**\n\t * Whether to skip the fade in animation, this should be used when hovering from one hover to\n\t * another in the same group so it looks like the hover is moving from one element to the other.\n\t */\n\tskipFadeInAnimation?: boolean;\n\n\t/**\n\t * The max height of the hover relative to the window height.\n\t * Accepted values: (0,1]\n\t * Default: 0.5\n\t */\n\tmaxHeightRatio?: number;\n}\n\nexport interface IHoverAction {\n\t/**\n\t * The label to use in the hover's status bar.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The command ID of the action, this is used to resolve the keybinding to display after the\n\t * action label.\n\t */\n\tcommandId: string;\n\n\t/**\n\t * An optional class of an icon that will be displayed before the label.\n\t */\n\ticonClass?: string;\n\n\t/**\n\t * The callback to run the action.\n\t * @param target The action element that was activated.\n\t */\n\trun(target: HTMLElement): void;\n}\n\n/**\n * A target for a hover.\n */\nexport interface IHoverTarget extends Partial<IDisposable> {\n\t/**\n\t * A set of target elements used to position the hover. If multiple elements are used the hover\n\t * will try to not overlap any target element. An example use case for this is show a hover for\n\t * wrapped text.\n\t */\n\treadonly targetElements: readonly HTMLElement[];\n\n\t/**\n\t * An optional absolute x coordinate to position the hover with, for example to position the\n\t * hover using `MouseEvent.pageX`.\n\t */\n\treadonly x?: number;\n\n\t/**\n\t * An optional absolute y coordinate to position the hover with, for example to position the\n\t * hover using `MouseEvent.pageY`.\n\t */\n\treadonly y?: number;\n}\n\n// #region Managed hover\n\nexport interface IManagedHoverTooltipMarkdownString {\n\tmarkdown: IMarkdownString | string | undefined | ((token: CancellationToken) => Promise<IMarkdownString | string | undefined>);\n\tmarkdownNotSupportedFallback: string | undefined;\n}\n\nexport function isManagedHoverTooltipMarkdownString(obj: unknown): obj is IManagedHoverTooltipMarkdownString {\n\tconst candidate = obj as IManagedHoverTooltipMarkdownString;\n\treturn typeof candidate === 'object' && 'markdown' in candidate && 'markdownNotSupportedFallback' in candidate;\n}\n\nexport interface IManagedHoverTooltipHTMLElement {\n\telement: (token: CancellationToken) => HTMLElement | Promise<HTMLElement>;\n}\n\nexport type IManagedHoverContent = string | IManagedHoverTooltipMarkdownString | IManagedHoverTooltipHTMLElement | HTMLElement | undefined;\nexport type IManagedHoverContentOrFactory = IManagedHoverContent | (() => IManagedHoverContent);\n\nexport interface IManagedHoverOptions extends Pick<IHoverOptions, 'actions' | 'linkHandler' | 'trapFocus'> {\n\tappearance?: Pick<IHoverAppearanceOptions, 'showHoverHint'>;\n}\n\nexport interface IManagedHover extends IDisposable {\n\t/**\n\t * Allows to programmatically open the hover.\n\t */\n\tshow(focus?: boolean): void;\n\n\t/**\n\t * Allows to programmatically hide the hover.\n\t */\n\thide(): void;\n\n\t/**\n\t * Updates the contents of the hover.\n\t */\n\tupdate(tooltip: IManagedHoverContent, options?: IManagedHoverOptions): void;\n}\n\n// #endregion Managed hover\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 { IHoverDelegate } from './hoverDelegate.js';\nimport { HoverPosition } from './hoverWidget.js';\nimport { CancellationToken } from '../../../common/cancellation.js';\nimport { IMarkdownString } from '../../../common/htmlContent.js';\nimport { IDisposable } from '../../../common/lifecycle.js';\n\n/**\n * Enables the convenient display of rich markdown-based hovers in the workbench.\n */\nexport interface IHoverDelegate2 {\n\t/**\n\t * Shows a hover after a delay, or immediately if the {@link groupId} matches the currently\n\t * shown hover.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Control showing the hover yourself.\n\t * - Show the hover after the standard delay.\n\t *\n\t * @param options The options of the hover.\n\t * @param groupId The group ID of the hover. If the group ID is the same as the currently shown\n\t * hover, the hover will be shown immediately, skipping the delay.\n\t */\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined;\n\n\t/**\n\t * A simple wrapper around showDelayedHover that includes listening to events on the\n\t * {@link target} element that shows the hover.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Let the hover service handle showing the hover.\n\t * - Show the hover after the standard delay.\n\t * - Want the hover positioned beside the {@link target} element.\n\t *\n\t * @param target The target element to listener for mouseover events on.\n\t * @param hoverOptions The options of the hover.\n\t * @param lifecycleOptions The options of the hover's lifecycle.\n\t */\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\thoverOptions: (() => IDelayedHoverOptions) | IDelayedHoverOptions,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable;\n\n\t/**\n\t * A simple wrapper around showDelayedHover that includes listening to events on the\n\t * {@link target} element that shows the hover. This differs from {@link setupDelayedHover} in\n\t * that the hover will be shown at the mouse position instead of the\n\t * {@link target target} element's position, ignoring any\n\t * {@link IHoverOptions.position position options} that are passed in.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Let the hover service handle showing the hover.\n\t * - Show the hover after the standard delay.\n\t * - Want the hover positioned beside the mouse.\n\t *\n\t * @param target The target element to listener for mouseover events on.\n\t * @param hoverOptions The options of the hover.\n\t * @param lifecycleOptions The options of the hover's lifecycle.\n\t */\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\thoverOptions: (() => IDelayedHoverAtMouseOptions) | IDelayedHoverAtMouseOptions,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable;\n\n\t/**\n\t * Shows a hover immediately, provided a hover with the same {@link options} object is not\n\t * already visible.\n\t *\n\t * Use this method when you want to:\n\t *\n\t * - Control showing the hover yourself.\n\t * - Show the hover immediately.\n\t *\n\t * @param options A set of options defining the characteristics of the hover.\n\t * @param focus Whether to focus the hover (useful for keyboard accessibility).\n\t *\n\t * @example A simple usage with a single element target.\n\t *\n\t * ```typescript\n\t * showInstantHover({\n\t * text: new MarkdownString('Hello world'),\n\t * target: someElement\n\t * });\n\t * ```\n\t */\n\tshowInstantHover(\n\t\toptions: IHoverOptions,\n\t\tfocus?: boolean\n\t): IHoverWidget | undefined;\n\n\t/**\n\t * Hides the hover if it was visible. This call will be ignored if the hover is currently\n\t * \"locked\" via the alt/option key unless `force` is set.\n\t */\n\thideHover(force?: boolean): void;\n\n\t/**\n\t * This should only be used until we have the ability to show multiple context views\n\t * simultaneously. #188822\n\t */\n\tshowAndFocusLastHover(): void;\n\n\t/**\n\t * Sets up a managed hover for the given element. A managed hover will set up listeners for\n\t * mouse events, show the hover after a delay and provide hooks to easily update the content.\n\t *\n\t * This should be used over {@link showInstantHover} when fine-grained control is not needed. The\n\t * managed hover also does not scale well, consider using {@link showInstantHover} when showing hovers\n\t * for many elements.\n\t *\n\t * @param hoverDelegate The hover delegate containing hooks and configuration for the hover.\n\t * @param targetElement The target element to show the hover for.\n\t * @param content The content of the hover or a factory that creates it at the time it's shown.\n\t * @param options Additional options for the managed hover.\n\t *\n\t * @deprecated Use {@link setupDelayedHover} or {@link setupDelayedHoverAtMouse} instead where\n\t * possible.\n\t */\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions): IManagedHover;\n\n\t/**\n\t * Shows the hover for the given element if one has been setup.\n\t *\n\t * @param targetElement The target element of the hover, as set up in {@link setupManagedHover}.\n\t *\n\t * @deprecated Use {@link setupDelayedHover} or {@link setupDelayedHoverAtMouse} instead where\n\t * possible.\n\t */\n\tshowManagedHover(targetElement: HTMLElement): void;\n}\n\nexport interface IHoverWidget extends IDisposable {\n\t/**\n\t * Whether the hover widget has been disposed.\n\t */\n\treadonly isDisposed: boolean;\n}\n\nexport const enum HoverStyle {\n\t/**\n\t * The hover is anchored below the element with a pointer above it pointing at the target.\n\t */\n\tPointer = 1,\n\t/**\n\t * The hover is anchored to the bottom right of the cursor's location.\n\t */\n\tMouse = 2,\n}\n\nexport interface IHoverOptions {\n\t/**\n\t * The content to display in the primary section of the hover. The type of text determines the\n\t * default `hideOnHover` behavior.\n\t */\n\tcontent: IMarkdownString | string | HTMLElement;\n\n\t/**\n\t * The target for the hover. This determines the position of the hover and it will only be\n\t * hidden when the mouse leaves both the hover and the target. A HTMLElement can be used for\n\t * simple cases and a IHoverTarget for more complex cases where multiple elements and/or a\n\t * dispose method is required.\n\t */\n\ttarget: IHoverTarget | HTMLElement;\n\n\t/*\n\t * The container to pass to {@link IContextViewProvider.showContextView} which renders the hover\n\t * in. This is particularly useful for more natural tab focusing behavior, where the hover is\n\t * created as the next tab index after the element being hovered and/or to workaround the\n\t * element's container hiding on `focusout`.\n\t */\n\tcontainer?: HTMLElement;\n\n\t/**\n\t * An ID to associate with the hover to be used as an equality check. Normally when calling\n\t * {@link IHoverService.showHover} the options object itself is used to determine if the hover\n\t * is the same one that is already showing, when this is set, the ID will be used instead.\n\t *\n\t * When `undefined`, this will default to a serialized version of {@link content}. In this case\n\t * it will remain `undefined` if {@link content} is a `HTMLElement`.\n\t */\n\tid?: string;\n\n\t/**\n\t * A set of actions for the hover's \"status bar\".\n\t */\n\tactions?: IHoverAction[];\n\n\t/**\n\t * An optional array of classes to add to the hover element.\n\t */\n\tadditionalClasses?: string[];\n\n\t/**\n\t * An optional link handler for markdown links, if this is not provided the IOpenerService will\n\t * be used to open the links using its default options.\n\t */\n\tlinkHandler?(url: string): void;\n\n\t/**\n\t * Whether to trap focus in the following ways:\n\t * - When the hover closes, focus goes to the element that had focus before the hover opened\n\t * - If there are elements in the hover to focus, focus stays inside of the hover when tabbing\n\t * Note that this is overridden to true when in screen reader optimized mode.\n\t */\n\ttrapFocus?: boolean;\n\n\t/**\n\t * The style of the hover, this sets default values of {@link position} and {@link appearance}:\n\t */\n\tstyle?: HoverStyle;\n\n\t/**\n\t * Options that defines where the hover is positioned.\n\t */\n\tposition?: IHoverPositionOptions;\n\n\t/**\n\t * Options that defines how long the hover is shown and when it hides.\n\t */\n\tpersistence?: IHoverPersistenceOptions;\n\n\t/**\n\t * Options that define how the hover looks.\n\t */\n\tappearance?: IHoverAppearanceOptions;\n\n\t/**\n\t * An optional callback that is called when the hover is shown. This is called\n\t * later for delayed hovers.\n\t */\n\tonDidShow?(): void;\n}\n\n// `target` is ignored for delayed hover methods as it's included in the method and added\n// automatically when the hover options get resolved.\nexport type IDelayedHoverOptions = Omit<IHoverOptions, 'target'>;\n\n// `position` is ignored for delayed at mouse hover methods as it's overwritten by the mouse event.\n// `showPointer` is always false when using mouse positioning\nexport type IDelayedHoverAtMouseOptions = Omit<IDelayedHoverOptions, 'position' | 'appearance'> & { appearance?: Omit<IHoverAppearanceOptions, 'showPointer'> };\n\nexport interface IHoverLifecycleOptions {\n\t/**\n\t * The group ID of the hover. If the group ID is the same as the currently shown hover, the\n\t * hover will be shown immediately, skipping the delay.\n\t *\n\t * @example Use a UUID to set a unique `groupId` for related hovers\n\t *\n\t * ```typescript\n\t * const groupId = generateUuid();\n\t * showDelayedHover({ content: 'Button 1', target: someElement1 }, { groupId });\n\t * showDelayedHover({ content: 'Button 2', target: someElement2 }, { groupId });\n\t * ```\n\t *\n\t * @example Use a feature-specific string to set a unqiue `groupId` for related hovers\n\t *\n\t * ```typescript\n\t * showDelayedHover({ content: 'Button 1', target: someElement1 }, { groupId: 'my-feature-items' });\n\t * showDelayedHover({ content: 'Button 2', target: someElement2 }, { groupId: 'my-feature-items' });\n\t * ```\n\t */\n\tgroupId?: string;\n\n\t/**\n\t * Whether to use a reduced delay before showing the hover. If true, the\n\t * `workbench.hover.reducedDelay` setting is used instead of `workbench.hover.delay`.\n\t */\n\treducedDelay?: boolean;\n\n\t/**\n\t * Whether to set up space and enter keyboard events for the hover, when these are pressed when\n\t * the hover's target is focused it will show and focus the hover.\n\t *\n\t * Typically this should _not_ be used when the space or enter events are already handled by\n\t * something else.\n\t */\n\tsetupKeyboardEvents?: boolean;\n}\n\nexport interface IHoverPositionOptions {\n\t/**\n\t * Position of the hover. The default is to show above the target. This option will be ignored\n\t * if there is not enough room to layout the hover in the specified position, unless the\n\t * forcePosition option is set.\n\t */\n\thoverPosition?: HoverPosition | MouseEvent;\n\n\t/**\n\t * Force the hover position, reducing the size of the hover instead of adjusting the hover\n\t * position.\n\t */\n\tforcePosition?: boolean;\n}\n\nexport interface IHoverPersistenceOptions {\n\t/**\n\t * Whether to hide the hover when the mouse leaves the `target` and enters the actual hover.\n\t * This is false by default when text is an `IMarkdownString` and true when `text` is a\n\t * `string`. Note that this will be ignored if any `actions` are provided as hovering is\n\t * required to make them accessible.\n\t *\n\t * In general hiding on hover is desired for:\n\t * - Regular text where selection is not important\n\t * - Markdown that contains no links where selection is not important\n\t */\n\thideOnHover?: boolean;\n\n\t/**\n\t * Whether to hide the hover when a key is pressed.\n\t */\n\thideOnKeyDown?: boolean;\n\n\t/**\n\t * Whether to make the hover sticky, this means it will not be hidden when the mouse leaves the\n\t * hover.\n\t */\n\tsticky?: boolean;\n}\n\nexport interface IHoverAppearanceOptions {\n\t/**\n\t * Whether to show the hover pointer, a little arrow that connects the target and the hover.\n\t */\n\tshowPointer?: boolean;\n\n\t/**\n\t * Whether to show a compact hover, reducing the font size and padding of the hover.\n\t */\n\tcompact?: boolean;\n\n\t/**\n\t * When {@link hideOnHover} is explicitly true or undefined and its auto value is detected to\n\t * hide, show a hint at the bottom of the hover explaining how to mouse over the widget. This\n\t * should be used in the cases where despite the hover having no interactive content, it's\n\t * likely the user may want to interact with it somehow.\n\t */\n\tshowHoverHint?: boolean;\n\n\t/**\n\t * Whether to skip the fade in animation, this should be used when hovering from one hover to\n\t * another in the same group so it looks like the hover is moving from one element to the other.\n\t */\n\tskipFadeInAnimation?: boolean;\n\n\t/**\n\t * The max height of the hover relative to the window height.\n\t * Accepted values: (0,1]\n\t * Default: 0.5\n\t */\n\tmaxHeightRatio?: number;\n}\n\nexport interface IHoverAction {\n\t/**\n\t * The label to use in the hover's status bar.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The command ID of the action, this is used to resolve the keybinding to display after the\n\t * action label.\n\t */\n\tcommandId: string;\n\n\t/**\n\t * An optional class of an icon that will be displayed before the label.\n\t */\n\ticonClass?: string;\n\n\t/**\n\t * The callback to run the action.\n\t * @param target The action element that was activated.\n\t */\n\trun(target: HTMLElement): void;\n}\n\n/**\n * A target for a hover.\n */\nexport interface IHoverTarget extends Partial<IDisposable> {\n\t/**\n\t * A set of target elements used to position the hover. If multiple elements are used the hover\n\t * will try to not overlap any target element. An example use case for this is show a hover for\n\t * wrapped text.\n\t */\n\treadonly targetElements: readonly HTMLElement[];\n\n\t/**\n\t * An optional absolute x coordinate to position the hover with, for example to position the\n\t * hover using `MouseEvent.pageX`.\n\t */\n\treadonly x?: number;\n\n\t/**\n\t * An optional absolute y coordinate to position the hover with, for example to position the\n\t * hover using `MouseEvent.pageY`.\n\t */\n\treadonly y?: number;\n}\n\n// #region Managed hover\n\nexport interface IManagedHoverTooltipMarkdownString {\n\tmarkdown: IMarkdownString | string | undefined | ((token: CancellationToken) => Promise<IMarkdownString | string | undefined>);\n\tmarkdownNotSupportedFallback: string | undefined;\n}\n\nexport function isManagedHoverTooltipMarkdownString(obj: unknown): obj is IManagedHoverTooltipMarkdownString {\n\tconst candidate = obj as IManagedHoverTooltipMarkdownString;\n\treturn typeof candidate === 'object' && 'markdown' in candidate && 'markdownNotSupportedFallback' in candidate;\n}\n\nexport interface IManagedHoverTooltipHTMLElement {\n\telement: (token: CancellationToken) => HTMLElement | Promise<HTMLElement>;\n}\n\nexport type IManagedHoverContent = string | IManagedHoverTooltipMarkdownString | IManagedHoverTooltipHTMLElement | HTMLElement | undefined;\nexport type IManagedHoverContentOrFactory = IManagedHoverContent | (() => IManagedHoverContent);\n\nexport interface IManagedHoverOptions extends Pick<IHoverOptions, 'actions' | 'linkHandler' | 'trapFocus'> {\n\tappearance?: Pick<IHoverAppearanceOptions, 'showHoverHint'>;\n}\n\nexport interface IManagedHover extends IDisposable {\n\t/**\n\t * Allows to programmatically open the hover.\n\t */\n\tshow(focus?: boolean): void;\n\n\t/**\n\t * Allows to programmatically hide the hover.\n\t */\n\thide(): void;\n\n\t/**\n\t * Updates the contents of the hover.\n\t */\n\tupdate(tooltip: IManagedHoverContent, options?: IManagedHoverOptions): void;\n}\n\n// #endregion Managed hover\n"]}
|
|
@@ -137,7 +137,10 @@ let HoverService = class HoverService extends Disposable {
|
|
|
137
137
|
this._currentDelayedHover = hover.hover;
|
|
138
138
|
this._currentDelayedHoverWasShown = false;
|
|
139
139
|
this._currentDelayedHoverGroupId = lifecycleOptions?.groupId;
|
|
140
|
-
|
|
140
|
+
const delay = lifecycleOptions?.reducedDelay
|
|
141
|
+
? this._configurationService.getValue('workbench.hover.reducedDelay')
|
|
142
|
+
: this._configurationService.getValue('workbench.hover.delay');
|
|
143
|
+
timeout(delay).then(() => {
|
|
141
144
|
if (hover.hover && !hover.hover.isDisposed) {
|
|
142
145
|
this._currentDelayedHoverWasShown = true;
|
|
143
146
|
this._showHover(hover, options);
|
|
@@ -169,7 +172,8 @@ let HoverService = class HoverService extends Disposable {
|
|
|
169
172
|
const store = new DisposableStore();
|
|
170
173
|
store.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {
|
|
171
174
|
this.showDelayedHover(resolveHoverOptions(e), {
|
|
172
|
-
groupId: lifecycleOptions?.groupId
|
|
175
|
+
groupId: lifecycleOptions?.groupId,
|
|
176
|
+
reducedDelay: lifecycleOptions?.reducedDelay,
|
|
173
177
|
});
|
|
174
178
|
}));
|
|
175
179
|
if (lifecycleOptions?.setupKeyboardEvents) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/hover/browser/hoverService.ts","vs/platform/hover/browser/hoverService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,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4DAA4D,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClH,CAAC;AACF,CAAC,CAAC,CAAC","file":"hoverService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { ContextView, ContextViewDOMPosition, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { HoverStyle, isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverTarget, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\n/**\n * Maximum nesting depth for hovers. This prevents runaway nesting.\n */\nconst MAX_HOVER_NESTING_DEPTH = 3;\n\n/**\n * An entry in the hover stack, representing a single hover and its associated state.\n */\ninterface IHoverStackEntry {\n\treadonly hover: HoverWidget;\n\treadonly options: IHoverOptions;\n\treadonly contextView: ContextView;\n\treadonly lastFocusedElementBeforeOpen: HTMLElement | undefined;\n}\n\n/**\n * Result of creating a hover, containing the hover widget and associated state.\n */\ninterface ICreateHoverResult {\n\treadonly hover: HoverWidget;\n\treadonly store: DisposableStore;\n\treadonly lastFocusedElementBeforeOpen: HTMLElement | undefined;\n}\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\t/**\n\t * Stack of currently visible hovers. The last entry is the topmost hover.\n\t * This enables nested hovers where hovering inside a hover can show another hover.\n\t */\n\tprivate readonly _hoverStack: IHoverStackEntry[] = [];\n\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\t/**\n\t * Gets the current (topmost) hover from the stack, if any.\n\t */\n\tprivate get _currentHover(): HoverWidget | undefined {\n\t\treturn this._hoverStack.at(-1)?.hover;\n\t}\n\n\t/**\n\t * Gets the current (topmost) hover options from the stack, if any.\n\t */\n\tprivate get _currentHoverOptions(): IHoverOptions | undefined {\n\t\treturn this._hoverStack.at(-1)?.options;\n\t}\n\n\t/**\n\t * Returns whether the target element is inside any of the hovers in the stack.\n\t * If it is, returns the index of the containing hover, otherwise returns -1.\n\t */\n\tprivate _getContainingHoverIndex(target: HTMLElement | IHoverTarget): number {\n\t\tconst targetElements = isHTMLElement(target) ? [target] : target.targetElements;\n\t\t// Search from top of stack to bottom (most recent hover first)\n\t\tfor (let i = this._hoverStack.length - 1; i >= 0; i--) {\n\t\t\tfor (const targetElement of targetElements) {\n\t\t\t\tif (isAncestor(targetElement, this._hoverStack[i].hover.domNode)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover.hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover.hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover.hover && !hover.hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover.hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => {\n\t\t\tconst resolved: IHoverOptions = {\n\t\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\t\ttarget\n\t\t\t};\n\t\t\tif (resolved.style === HoverStyle.Mouse && e) {\n\t\t\t\tresolved.target = resolveMouseStyleHoverTarget(target, e);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t};\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: e ? resolveMouseStyleHoverTarget(target, e) : target\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): ICreateHoverResult | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\t// Check if the target is inside an existing hover (nesting scenario)\n\t\tconst containingHoverIndex = this._getContainingHoverIndex(options.target);\n\t\tconst isNesting = containingHoverIndex >= 0;\n\n\t\tif (isNesting) {\n\t\t\t// Check max nesting depth\n\t\t\tif (this._hoverStack.length >= MAX_HOVER_NESTING_DEPTH) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t// When nesting, don't check if the parent is locked - we allow nested hovers inside locked parents\n\t\t} else {\n\t\t\t// Not nesting: check if current top-level hover is locked\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Check if identity is the same as current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\tlet lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tlastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\t// Pop this hover from the stack if it's still there\n\t\t\tconst stackIndex = this._hoverStack.findIndex(entry => entry.hover === hover);\n\t\t\tif (stackIndex >= 0) {\n\t\t\t\tconst entry = this._hoverStack[stackIndex];\n\t\t\t\t// Restore focus if this hover was focused\n\t\t\t\tconst hoverWasFocused = isAncestorOfActiveElement(hover.domNode);\n\t\t\t\tif (hoverWasFocused && entry.lastFocusedElementBeforeOpen) {\n\t\t\t\t\tentry.lastFocusedElementBeforeOpen.focus();\n\t\t\t\t}\n\t\t\t\t// Also dispose all nested hovers (hovers at higher indices in the stack)\n\t\t\t\t// Dispose from end to avoid index shifting issues\n\t\t\t\twhile (this._hoverStack.length > stackIndex + 1) {\n\t\t\t\t\tconst nestedEntry = this._hoverStack.pop()!;\n\t\t\t\t\tnestedEntry.contextView.dispose();\n\t\t\t\t\tnestedEntry.hover.dispose();\n\t\t\t\t}\n\t\t\t\t// Remove this hover from stack and dispose its context view\n\t\t\t\tthis._hoverStack.splice(stackIndex, 1);\n\t\t\t\tentry.contextView.dispose();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis._hideHoverAndDescendants(hover);\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this._hideHoverAndDescendants(hover)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this._hideHoverAndDescendants(hover)));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\treturn { hover, lastFocusedElementBeforeOpen, store: hoverDisposables };\n\t}\n\n\tprivate _showHover(result: ICreateHoverResult, options: IHoverOptions, focus?: boolean) {\n\t\tconst { hover, lastFocusedElementBeforeOpen, store } = result;\n\n\t\t// Check if the target is inside an existing hover (nesting scenario)\n\t\tconst containingHoverIndex = this._getContainingHoverIndex(options.target);\n\t\tconst isNesting = containingHoverIndex >= 0;\n\n\t\t// If not nesting, close all existing hovers first\n\t\tif (!isNesting) {\n\t\t\tthis._hideAllHovers();\n\t\t} else {\n\t\t\t// When nesting, close any sibling hovers (hovers at the same level or deeper\n\t\t\t// than the containing hover). This ensures hovers within the same container\n\t\t\t// are exclusive.\n\t\t\tfor (let i = this._hoverStack.length - 1; i > containingHoverIndex; i--) {\n\t\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t\t}\n\t\t\tthis._hoverStack.length = containingHoverIndex + 1;\n\t\t}\n\n\t\t// When nesting, add the new hover's container to all parent hovers' mouse trackers.\n\t\t// This makes the parent hovers treat the nested hover as part of themselves,\n\t\t// so they won't close when the mouse moves into the nested hover.\n\t\tif (isNesting) {\n\t\t\tfor (let i = 0; i <= containingHoverIndex; i++) {\n\t\t\t\tstore.add(this._hoverStack[i].hover.addMouseTrackingElement(hover.domNode));\n\t\t\t}\n\t\t}\n\n\t\t// Create a new ContextView for this hover with higher z-index for nested hovers\n\t\tconst container = options.container ?? this._layoutService.getContainer(getWindow(isHTMLElement(options.target) ? options.target : options.target.targetElements[0]));\n\t\tconst contextView = new ContextView(container, ContextViewDOMPosition.ABSOLUTE);\n\n\t\t// Push to stack\n\t\tconst stackEntry: IHoverStackEntry = {\n\t\t\thover,\n\t\t\toptions,\n\t\t\tcontextView,\n\t\t\tlastFocusedElementBeforeOpen\n\t\t};\n\t\tthis._hoverStack.push(stackEntry);\n\n\t\t// Show the hover in its context view\n\t\tconst delegate = new HoverContextViewDelegate(hover, focus, this._hoverStack.length);\n\t\tcontextView.show(delegate);\n\n\t\t// Set up layout handling\n\t\tstore.add(hover.onRequestLayout(() => contextView.layout()));\n\n\t\toptions.onDidShow?.();\n\t}\n\n\t/**\n\t * Hides a specific hover and all hovers nested inside it.\n\t */\n\tprivate _hideHoverAndDescendants(hover: HoverWidget): void {\n\t\tconst stackIndex = this._hoverStack.findIndex(entry => entry.hover === hover);\n\t\tif (stackIndex < 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Dispose all hovers from this index onwards (including nested ones)\n\t\tfor (let i = this._hoverStack.length - 1; i >= stackIndex; i--) {\n\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t}\n\t\tthis._hoverStack.length = stackIndex;\n\t}\n\n\t/**\n\t * Hides all hovers in the stack.\n\t */\n\tprivate _hideAllHovers(): void {\n\t\tfor (let i = this._hoverStack.length - 1; i >= 0; i--) {\n\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t}\n\t\tthis._hoverStack.length = 0;\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif (this._hoverStack.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If not forcing and the topmost hover is locked, don't hide\n\t\tif (!force && this._currentHover?.isLocked) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide only the topmost hover (pop from stack)\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\t// Pop and dispose the topmost hover\n\t\tconst length = this._hoverStack.length;\n\t\tthis._hoverStack[length - 1]?.hover.dispose();\n\t\tthis._hoverStack.length = length - 1;\n\n\t\t// After popping a nested hover, unlock the parent if it was locked due to nesting\n\t\t// (Note: the parent may have been explicitly locked via sticky, so we only unlock\n\t\t// if there are remaining hovers and they're not sticky)\n\t\t// For simplicity, we don't auto-unlock here - the parent remains in its current lock state\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\t// Lock all hovers in the stack when Alt is pressed\n\t\t\tfor (const entry of this._hoverStack) {\n\t\t\t\tentry.hover.isLocked = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\t// Find the entry for this hover to get its lastFocusedElementBeforeOpen\n\t\t\tconst stackEntry = this._hoverStack.find(entry => entry.hover === hover);\n\t\t\tthis._hideHoverAndDescendants(hover);\n\t\t\tstackEntry?.lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\t// Unlock all hovers in the stack when Alt is released\n\t\t\tfor (const entry of this._hoverStack) {\n\t\t\t\t// Only unlock if not sticky\n\t\t\t\tif (!entry.options.persistence?.sticky) {\n\t\t\t\t\tentry.hover.isLocked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Hide all hovers if the mouse is not over any of them\n\t\t\tconst anyMouseIn = this._hoverStack.some(entry => entry.hover.isMouseIn);\n\t\t\tif (!anyMouseIn) {\n\t\t\t\tconst topEntry = this._hoverStack[this._hoverStack.length - 1];\n\t\t\t\tthis._hideAllHovers();\n\t\t\t\ttopEntry?.lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views, with higher layers for nested hovers\n\tpublic readonly layer: number;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false,\n\t\tstackDepth: number = 1\n\t) {\n\t\t// Base layer is 1, nested hovers get higher layers\n\t\tthis.layer = stackDepth;\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nfunction resolveMouseStyleHoverTarget(target: HTMLElement, e: MouseEvent): IHoverTarget {\n\treturn {\n\t\ttargetElements: [target],\n\t\tx: e.x + 10\n\t};\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { ContextView, ContextViewDOMPosition, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { HoverStyle, isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverTarget, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\n/**\n * Maximum nesting depth for hovers. This prevents runaway nesting.\n */\nconst MAX_HOVER_NESTING_DEPTH = 3;\n\n/**\n * An entry in the hover stack, representing a single hover and its associated state.\n */\ninterface IHoverStackEntry {\n\treadonly hover: HoverWidget;\n\treadonly options: IHoverOptions;\n\treadonly contextView: ContextView;\n\treadonly lastFocusedElementBeforeOpen: HTMLElement | undefined;\n}\n\n/**\n * Result of creating a hover, containing the hover widget and associated state.\n */\ninterface ICreateHoverResult {\n\treadonly hover: HoverWidget;\n\treadonly store: DisposableStore;\n\treadonly lastFocusedElementBeforeOpen: HTMLElement | undefined;\n}\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\t/**\n\t * Stack of currently visible hovers. The last entry is the topmost hover.\n\t * This enables nested hovers where hovering inside a hover can show another hover.\n\t */\n\tprivate readonly _hoverStack: IHoverStackEntry[] = [];\n\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\t/**\n\t * Gets the current (topmost) hover from the stack, if any.\n\t */\n\tprivate get _currentHover(): HoverWidget | undefined {\n\t\treturn this._hoverStack.at(-1)?.hover;\n\t}\n\n\t/**\n\t * Gets the current (topmost) hover options from the stack, if any.\n\t */\n\tprivate get _currentHoverOptions(): IHoverOptions | undefined {\n\t\treturn this._hoverStack.at(-1)?.options;\n\t}\n\n\t/**\n\t * Returns whether the target element is inside any of the hovers in the stack.\n\t * If it is, returns the index of the containing hover, otherwise returns -1.\n\t */\n\tprivate _getContainingHoverIndex(target: HTMLElement | IHoverTarget): number {\n\t\tconst targetElements = isHTMLElement(target) ? [target] : target.targetElements;\n\t\t// Search from top of stack to bottom (most recent hover first)\n\t\tfor (let i = this._hoverStack.length - 1; i >= 0; i--) {\n\t\t\tfor (const targetElement of targetElements) {\n\t\t\t\tif (isAncestor(targetElement, this._hoverStack[i].hover.domNode)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover.hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover.hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover.hover && !hover.hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover.hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => {\n\t\t\tconst resolved: IHoverOptions = {\n\t\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\t\ttarget\n\t\t\t};\n\t\t\tif (resolved.style === HoverStyle.Mouse && e) {\n\t\t\t\tresolved.target = resolveMouseStyleHoverTarget(target, e);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t};\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: e ? resolveMouseStyleHoverTarget(target, e) : target\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): ICreateHoverResult | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\t// Check if the target is inside an existing hover (nesting scenario)\n\t\tconst containingHoverIndex = this._getContainingHoverIndex(options.target);\n\t\tconst isNesting = containingHoverIndex >= 0;\n\n\t\tif (isNesting) {\n\t\t\t// Check max nesting depth\n\t\t\tif (this._hoverStack.length >= MAX_HOVER_NESTING_DEPTH) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t// When nesting, don't check if the parent is locked - we allow nested hovers inside locked parents\n\t\t} else {\n\t\t\t// Not nesting: check if current top-level hover is locked\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Check if identity is the same as current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\tlet lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tlastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\t// Pop this hover from the stack if it's still there\n\t\t\tconst stackIndex = this._hoverStack.findIndex(entry => entry.hover === hover);\n\t\t\tif (stackIndex >= 0) {\n\t\t\t\tconst entry = this._hoverStack[stackIndex];\n\t\t\t\t// Restore focus if this hover was focused\n\t\t\t\tconst hoverWasFocused = isAncestorOfActiveElement(hover.domNode);\n\t\t\t\tif (hoverWasFocused && entry.lastFocusedElementBeforeOpen) {\n\t\t\t\t\tentry.lastFocusedElementBeforeOpen.focus();\n\t\t\t\t}\n\t\t\t\t// Also dispose all nested hovers (hovers at higher indices in the stack)\n\t\t\t\t// Dispose from end to avoid index shifting issues\n\t\t\t\twhile (this._hoverStack.length > stackIndex + 1) {\n\t\t\t\t\tconst nestedEntry = this._hoverStack.pop()!;\n\t\t\t\t\tnestedEntry.contextView.dispose();\n\t\t\t\t\tnestedEntry.hover.dispose();\n\t\t\t\t}\n\t\t\t\t// Remove this hover from stack and dispose its context view\n\t\t\t\tthis._hoverStack.splice(stackIndex, 1);\n\t\t\t\tentry.contextView.dispose();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis._hideHoverAndDescendants(hover);\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this._hideHoverAndDescendants(hover)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this._hideHoverAndDescendants(hover)));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\treturn { hover, lastFocusedElementBeforeOpen, store: hoverDisposables };\n\t}\n\n\tprivate _showHover(result: ICreateHoverResult, options: IHoverOptions, focus?: boolean) {\n\t\tconst { hover, lastFocusedElementBeforeOpen, store } = result;\n\n\t\t// Check if the target is inside an existing hover (nesting scenario)\n\t\tconst containingHoverIndex = this._getContainingHoverIndex(options.target);\n\t\tconst isNesting = containingHoverIndex >= 0;\n\n\t\t// If not nesting, close all existing hovers first\n\t\tif (!isNesting) {\n\t\t\tthis._hideAllHovers();\n\t\t} else {\n\t\t\t// When nesting, close any sibling hovers (hovers at the same level or deeper\n\t\t\t// than the containing hover). This ensures hovers within the same container\n\t\t\t// are exclusive.\n\t\t\tfor (let i = this._hoverStack.length - 1; i > containingHoverIndex; i--) {\n\t\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t\t}\n\t\t\tthis._hoverStack.length = containingHoverIndex + 1;\n\t\t}\n\n\t\t// When nesting, add the new hover's container to all parent hovers' mouse trackers.\n\t\t// This makes the parent hovers treat the nested hover as part of themselves,\n\t\t// so they won't close when the mouse moves into the nested hover.\n\t\tif (isNesting) {\n\t\t\tfor (let i = 0; i <= containingHoverIndex; i++) {\n\t\t\t\tstore.add(this._hoverStack[i].hover.addMouseTrackingElement(hover.domNode));\n\t\t\t}\n\t\t}\n\n\t\t// Create a new ContextView for this hover with higher z-index for nested hovers\n\t\tconst container = options.container ?? this._layoutService.getContainer(getWindow(isHTMLElement(options.target) ? options.target : options.target.targetElements[0]));\n\t\tconst contextView = new ContextView(container, ContextViewDOMPosition.ABSOLUTE);\n\n\t\t// Push to stack\n\t\tconst stackEntry: IHoverStackEntry = {\n\t\t\thover,\n\t\t\toptions,\n\t\t\tcontextView,\n\t\t\tlastFocusedElementBeforeOpen\n\t\t};\n\t\tthis._hoverStack.push(stackEntry);\n\n\t\t// Show the hover in its context view\n\t\tconst delegate = new HoverContextViewDelegate(hover, focus, this._hoverStack.length);\n\t\tcontextView.show(delegate);\n\n\t\t// Set up layout handling\n\t\tstore.add(hover.onRequestLayout(() => contextView.layout()));\n\n\t\toptions.onDidShow?.();\n\t}\n\n\t/**\n\t * Hides a specific hover and all hovers nested inside it.\n\t */\n\tprivate _hideHoverAndDescendants(hover: HoverWidget): void {\n\t\tconst stackIndex = this._hoverStack.findIndex(entry => entry.hover === hover);\n\t\tif (stackIndex < 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Dispose all hovers from this index onwards (including nested ones)\n\t\tfor (let i = this._hoverStack.length - 1; i >= stackIndex; i--) {\n\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t}\n\t\tthis._hoverStack.length = stackIndex;\n\t}\n\n\t/**\n\t * Hides all hovers in the stack.\n\t */\n\tprivate _hideAllHovers(): void {\n\t\tfor (let i = this._hoverStack.length - 1; i >= 0; i--) {\n\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t}\n\t\tthis._hoverStack.length = 0;\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif (this._hoverStack.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If not forcing and the topmost hover is locked, don't hide\n\t\tif (!force && this._currentHover?.isLocked) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide only the topmost hover (pop from stack)\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\t// Pop and dispose the topmost hover\n\t\tconst length = this._hoverStack.length;\n\t\tthis._hoverStack[length - 1]?.hover.dispose();\n\t\tthis._hoverStack.length = length - 1;\n\n\t\t// After popping a nested hover, unlock the parent if it was locked due to nesting\n\t\t// (Note: the parent may have been explicitly locked via sticky, so we only unlock\n\t\t// if there are remaining hovers and they're not sticky)\n\t\t// For simplicity, we don't auto-unlock here - the parent remains in its current lock state\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\t// Lock all hovers in the stack when Alt is pressed\n\t\t\tfor (const entry of this._hoverStack) {\n\t\t\t\tentry.hover.isLocked = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\t// Find the entry for this hover to get its lastFocusedElementBeforeOpen\n\t\t\tconst stackEntry = this._hoverStack.find(entry => entry.hover === hover);\n\t\t\tthis._hideHoverAndDescendants(hover);\n\t\t\tstackEntry?.lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\t// Unlock all hovers in the stack when Alt is released\n\t\t\tfor (const entry of this._hoverStack) {\n\t\t\t\t// Only unlock if not sticky\n\t\t\t\tif (!entry.options.persistence?.sticky) {\n\t\t\t\t\tentry.hover.isLocked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Hide all hovers if the mouse is not over any of them\n\t\t\tconst anyMouseIn = this._hoverStack.some(entry => entry.hover.isMouseIn);\n\t\t\tif (!anyMouseIn) {\n\t\t\t\tconst topEntry = this._hoverStack[this._hoverStack.length - 1];\n\t\t\t\tthis._hideAllHovers();\n\t\t\t\ttopEntry?.lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views, with higher layers for nested hovers\n\tpublic readonly layer: number;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false,\n\t\tstackDepth: number = 1\n\t) {\n\t\t// Base layer is 1, nested hovers get higher layers\n\t\tthis.layer = stackDepth;\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nfunction resolveMouseStyleHoverTarget(target: HTMLElement, e: MouseEvent): IHoverTarget {\n\treturn {\n\t\ttargetElements: [target],\n\t\tx: e.x + 10\n\t};\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/hover/browser/hoverService.ts","vs/platform/hover/browser/hoverService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,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Y,oCAA4B,CAAC;AAE1E,0BAA0B,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;IAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACtD,IAAI,WAAW,EAAE,CAAC;QACjB,SAAS,CAAC,OAAO,CAAC,kGAAkG,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvJ,SAAS,CAAC,OAAO,CAAC,4DAA4D,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClH,CAAC;AACF,CAAC,CAAC,CAAC","file":"hoverService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { ContextView, ContextViewDOMPosition, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { HoverStyle, isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverTarget, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\n/**\n * Maximum nesting depth for hovers. This prevents runaway nesting.\n */\nconst MAX_HOVER_NESTING_DEPTH = 3;\n\n/**\n * An entry in the hover stack, representing a single hover and its associated state.\n */\ninterface IHoverStackEntry {\n\treadonly hover: HoverWidget;\n\treadonly options: IHoverOptions;\n\treadonly contextView: ContextView;\n\treadonly lastFocusedElementBeforeOpen: HTMLElement | undefined;\n}\n\n/**\n * Result of creating a hover, containing the hover widget and associated state.\n */\ninterface ICreateHoverResult {\n\treadonly hover: HoverWidget;\n\treadonly store: DisposableStore;\n\treadonly lastFocusedElementBeforeOpen: HTMLElement | undefined;\n}\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\t/**\n\t * Stack of currently visible hovers. The last entry is the topmost hover.\n\t * This enables nested hovers where hovering inside a hover can show another hover.\n\t */\n\tprivate readonly _hoverStack: IHoverStackEntry[] = [];\n\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\t/**\n\t * Gets the current (topmost) hover from the stack, if any.\n\t */\n\tprivate get _currentHover(): HoverWidget | undefined {\n\t\treturn this._hoverStack.at(-1)?.hover;\n\t}\n\n\t/**\n\t * Gets the current (topmost) hover options from the stack, if any.\n\t */\n\tprivate get _currentHoverOptions(): IHoverOptions | undefined {\n\t\treturn this._hoverStack.at(-1)?.options;\n\t}\n\n\t/**\n\t * Returns whether the target element is inside any of the hovers in the stack.\n\t * If it is, returns the index of the containing hover, otherwise returns -1.\n\t */\n\tprivate _getContainingHoverIndex(target: HTMLElement | IHoverTarget): number {\n\t\tconst targetElements = isHTMLElement(target) ? [target] : target.targetElements;\n\t\t// Search from top of stack to bottom (most recent hover first)\n\t\tfor (let i = this._hoverStack.length - 1; i >= 0; i--) {\n\t\t\tfor (const targetElement of targetElements) {\n\t\t\t\tif (isAncestor(targetElement, this._hoverStack[i].hover.domNode)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover.hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId' | 'reducedDelay'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover.hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\tconst delay = lifecycleOptions?.reducedDelay\n\t\t\t? this._configurationService.getValue<number>('workbench.hover.reducedDelay')\n\t\t\t: this._configurationService.getValue<number>('workbench.hover.delay');\n\t\ttimeout(delay).then(() => {\n\t\t\tif (hover.hover && !hover.hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover.hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => {\n\t\t\tconst resolved: IHoverOptions = {\n\t\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\t\ttarget\n\t\t\t};\n\t\t\tif (resolved.style === HoverStyle.Mouse && e) {\n\t\t\t\tresolved.target = resolveMouseStyleHoverTarget(target, e);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t};\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: e ? resolveMouseStyleHoverTarget(target, e) : target\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId,\n\t\t\t\treducedDelay: lifecycleOptions?.reducedDelay,\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): ICreateHoverResult | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\t// Check if the target is inside an existing hover (nesting scenario)\n\t\tconst containingHoverIndex = this._getContainingHoverIndex(options.target);\n\t\tconst isNesting = containingHoverIndex >= 0;\n\n\t\tif (isNesting) {\n\t\t\t// Check max nesting depth\n\t\t\tif (this._hoverStack.length >= MAX_HOVER_NESTING_DEPTH) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t// When nesting, don't check if the parent is locked - we allow nested hovers inside locked parents\n\t\t} else {\n\t\t\t// Not nesting: check if current top-level hover is locked\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Check if identity is the same as current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\tlet lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tlastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\t// Pop this hover from the stack if it's still there\n\t\t\tconst stackIndex = this._hoverStack.findIndex(entry => entry.hover === hover);\n\t\t\tif (stackIndex >= 0) {\n\t\t\t\tconst entry = this._hoverStack[stackIndex];\n\t\t\t\t// Restore focus if this hover was focused\n\t\t\t\tconst hoverWasFocused = isAncestorOfActiveElement(hover.domNode);\n\t\t\t\tif (hoverWasFocused && entry.lastFocusedElementBeforeOpen) {\n\t\t\t\t\tentry.lastFocusedElementBeforeOpen.focus();\n\t\t\t\t}\n\t\t\t\t// Also dispose all nested hovers (hovers at higher indices in the stack)\n\t\t\t\t// Dispose from end to avoid index shifting issues\n\t\t\t\twhile (this._hoverStack.length > stackIndex + 1) {\n\t\t\t\t\tconst nestedEntry = this._hoverStack.pop()!;\n\t\t\t\t\tnestedEntry.contextView.dispose();\n\t\t\t\t\tnestedEntry.hover.dispose();\n\t\t\t\t}\n\t\t\t\t// Remove this hover from stack and dispose its context view\n\t\t\t\tthis._hoverStack.splice(stackIndex, 1);\n\t\t\t\tentry.contextView.dispose();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis._hideHoverAndDescendants(hover);\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this._hideHoverAndDescendants(hover)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this._hideHoverAndDescendants(hover)));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\treturn { hover, lastFocusedElementBeforeOpen, store: hoverDisposables };\n\t}\n\n\tprivate _showHover(result: ICreateHoverResult, options: IHoverOptions, focus?: boolean) {\n\t\tconst { hover, lastFocusedElementBeforeOpen, store } = result;\n\n\t\t// Check if the target is inside an existing hover (nesting scenario)\n\t\tconst containingHoverIndex = this._getContainingHoverIndex(options.target);\n\t\tconst isNesting = containingHoverIndex >= 0;\n\n\t\t// If not nesting, close all existing hovers first\n\t\tif (!isNesting) {\n\t\t\tthis._hideAllHovers();\n\t\t} else {\n\t\t\t// When nesting, close any sibling hovers (hovers at the same level or deeper\n\t\t\t// than the containing hover). This ensures hovers within the same container\n\t\t\t// are exclusive.\n\t\t\tfor (let i = this._hoverStack.length - 1; i > containingHoverIndex; i--) {\n\t\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t\t}\n\t\t\tthis._hoverStack.length = containingHoverIndex + 1;\n\t\t}\n\n\t\t// When nesting, add the new hover's container to all parent hovers' mouse trackers.\n\t\t// This makes the parent hovers treat the nested hover as part of themselves,\n\t\t// so they won't close when the mouse moves into the nested hover.\n\t\tif (isNesting) {\n\t\t\tfor (let i = 0; i <= containingHoverIndex; i++) {\n\t\t\t\tstore.add(this._hoverStack[i].hover.addMouseTrackingElement(hover.domNode));\n\t\t\t}\n\t\t}\n\n\t\t// Create a new ContextView for this hover with higher z-index for nested hovers\n\t\tconst container = options.container ?? this._layoutService.getContainer(getWindow(isHTMLElement(options.target) ? options.target : options.target.targetElements[0]));\n\t\tconst contextView = new ContextView(container, ContextViewDOMPosition.ABSOLUTE);\n\n\t\t// Push to stack\n\t\tconst stackEntry: IHoverStackEntry = {\n\t\t\thover,\n\t\t\toptions,\n\t\t\tcontextView,\n\t\t\tlastFocusedElementBeforeOpen\n\t\t};\n\t\tthis._hoverStack.push(stackEntry);\n\n\t\t// Show the hover in its context view\n\t\tconst delegate = new HoverContextViewDelegate(hover, focus, this._hoverStack.length);\n\t\tcontextView.show(delegate);\n\n\t\t// Set up layout handling\n\t\tstore.add(hover.onRequestLayout(() => contextView.layout()));\n\n\t\toptions.onDidShow?.();\n\t}\n\n\t/**\n\t * Hides a specific hover and all hovers nested inside it.\n\t */\n\tprivate _hideHoverAndDescendants(hover: HoverWidget): void {\n\t\tconst stackIndex = this._hoverStack.findIndex(entry => entry.hover === hover);\n\t\tif (stackIndex < 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Dispose all hovers from this index onwards (including nested ones)\n\t\tfor (let i = this._hoverStack.length - 1; i >= stackIndex; i--) {\n\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t}\n\t\tthis._hoverStack.length = stackIndex;\n\t}\n\n\t/**\n\t * Hides all hovers in the stack.\n\t */\n\tprivate _hideAllHovers(): void {\n\t\tfor (let i = this._hoverStack.length - 1; i >= 0; i--) {\n\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t}\n\t\tthis._hoverStack.length = 0;\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif (this._hoverStack.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If not forcing and the topmost hover is locked, don't hide\n\t\tif (!force && this._currentHover?.isLocked) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide only the topmost hover (pop from stack)\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\t// Pop and dispose the topmost hover\n\t\tconst length = this._hoverStack.length;\n\t\tthis._hoverStack[length - 1]?.hover.dispose();\n\t\tthis._hoverStack.length = length - 1;\n\n\t\t// After popping a nested hover, unlock the parent if it was locked due to nesting\n\t\t// (Note: the parent may have been explicitly locked via sticky, so we only unlock\n\t\t// if there are remaining hovers and they're not sticky)\n\t\t// For simplicity, we don't auto-unlock here - the parent remains in its current lock state\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\t// Lock all hovers in the stack when Alt is pressed\n\t\t\tfor (const entry of this._hoverStack) {\n\t\t\t\tentry.hover.isLocked = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\t// Find the entry for this hover to get its lastFocusedElementBeforeOpen\n\t\t\tconst stackEntry = this._hoverStack.find(entry => entry.hover === hover);\n\t\t\tthis._hideHoverAndDescendants(hover);\n\t\t\tstackEntry?.lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\t// Unlock all hovers in the stack when Alt is released\n\t\t\tfor (const entry of this._hoverStack) {\n\t\t\t\t// Only unlock if not sticky\n\t\t\t\tif (!entry.options.persistence?.sticky) {\n\t\t\t\t\tentry.hover.isLocked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Hide all hovers if the mouse is not over any of them\n\t\t\tconst anyMouseIn = this._hoverStack.some(entry => entry.hover.isMouseIn);\n\t\t\tif (!anyMouseIn) {\n\t\t\t\tconst topEntry = this._hoverStack[this._hoverStack.length - 1];\n\t\t\t\tthis._hideAllHovers();\n\t\t\t\ttopEntry?.lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views, with higher layers for nested hovers\n\tpublic readonly layer: number;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false,\n\t\tstackDepth: number = 1\n\t) {\n\t\t// Base layer is 1, nested hovers get higher layers\n\t\tthis.layer = stackDepth;\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nfunction resolveMouseStyleHoverTarget(target: HTMLElement, e: MouseEvent): IHoverTarget {\n\treturn {\n\t\ttargetElements: [target],\n\t\tx: e.x + 10\n\t};\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { ContextView, ContextViewDOMPosition, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { HoverStyle, isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverTarget, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\n/**\n * Maximum nesting depth for hovers. This prevents runaway nesting.\n */\nconst MAX_HOVER_NESTING_DEPTH = 3;\n\n/**\n * An entry in the hover stack, representing a single hover and its associated state.\n */\ninterface IHoverStackEntry {\n\treadonly hover: HoverWidget;\n\treadonly options: IHoverOptions;\n\treadonly contextView: ContextView;\n\treadonly lastFocusedElementBeforeOpen: HTMLElement | undefined;\n}\n\n/**\n * Result of creating a hover, containing the hover widget and associated state.\n */\ninterface ICreateHoverResult {\n\treadonly hover: HoverWidget;\n\treadonly store: DisposableStore;\n\treadonly lastFocusedElementBeforeOpen: HTMLElement | undefined;\n}\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\t/**\n\t * Stack of currently visible hovers. The last entry is the topmost hover.\n\t * This enables nested hovers where hovering inside a hover can show another hover.\n\t */\n\tprivate readonly _hoverStack: IHoverStackEntry[] = [];\n\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\t/**\n\t * Gets the current (topmost) hover from the stack, if any.\n\t */\n\tprivate get _currentHover(): HoverWidget | undefined {\n\t\treturn this._hoverStack.at(-1)?.hover;\n\t}\n\n\t/**\n\t * Gets the current (topmost) hover options from the stack, if any.\n\t */\n\tprivate get _currentHoverOptions(): IHoverOptions | undefined {\n\t\treturn this._hoverStack.at(-1)?.options;\n\t}\n\n\t/**\n\t * Returns whether the target element is inside any of the hovers in the stack.\n\t * If it is, returns the index of the containing hover, otherwise returns -1.\n\t */\n\tprivate _getContainingHoverIndex(target: HTMLElement | IHoverTarget): number {\n\t\tconst targetElements = isHTMLElement(target) ? [target] : target.targetElements;\n\t\t// Search from top of stack to bottom (most recent hover first)\n\t\tfor (let i = this._hoverStack.length - 1; i >= 0; i--) {\n\t\t\tfor (const targetElement of targetElements) {\n\t\t\t\tif (isAncestor(targetElement, this._hoverStack[i].hover.domNode)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover.hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId' | 'reducedDelay'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover.hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\tconst delay = lifecycleOptions?.reducedDelay\n\t\t\t? this._configurationService.getValue<number>('workbench.hover.reducedDelay')\n\t\t\t: this._configurationService.getValue<number>('workbench.hover.delay');\n\t\ttimeout(delay).then(() => {\n\t\t\tif (hover.hover && !hover.hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover.hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => {\n\t\t\tconst resolved: IHoverOptions = {\n\t\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\t\ttarget\n\t\t\t};\n\t\t\tif (resolved.style === HoverStyle.Mouse && e) {\n\t\t\t\tresolved.target = resolveMouseStyleHoverTarget(target, e);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t};\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: e ? resolveMouseStyleHoverTarget(target, e) : target\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId,\n\t\t\t\treducedDelay: lifecycleOptions?.reducedDelay,\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): ICreateHoverResult | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\t// Check if the target is inside an existing hover (nesting scenario)\n\t\tconst containingHoverIndex = this._getContainingHoverIndex(options.target);\n\t\tconst isNesting = containingHoverIndex >= 0;\n\n\t\tif (isNesting) {\n\t\t\t// Check max nesting depth\n\t\t\tif (this._hoverStack.length >= MAX_HOVER_NESTING_DEPTH) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t// When nesting, don't check if the parent is locked - we allow nested hovers inside locked parents\n\t\t} else {\n\t\t\t// Not nesting: check if current top-level hover is locked\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Check if identity is the same as current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\tlet lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tlastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\t// Pop this hover from the stack if it's still there\n\t\t\tconst stackIndex = this._hoverStack.findIndex(entry => entry.hover === hover);\n\t\t\tif (stackIndex >= 0) {\n\t\t\t\tconst entry = this._hoverStack[stackIndex];\n\t\t\t\t// Restore focus if this hover was focused\n\t\t\t\tconst hoverWasFocused = isAncestorOfActiveElement(hover.domNode);\n\t\t\t\tif (hoverWasFocused && entry.lastFocusedElementBeforeOpen) {\n\t\t\t\t\tentry.lastFocusedElementBeforeOpen.focus();\n\t\t\t\t}\n\t\t\t\t// Also dispose all nested hovers (hovers at higher indices in the stack)\n\t\t\t\t// Dispose from end to avoid index shifting issues\n\t\t\t\twhile (this._hoverStack.length > stackIndex + 1) {\n\t\t\t\t\tconst nestedEntry = this._hoverStack.pop()!;\n\t\t\t\t\tnestedEntry.contextView.dispose();\n\t\t\t\t\tnestedEntry.hover.dispose();\n\t\t\t\t}\n\t\t\t\t// Remove this hover from stack and dispose its context view\n\t\t\t\tthis._hoverStack.splice(stackIndex, 1);\n\t\t\t\tentry.contextView.dispose();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis._hideHoverAndDescendants(hover);\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this._hideHoverAndDescendants(hover)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this._hideHoverAndDescendants(hover)));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\treturn { hover, lastFocusedElementBeforeOpen, store: hoverDisposables };\n\t}\n\n\tprivate _showHover(result: ICreateHoverResult, options: IHoverOptions, focus?: boolean) {\n\t\tconst { hover, lastFocusedElementBeforeOpen, store } = result;\n\n\t\t// Check if the target is inside an existing hover (nesting scenario)\n\t\tconst containingHoverIndex = this._getContainingHoverIndex(options.target);\n\t\tconst isNesting = containingHoverIndex >= 0;\n\n\t\t// If not nesting, close all existing hovers first\n\t\tif (!isNesting) {\n\t\t\tthis._hideAllHovers();\n\t\t} else {\n\t\t\t// When nesting, close any sibling hovers (hovers at the same level or deeper\n\t\t\t// than the containing hover). This ensures hovers within the same container\n\t\t\t// are exclusive.\n\t\t\tfor (let i = this._hoverStack.length - 1; i > containingHoverIndex; i--) {\n\t\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t\t}\n\t\t\tthis._hoverStack.length = containingHoverIndex + 1;\n\t\t}\n\n\t\t// When nesting, add the new hover's container to all parent hovers' mouse trackers.\n\t\t// This makes the parent hovers treat the nested hover as part of themselves,\n\t\t// so they won't close when the mouse moves into the nested hover.\n\t\tif (isNesting) {\n\t\t\tfor (let i = 0; i <= containingHoverIndex; i++) {\n\t\t\t\tstore.add(this._hoverStack[i].hover.addMouseTrackingElement(hover.domNode));\n\t\t\t}\n\t\t}\n\n\t\t// Create a new ContextView for this hover with higher z-index for nested hovers\n\t\tconst container = options.container ?? this._layoutService.getContainer(getWindow(isHTMLElement(options.target) ? options.target : options.target.targetElements[0]));\n\t\tconst contextView = new ContextView(container, ContextViewDOMPosition.ABSOLUTE);\n\n\t\t// Push to stack\n\t\tconst stackEntry: IHoverStackEntry = {\n\t\t\thover,\n\t\t\toptions,\n\t\t\tcontextView,\n\t\t\tlastFocusedElementBeforeOpen\n\t\t};\n\t\tthis._hoverStack.push(stackEntry);\n\n\t\t// Show the hover in its context view\n\t\tconst delegate = new HoverContextViewDelegate(hover, focus, this._hoverStack.length);\n\t\tcontextView.show(delegate);\n\n\t\t// Set up layout handling\n\t\tstore.add(hover.onRequestLayout(() => contextView.layout()));\n\n\t\toptions.onDidShow?.();\n\t}\n\n\t/**\n\t * Hides a specific hover and all hovers nested inside it.\n\t */\n\tprivate _hideHoverAndDescendants(hover: HoverWidget): void {\n\t\tconst stackIndex = this._hoverStack.findIndex(entry => entry.hover === hover);\n\t\tif (stackIndex < 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Dispose all hovers from this index onwards (including nested ones)\n\t\tfor (let i = this._hoverStack.length - 1; i >= stackIndex; i--) {\n\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t}\n\t\tthis._hoverStack.length = stackIndex;\n\t}\n\n\t/**\n\t * Hides all hovers in the stack.\n\t */\n\tprivate _hideAllHovers(): void {\n\t\tfor (let i = this._hoverStack.length - 1; i >= 0; i--) {\n\t\t\tthis._hoverStack[i].hover.dispose();\n\t\t}\n\t\tthis._hoverStack.length = 0;\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif (this._hoverStack.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If not forcing and the topmost hover is locked, don't hide\n\t\tif (!force && this._currentHover?.isLocked) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide only the topmost hover (pop from stack)\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\t// Pop and dispose the topmost hover\n\t\tconst length = this._hoverStack.length;\n\t\tthis._hoverStack[length - 1]?.hover.dispose();\n\t\tthis._hoverStack.length = length - 1;\n\n\t\t// After popping a nested hover, unlock the parent if it was locked due to nesting\n\t\t// (Note: the parent may have been explicitly locked via sticky, so we only unlock\n\t\t// if there are remaining hovers and they're not sticky)\n\t\t// For simplicity, we don't auto-unlock here - the parent remains in its current lock state\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\t// Lock all hovers in the stack when Alt is pressed\n\t\t\tfor (const entry of this._hoverStack) {\n\t\t\t\tentry.hover.isLocked = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\t// Find the entry for this hover to get its lastFocusedElementBeforeOpen\n\t\t\tconst stackEntry = this._hoverStack.find(entry => entry.hover === hover);\n\t\t\tthis._hideHoverAndDescendants(hover);\n\t\t\tstackEntry?.lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\t// Unlock all hovers in the stack when Alt is released\n\t\t\tfor (const entry of this._hoverStack) {\n\t\t\t\t// Only unlock if not sticky\n\t\t\t\tif (!entry.options.persistence?.sticky) {\n\t\t\t\t\tentry.hover.isLocked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Hide all hovers if the mouse is not over any of them\n\t\t\tconst anyMouseIn = this._hoverStack.some(entry => entry.hover.isMouseIn);\n\t\t\tif (!anyMouseIn) {\n\t\t\t\tconst topEntry = this._hoverStack[this._hoverStack.length - 1];\n\t\t\t\tthis._hideAllHovers();\n\t\t\t\ttopEntry?.lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views, with higher layers for nested hovers\n\tpublic readonly layer: number;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false,\n\t\tstackDepth: number = 1\n\t) {\n\t\t// Base layer is 1, nested hovers get higher layers\n\t\tthis.layer = stackDepth;\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nfunction resolveMouseStyleHoverTarget(target: HTMLElement, e: MouseEvent): IHoverTarget {\n\treturn {\n\t\ttargetElements: [target],\n\t\tx: e.x + 10\n\t};\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n"]}
|
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-
|
|
4
|
+
"version": "0.56.0-dev-20260128",
|
|
5
5
|
"description": "A browser based code editor",
|
|
6
6
|
"author": "Microsoft Corporation",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/microsoft/vscode/issues"
|
|
16
16
|
},
|
|
17
|
-
"vscodeCommitId": "
|
|
17
|
+
"vscodeCommitId": "928f9319006064c35f462edc4a83a374393beb84",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"marked": "14.0.0",
|
|
20
20
|
"dompurify": "3.2.7"
|