monaco-editor-core 0.55.0-dev-20251030 → 0.55.0-dev-20251101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +15 -13
  18. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  19. package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -5
  20. package/esm/vs/base/browser/ui/toolbar/toolbar.js +4 -25
  21. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  22. package/esm/vs/base/common/observableInternal/observables/derived.js.map +1 -1
  23. package/esm/vs/editor/common/tokens/sparseMultilineTokens.js +4 -0
  24. package/esm/vs/editor/common/tokens/sparseMultilineTokens.js.map +1 -1
  25. package/esm/vs/editor/common/tokens/sparseTokensStore.js +7 -1
  26. package/esm/vs/editor/common/tokens/sparseTokensStore.js.map +1 -1
  27. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.css +2 -1
  28. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +1 -1
  29. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
  30. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +10 -7
  31. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  32. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +74 -70
  33. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
  34. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  35. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  36. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  37. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  38. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  39. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  40. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  41. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  42. package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
  43. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
  44. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
  45. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  46. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  47. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  48. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  49. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  50. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  51. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  52. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  53. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  54. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  55. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  56. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
  57. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  58. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  59. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  60. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  61. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  62. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  63. package/esm/vs/platform/actions/common/actions.js +3 -1
  64. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  65. package/esm/vs/platform/actions/common/menuService.js +2 -2
  66. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  67. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  68. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  69. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  70. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  71. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  72. package/esm/vs/platform/hover/browser/hoverService.js +9 -3
  73. package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
  74. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  75. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  76. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  77. package/esm/vs/platform/list/browser/listService.js +27 -27
  78. package/esm/vs/platform/markers/common/markerService.js +2 -2
  79. package/esm/vs/platform/markers/common/markers.js +6 -6
  80. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +7 -7
  81. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  82. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  83. package/esm/vs/platform/quickinput/browser/quickInputActions.js +6 -6
  84. package/esm/vs/platform/quickinput/browser/quickInputActions.js.map +1 -1
  85. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  86. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  87. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  88. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  89. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  90. package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
  91. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  92. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  93. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  94. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  95. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  96. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  97. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  98. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  99. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  100. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  101. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  102. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  103. package/package.json +2 -2
@@ -32,7 +32,7 @@ class ConfigurationRegistry extends Disposable {
32
32
  this.configurationDefaultsOverrides = new Map();
33
33
  this.defaultLanguageConfigurationOverridesNode = {
34
34
  id: 'defaultOverrides',
35
- title: nls.localize(1661, "Default Language Configuration Overrides"),
35
+ title: nls.localize(1662, "Default Language Configuration Overrides"),
36
36
  properties: {}
37
37
  };
38
38
  this.configurationContributors = [this.defaultLanguageConfigurationOverridesNode];
@@ -113,7 +113,7 @@ class ConfigurationRegistry extends Disposable {
113
113
  },
114
114
  type: 'object',
115
115
  default: newDefaultOverride.value,
116
- description: nls.localize(1662, "Configure settings to be overridden for {0}.", getLanguageTagSettingPlainKey(key)),
116
+ description: nls.localize(1663, "Configure settings to be overridden for {0}.", getLanguageTagSettingPlainKey(key)),
117
117
  $ref: resourceLanguageSettingsSchemaId,
118
118
  defaultDefaultValue: newDefaultOverride.value,
119
119
  source,
@@ -320,8 +320,8 @@ class ConfigurationRegistry extends Disposable {
320
320
  const overrideIdentifierProperty = `[${overrideIdentifier}]`;
321
321
  const resourceLanguagePropertiesSchema = {
322
322
  type: 'object',
323
- description: nls.localize(1663, "Configure editor settings to be overridden for a language."),
324
- errorMessage: nls.localize(1664, "This setting does not support per-language configuration."),
323
+ description: nls.localize(1664, "Configure editor settings to be overridden for a language."),
324
+ errorMessage: nls.localize(1665, "This setting does not support per-language configuration."),
325
325
  $ref: resourceLanguageSettingsSchemaId,
326
326
  };
327
327
  this.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema);
@@ -337,8 +337,8 @@ class ConfigurationRegistry extends Disposable {
337
337
  registerOverridePropertyPatternKey() {
338
338
  const resourceLanguagePropertiesSchema = {
339
339
  type: 'object',
340
- description: nls.localize(1665, "Configure editor settings to be overridden for a language."),
341
- errorMessage: nls.localize(1666, "This setting does not support per-language configuration."),
340
+ description: nls.localize(1666, "Configure editor settings to be overridden for a language."),
341
+ errorMessage: nls.localize(1667, "This setting does not support per-language configuration."),
342
342
  $ref: resourceLanguageSettingsSchemaId,
343
343
  };
344
344
  allSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;
@@ -411,16 +411,16 @@ const configurationRegistry = new ConfigurationRegistry();
411
411
  Registry.add(Extensions.Configuration, configurationRegistry);
412
412
  export function validateProperty(property, schema) {
413
413
  if (!property.trim()) {
414
- return nls.localize(1667, "Cannot register an empty property");
414
+ return nls.localize(1668, "Cannot register an empty property");
415
415
  }
416
416
  if (OVERRIDE_PROPERTY_REGEX.test(property)) {
417
- return nls.localize(1668, "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.", property);
417
+ return nls.localize(1669, "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.", property);
418
418
  }
419
419
  if (configurationRegistry.getConfigurationProperties()[property] !== undefined) {
420
- return nls.localize(1669, "Cannot register '{0}'. This property is already registered.", property);
420
+ return nls.localize(1670, "Cannot register '{0}'. This property is already registered.", property);
421
421
  }
422
422
  if (schema.policy?.name && configurationRegistry.getPolicyConfigurations().get(schema.policy?.name) !== undefined) {
423
- return nls.localize(1670, "Cannot register '{0}'. The associated policy {1} is already registered with {2}.", property, schema.policy?.name, configurationRegistry.getPolicyConfigurations().get(schema.policy?.name));
423
+ return nls.localize(1671, "Cannot register '{0}'. The associated policy {1} is already registered with {2}.", property, schema.policy?.name, configurationRegistry.getPolicyConfigurations().get(schema.policy?.name));
424
424
  }
425
425
  return null;
426
426
  }
@@ -448,7 +448,7 @@ CommandsRegistry.registerCommand({
448
448
  return [...RawContextKey.all()].sort((a, b) => a.key.localeCompare(b.key));
449
449
  },
450
450
  metadata: {
451
- description: localize(1671, "A command that returns information about context keys"),
451
+ description: localize(1672, "A command that returns information about context keys"),
452
452
  args: []
453
453
  }
454
454
  });
@@ -23,14 +23,14 @@ const hasOwnProperty = Object.prototype.hasOwnProperty;
23
23
  const defaultConfig = {
24
24
  regexParsingWithErrorRecovery: true
25
25
  };
26
- const errorEmptyString = localize(1672, "Empty context key expression");
27
- const hintEmptyString = localize(1673, "Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.");
28
- const errorNoInAfterNot = localize(1674, "'in' after 'not'.");
29
- const errorClosingParenthesis = localize(1675, "closing parenthesis ')'");
30
- const errorUnexpectedToken = localize(1676, "Unexpected token");
31
- const hintUnexpectedToken = localize(1677, "Did you forget to put && or || before the token?");
32
- const errorUnexpectedEOF = localize(1678, "Unexpected end of expression");
33
- const hintUnexpectedEOF = localize(1679, "Did you forget to put a context key?");
26
+ const errorEmptyString = localize(1673, "Empty context key expression");
27
+ const hintEmptyString = localize(1674, "Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.");
28
+ const errorNoInAfterNot = localize(1675, "'in' after 'not'.");
29
+ const errorClosingParenthesis = localize(1676, "closing parenthesis ')'");
30
+ const errorUnexpectedToken = localize(1677, "Unexpected token");
31
+ const hintUnexpectedToken = localize(1678, "Did you forget to put && or || before the token?");
32
+ const errorUnexpectedEOF = localize(1679, "Unexpected end of expression");
33
+ const hintUnexpectedEOF = localize(1680, "Did you forget to put a context key?");
34
34
  /**
35
35
  * A parser for context key expressions.
36
36
  *
@@ -375,7 +375,7 @@ export class Parser {
375
375
  throw this._errExpectedButGot(message, this._peek());
376
376
  }
377
377
  _errExpectedButGot(expected, got, additionalInfo) {
378
- const message = localize(1680, "Expected: {0}\nReceived: '{1}'.", expected, Scanner.getLexeme(got));
378
+ const message = localize(1681, "Expected: {0}\nReceived: '{1}'.", expected, Scanner.getLexeme(got));
379
379
  const offset = got.offset;
380
380
  const lexeme = Scanner.getLexeme(got);
381
381
  this._parsingErrors.push({ message, offset, lexeme, additionalInfo });
@@ -5,15 +5,15 @@
5
5
  import { isIOS, isLinux, isMacintosh, isMobile, isWeb, isWindows } from '../../../base/common/platform.js';
6
6
  import { localize } from '../../../nls.js';
7
7
  import { RawContextKey } from './contextkey.js';
8
- export const IsMacContext = new RawContextKey('isMac', isMacintosh, localize(1681, "Whether the operating system is macOS"));
9
- export const IsLinuxContext = new RawContextKey('isLinux', isLinux, localize(1682, "Whether the operating system is Linux"));
10
- export const IsWindowsContext = new RawContextKey('isWindows', isWindows, localize(1683, "Whether the operating system is Windows"));
11
- export const IsWebContext = new RawContextKey('isWeb', isWeb, localize(1684, "Whether the platform is a web browser"));
12
- export const IsMacNativeContext = new RawContextKey('isMacNative', isMacintosh && !isWeb, localize(1685, "Whether the operating system is macOS on a non-browser platform"));
13
- export const IsIOSContext = new RawContextKey('isIOS', isIOS, localize(1686, "Whether the operating system is iOS"));
14
- export const IsMobileContext = new RawContextKey('isMobile', isMobile, localize(1687, "Whether the platform is a mobile web browser"));
8
+ export const IsMacContext = new RawContextKey('isMac', isMacintosh, localize(1682, "Whether the operating system is macOS"));
9
+ export const IsLinuxContext = new RawContextKey('isLinux', isLinux, localize(1683, "Whether the operating system is Linux"));
10
+ export const IsWindowsContext = new RawContextKey('isWindows', isWindows, localize(1684, "Whether the operating system is Windows"));
11
+ export const IsWebContext = new RawContextKey('isWeb', isWeb, localize(1685, "Whether the platform is a web browser"));
12
+ export const IsMacNativeContext = new RawContextKey('isMacNative', isMacintosh && !isWeb, localize(1686, "Whether the operating system is macOS on a non-browser platform"));
13
+ export const IsIOSContext = new RawContextKey('isIOS', isIOS, localize(1687, "Whether the operating system is iOS"));
14
+ export const IsMobileContext = new RawContextKey('isMobile', isMobile, localize(1688, "Whether the platform is a mobile web browser"));
15
15
  export const IsDevelopmentContext = new RawContextKey('isDevelopment', false, true);
16
- export const ProductQualityContext = new RawContextKey('productQualityType', '', localize(1688, "Quality type of VS Code"));
16
+ export const ProductQualityContext = new RawContextKey('productQualityType', '', localize(1689, "Quality type of VS Code"));
17
17
  export const InputFocusedContextKey = 'inputFocus';
18
- export const InputFocusedContext = new RawContextKey(InputFocusedContextKey, false, localize(1689, "Whether keyboard focus is inside an input box"));
18
+ export const InputFocusedContext = new RawContextKey(InputFocusedContextKey, false, localize(1690, "Whether keyboard focus is inside an input box"));
19
19
  //# sourceMappingURL=contextkeys.js.map
@@ -7,17 +7,17 @@ import { localize } from '../../../nls.js';
7
7
  function hintDidYouMean(...meant) {
8
8
  switch (meant.length) {
9
9
  case 1:
10
- return localize(1690, "Did you mean {0}?", meant[0]);
10
+ return localize(1691, "Did you mean {0}?", meant[0]);
11
11
  case 2:
12
- return localize(1691, "Did you mean {0} or {1}?", meant[0], meant[1]);
12
+ return localize(1692, "Did you mean {0} or {1}?", meant[0], meant[1]);
13
13
  case 3:
14
- return localize(1692, "Did you mean {0}, {1} or {2}?", meant[0], meant[1], meant[2]);
14
+ return localize(1693, "Did you mean {0}, {1} or {2}?", meant[0], meant[1], meant[2]);
15
15
  default: // we just don't expect that many
16
16
  return undefined;
17
17
  }
18
18
  }
19
- const hintDidYouForgetToOpenOrCloseQuote = localize(1693, "Did you forget to open or close the quote?");
20
- const hintDidYouForgetToEscapeSlash = localize(1694, "Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/\'.");
19
+ const hintDidYouForgetToOpenOrCloseQuote = localize(1694, "Did you forget to open or close the quote?");
20
+ const hintDidYouForgetToEscapeSlash = localize(1695, "Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/\'.");
21
21
  /**
22
22
  * A simple scanner for context keys.
23
23
  *
@@ -18,7 +18,7 @@ import { KeybindingsRegistry } from '../../keybinding/common/keybindingsRegistry
18
18
  import { localize } from '../../../nls.js';
19
19
  import { DisposableStore, toDisposable } from '../../../base/common/lifecycle.js';
20
20
  import { isActiveElement } from '../../../base/browser/dom.js';
21
- export const historyNavigationVisible = new RawContextKey('suggestWidgetVisible', false, localize(1695, "Whether suggestion are visible"));
21
+ export const historyNavigationVisible = new RawContextKey('suggestWidgetVisible', false, localize(1696, "Whether suggestion are visible"));
22
22
  const HistoryNavigationWidgetFocusContext = 'historyNavigationWidgetFocus';
23
23
  const HistoryNavigationForwardsEnablementContext = 'historyNavigationForwardsEnabled';
24
24
  const HistoryNavigationBackwardsEnablementContext = 'historyNavigationBackwardsEnabled';
@@ -366,22 +366,25 @@ let HoverService = class HoverService extends Disposable {
366
366
  // track the mouse position
367
367
  const onMouseMove = (e) => {
368
368
  target.x = e.x + 10;
369
- if ((isHTMLElement(e.target)) && getHoverTargetElement(e.target, targetElement) !== targetElement) {
369
+ if (!eventIsRelatedToTarget(e, targetElement)) {
370
370
  hideHover(true, true);
371
371
  }
372
372
  };
373
373
  mouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));
374
374
  }
375
375
  hoverPreparation = mouseOverStore;
376
- if ((isHTMLElement(e.target)) && getHoverTargetElement(e.target, targetElement) !== targetElement) {
376
+ if (!eventIsRelatedToTarget(e, targetElement)) {
377
377
  return; // Do not show hover when the mouse is over another hover target
378
378
  }
379
379
  mouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));
380
380
  }, true));
381
- const onFocus = () => {
381
+ const onFocus = (e) => {
382
382
  if (isMouseDown || hoverPreparation) {
383
383
  return;
384
384
  }
385
+ if (!eventIsRelatedToTarget(e, targetElement)) {
386
+ return; // Do not show hover when the focus is on another hover target
387
+ }
385
388
  const target = {
386
389
  targetElements: [targetElement],
387
390
  dispose: () => { }
@@ -507,6 +510,9 @@ class HoverContextViewDelegate {
507
510
  this._hover.layout();
508
511
  }
509
512
  }
513
+ function eventIsRelatedToTarget(event, target) {
514
+ return isHTMLElement(event.target) && getHoverTargetElement(event.target, target) === target;
515
+ }
510
516
  function getHoverTargetElement(element, stopElement) {
511
517
  stopElement = stopElement ?? getWindow(element).document.body;
512
518
  while (!element.hasAttribute('custom-hover') && element !== stopElement) {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/hover/browser/hoverService.ts","vs/platform/hover/browser/hoverService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,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W,GAAG,WAAW,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9D,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QACzE,OAAO,GAAG,OAAO,CAAC,aAAc,CAAC;IAClC,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,iBAAiB,CAAC,aAAa,EAAE,YAAY,oCAA4B,CAAC;AAE1E,0BAA0B,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;IAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACtD,IAAI,WAAW,EAAE,CAAC;QACjB,SAAS,CAAC,OAAO,CAAC,kGAAkG,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvJ,SAAS,CAAC,OAAO,CAAC,4DAA4D,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClH,CAAC;AACF,CAAC,CAAC,CAAC","file":"hoverService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif ((isHTMLElement(e.target)) && getHoverTargetElement(e.target, targetElement) !== targetElement) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif ((isHTMLElement(e.target)) && getHoverTargetElement(e.target as HTMLElement, targetElement) !== targetElement) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = () => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif ((isHTMLElement(e.target)) && getHoverTargetElement(e.target, targetElement) !== targetElement) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif ((isHTMLElement(e.target)) && getHoverTargetElement(e.target as HTMLElement, targetElement) !== targetElement) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = () => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/hover/browser/hoverService.ts","vs/platform/hover/browser/hoverService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtL,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAE,mCAAmC,EAAyJ,MAAM,yCAA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,CAAC,kGAAkG,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvJ,SAAS,CAAC,OAAO,CAAC,4DAA4D,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClH,CAAC;AACF,CAAC,CAAC,CAAC","file":"hoverService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target as HTMLElement, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target as HTMLElement, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n"]}
@@ -197,7 +197,7 @@ let HoverWidget = class HoverWidget extends Widget {
197
197
  if (options.appearance?.showHoverHint) {
198
198
  const statusBarElement = $('div.hover-row.status-bar');
199
199
  const infoElement = $('div.info');
200
- infoElement.textContent = localize(1696, 'Hold {0} key to mouse over', isMacintosh ? 'Option' : 'Alt');
200
+ infoElement.textContent = localize(1697, 'Hold {0} key to mouse over', isMacintosh ? 'Option' : 'Alt');
201
201
  statusBarElement.appendChild(infoElement);
202
202
  this._hover.containerDomNode.appendChild(statusBarElement);
203
203
  }
@@ -47,7 +47,7 @@ export class ManagedHoverWidget {
47
47
  if (managedContent instanceof Promise) {
48
48
  // show 'Loading' if no hover is up yet
49
49
  if (!this._hoverWidget) {
50
- this.show(localize(1697, "Loading..."), focus, options);
50
+ this.show(localize(1698, "Loading..."), focus, options);
51
51
  }
52
52
  resolvedContent = await managedContent;
53
53
  }
@@ -95,11 +95,11 @@ export class AbstractKeybindingService extends Disposable {
95
95
  throw illegalState('impossible');
96
96
  case 1:
97
97
  // TODO@ulugbekna: revise this message and the one below (at least, fix terminology)
98
- this._currentChordStatusMessage = this._notificationService.status(nls.localize(1698, "({0}) was pressed. Waiting for second key of chord...", keypressLabel));
98
+ this._currentChordStatusMessage = this._notificationService.status(nls.localize(1699, "({0}) was pressed. Waiting for second key of chord...", keypressLabel));
99
99
  break;
100
100
  default: {
101
101
  const fullKeypressLabel = this._currentChords.map(({ label }) => label).join(', ');
102
- this._currentChordStatusMessage = this._notificationService.status(nls.localize(1699, "({0}) was pressed. Waiting for next key of chord...", fullKeypressLabel));
102
+ this._currentChordStatusMessage = this._notificationService.status(nls.localize(1700, "({0}) was pressed. Waiting for next key of chord...", fullKeypressLabel));
103
103
  }
104
104
  }
105
105
  this._scheduleLeaveChordMode();
@@ -198,7 +198,7 @@ export class AbstractKeybindingService extends Disposable {
198
198
  if (this.inChordMode) {
199
199
  const currentChordsLabel = this._currentChords.map(({ label }) => label).join(', ');
200
200
  this._log(`+ Leaving multi-chord mode: Nothing bound to "${currentChordsLabel}, ${keypressLabel}".`);
201
- this._notificationService.status(nls.localize(1700, "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });
201
+ this._notificationService.status(nls.localize(1701, "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });
202
202
  this._leaveChordMode();
203
203
  shouldPreventDefault = true;
204
204
  }
@@ -217,7 +217,7 @@ export class AbstractKeybindingService extends Disposable {
217
217
  if (this.inChordMode) {
218
218
  const currentChordsLabel = this._currentChords.map(({ label }) => label).join(', ');
219
219
  this._log(`+ Leaving chord mode: Nothing bound to "${currentChordsLabel}, ${keypressLabel}".`);
220
- this._notificationService.status(nls.localize(1701, "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });
220
+ this._notificationService.status(nls.localize(1702, "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });
221
221
  this._leaveChordMode();
222
222
  shouldPreventDefault = true;
223
223
  }