monaco-editor-core 0.56.0-dev-20251121 → 0.56.0-dev-20251123

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 (70) 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 +2 -0
  18. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  19. package/esm/vs/base/browser/ui/list/rowCache.js +1 -4
  20. package/esm/vs/base/browser/ui/list/rowCache.js.map +1 -1
  21. package/esm/vs/base/browser/ui/menu/menu.js +14 -12
  22. package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
  23. package/esm/vs/base/common/map.js +8 -5
  24. package/esm/vs/base/common/map.js.map +1 -1
  25. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +1 -4
  26. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
  27. package/esm/vs/base/common/worker/webWorker.js +10 -7
  28. package/esm/vs/base/common/worker/webWorker.js.map +1 -1
  29. package/esm/vs/editor/browser/services/editorWorkerService.js +1 -1
  30. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  31. package/esm/vs/editor/contrib/find/browser/findWidgetSearchHistory.js.map +1 -1
  32. package/esm/vs/editor/contrib/find/browser/replaceWidgetHistory.js.map +1 -1
  33. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  34. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +29 -16
  35. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
  36. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +42 -5
  37. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
  38. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +10 -0
  39. package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +1 -1
  40. package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -1
  41. package/esm/vs/platform/actionWidget/browser/actionWidget.css +7 -0
  42. package/esm/vs/platform/hover/browser/hoverService.js +17 -8
  43. package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
  44. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +41 -8
  45. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
  46. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  47. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  48. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  49. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  50. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  51. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  52. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  53. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +8 -0
  54. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
  55. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  56. package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
  57. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  58. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  59. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  60. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  61. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  62. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  63. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  64. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  65. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  66. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  67. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  68. package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js.map +1 -1
  69. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  70. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/standalone/browser/services/standaloneWebWorkerService.ts","vs/editor/standalone/browser/services/standaloneWebWorkerService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gEAAgE,CAAC;AAElG,MAAM,OAAO,0BAA2B,SAAQ,gBAAgB;IAC5C,aAAa,CAAC,UAA+B;QAC/D,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;QACjD,IAAI,iBAAiB,EAAE,CAAC;YACvB,IAAI,OAAO,iBAAiB,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;gBACvD,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;gBAC9E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;oBAC1B,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAChC,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAEQ,YAAY,CAAC,UAA+B;QACpD,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;QACjD,IAAI,iBAAiB,EAAE,CAAC;YACvB,IAAI,OAAO,iBAAiB,CAAC,YAAY,KAAK,UAAU,EAAE,CAAC;gBAC1D,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,CAAC,eAAe,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;gBACpF,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;oBAC7B,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;oBACpE,OAAO,WAAW,CAAC;gBACpB,CAAC;YACF,CAAC;QACF,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,0FAA0F,CAAC,CAAC;QAC7G,CAAC;QAED,MAAM,GAAG,GAAG,OAAO,UAAU,CAAC,wBAAwB,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACpJ,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC;IACf,CAAC;CACD","file":"standaloneWebWorkerService.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 { getMonacoEnvironment } from '../../../../base/browser/browser.js';\nimport { WebWorkerDescriptor } from '../../../../platform/webWorker/browser/webWorkerDescriptor.js';\nimport { WebWorkerService } from '../../../../platform/webWorker/browser/webWorkerServiceImpl.js';\n\nexport class StandaloneWebWorkerService extends WebWorkerService {\n\tprotected override _createWorker(descriptor: WebWorkerDescriptor): Promise<Worker> {\n\t\tconst monacoEnvironment = getMonacoEnvironment();\n\t\tif (monacoEnvironment) {\n\t\t\tif (typeof monacoEnvironment.getWorker === 'function') {\n\t\t\t\tconst worker = monacoEnvironment.getWorker('workerMain.js', descriptor.label);\n\t\t\t\tif (worker !== undefined) {\n\t\t\t\t\treturn Promise.resolve(worker);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn super._createWorker(descriptor);\n\t}\n\n\toverride getWorkerUrl(descriptor: WebWorkerDescriptor): string {\n\t\tconst monacoEnvironment = getMonacoEnvironment();\n\t\tif (monacoEnvironment) {\n\t\t\tif (typeof monacoEnvironment.getWorkerUrl === 'function') {\n\t\t\t\tconst workerUrl = monacoEnvironment.getWorkerUrl('workerMain.js', descriptor.label);\n\t\t\t\tif (workerUrl !== undefined) {\n\t\t\t\t\tconst absoluteUrl = new URL(workerUrl, document.baseURI).toString();\n\t\t\t\t\treturn absoluteUrl;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!descriptor.esmModuleLocationBundler) {\n\t\t\tthrow new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`);\n\t\t}\n\n\t\tconst url = typeof descriptor.esmModuleLocationBundler === 'function' ? descriptor.esmModuleLocationBundler() : descriptor.esmModuleLocationBundler;\n\t\tconst urlStr = url.toString();\n\t\treturn urlStr;\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 { getMonacoEnvironment } from '../../../../base/browser/browser.js';\nimport { WebWorkerDescriptor } from '../../../../platform/webWorker/browser/webWorkerDescriptor.js';\nimport { WebWorkerService } from '../../../../platform/webWorker/browser/webWorkerServiceImpl.js';\n\nexport class StandaloneWebWorkerService extends WebWorkerService {\n\tprotected override _createWorker(descriptor: WebWorkerDescriptor): Promise<Worker> {\n\t\tconst monacoEnvironment = getMonacoEnvironment();\n\t\tif (monacoEnvironment) {\n\t\t\tif (typeof monacoEnvironment.getWorker === 'function') {\n\t\t\t\tconst worker = monacoEnvironment.getWorker('workerMain.js', descriptor.label);\n\t\t\t\tif (worker !== undefined) {\n\t\t\t\t\treturn Promise.resolve(worker);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn super._createWorker(descriptor);\n\t}\n\n\toverride getWorkerUrl(descriptor: WebWorkerDescriptor): string {\n\t\tconst monacoEnvironment = getMonacoEnvironment();\n\t\tif (monacoEnvironment) {\n\t\t\tif (typeof monacoEnvironment.getWorkerUrl === 'function') {\n\t\t\t\tconst workerUrl = monacoEnvironment.getWorkerUrl('workerMain.js', descriptor.label);\n\t\t\t\tif (workerUrl !== undefined) {\n\t\t\t\t\tconst absoluteUrl = new URL(workerUrl, document.baseURI).toString();\n\t\t\t\t\treturn absoluteUrl;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!descriptor.esmModuleLocationBundler) {\n\t\t\tthrow new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`);\n\t\t}\n\n\t\tconst url = typeof descriptor.esmModuleLocationBundler === 'function' ? descriptor.esmModuleLocationBundler() : descriptor.esmModuleLocationBundler;\n\t\tconst urlStr = url.toString();\n\t\treturn urlStr;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/standalone/browser/services/standaloneWebWorkerService.ts","vs/editor/standalone/browser/services/standaloneWebWorkerService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,oB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O,UAAU,CAAC,wBAAwB,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACpJ,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC;IACf,CAAC;CACD","file":"standaloneWebWorkerService.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 { getMonacoEnvironment } from '../../../../base/browser/browser.js';\nimport { WebWorkerDescriptor } from '../../../../platform/webWorker/browser/webWorkerDescriptor.js';\nimport { WebWorkerService } from '../../../../platform/webWorker/browser/webWorkerServiceImpl.js';\n\nexport class StandaloneWebWorkerService extends WebWorkerService {\n\tprotected override _createWorker(descriptor: WebWorkerDescriptor): Promise<Worker> {\n\t\tconst monacoEnvironment = getMonacoEnvironment();\n\t\tif (monacoEnvironment) {\n\t\t\tif (typeof monacoEnvironment.getWorker === 'function') {\n\t\t\t\tconst worker = monacoEnvironment.getWorker('workerMain.js', descriptor.label);\n\t\t\t\tif (worker !== undefined) {\n\t\t\t\t\treturn Promise.resolve(worker);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn super._createWorker(descriptor);\n\t}\n\n\toverride getWorkerUrl(descriptor: WebWorkerDescriptor): string {\n\t\tconst monacoEnvironment = getMonacoEnvironment();\n\t\tif (monacoEnvironment) {\n\t\t\tif (typeof monacoEnvironment.getWorkerUrl === 'function') {\n\t\t\t\tconst workerUrl = monacoEnvironment.getWorkerUrl('workerMain.js', descriptor.label);\n\t\t\t\tif (workerUrl !== undefined) {\n\t\t\t\t\tconst absoluteUrl = new URL(workerUrl, document.baseURI).toString();\n\t\t\t\t\treturn absoluteUrl;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!descriptor.esmModuleLocationBundler) {\n\t\t\tthrow new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker for the worker label: ${descriptor.label}`);\n\t\t}\n\n\t\tconst url = typeof descriptor.esmModuleLocationBundler === 'function' ? descriptor.esmModuleLocationBundler() : descriptor.esmModuleLocationBundler;\n\t\tconst urlStr = url.toString();\n\t\treturn urlStr;\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 { getMonacoEnvironment } from '../../../../base/browser/browser.js';\nimport { WebWorkerDescriptor } from '../../../../platform/webWorker/browser/webWorkerDescriptor.js';\nimport { WebWorkerService } from '../../../../platform/webWorker/browser/webWorkerServiceImpl.js';\n\nexport class StandaloneWebWorkerService extends WebWorkerService {\n\tprotected override _createWorker(descriptor: WebWorkerDescriptor): Promise<Worker> {\n\t\tconst monacoEnvironment = getMonacoEnvironment();\n\t\tif (monacoEnvironment) {\n\t\t\tif (typeof monacoEnvironment.getWorker === 'function') {\n\t\t\t\tconst worker = monacoEnvironment.getWorker('workerMain.js', descriptor.label);\n\t\t\t\tif (worker !== undefined) {\n\t\t\t\t\treturn Promise.resolve(worker);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn super._createWorker(descriptor);\n\t}\n\n\toverride getWorkerUrl(descriptor: WebWorkerDescriptor): string {\n\t\tconst monacoEnvironment = getMonacoEnvironment();\n\t\tif (monacoEnvironment) {\n\t\t\tif (typeof monacoEnvironment.getWorkerUrl === 'function') {\n\t\t\t\tconst workerUrl = monacoEnvironment.getWorkerUrl('workerMain.js', descriptor.label);\n\t\t\t\tif (workerUrl !== undefined) {\n\t\t\t\t\tconst absoluteUrl = new URL(workerUrl, document.baseURI).toString();\n\t\t\t\t\treturn absoluteUrl;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!descriptor.esmModuleLocationBundler) {\n\t\t\tthrow new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker for the worker label: ${descriptor.label}`);\n\t\t}\n\n\t\tconst url = typeof descriptor.esmModuleLocationBundler === 'function' ? descriptor.esmModuleLocationBundler() : descriptor.esmModuleLocationBundler;\n\t\tconst urlStr = url.toString();\n\t\treturn urlStr;\n\t}\n}\n"]}
@@ -195,3 +195,10 @@
195
195
  opacity: 0.7;
196
196
  margin-left: 0.5em;
197
197
  }
198
+
199
+ .action-widget-delegate-label {
200
+ display: flex;
201
+ align-items: center;
202
+ gap: 4px;
203
+ font-size: 12px;
204
+ }
@@ -110,19 +110,22 @@ let HoverService = class HoverService extends Disposable {
110
110
  return hover;
111
111
  }
112
112
  setupDelayedHover(target, options, lifecycleOptions) {
113
- const resolveHoverOptions = () => ({
114
- ...typeof options === 'function' ? options() : options,
115
- target
116
- });
113
+ const resolveHoverOptions = (e) => {
114
+ const resolved = {
115
+ ...typeof options === 'function' ? options() : options,
116
+ target
117
+ };
118
+ if (resolved.style === 2 /* HoverStyle.Mouse */ && e) {
119
+ resolved.target = resolveMouseStyleHoverTarget(target, e);
120
+ }
121
+ return resolved;
122
+ };
117
123
  return this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);
118
124
  }
119
125
  setupDelayedHoverAtMouse(target, options, lifecycleOptions) {
120
126
  const resolveHoverOptions = (e) => ({
121
127
  ...typeof options === 'function' ? options() : options,
122
- target: {
123
- targetElements: [target],
124
- x: e !== undefined ? e.x + 10 : undefined,
125
- }
128
+ target: e ? resolveMouseStyleHoverTarget(target, e) : target
126
129
  });
127
130
  return this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);
128
131
  }
@@ -520,6 +523,12 @@ function getHoverTargetElement(element, stopElement) {
520
523
  }
521
524
  return element;
522
525
  }
526
+ function resolveMouseStyleHoverTarget(target, e) {
527
+ return {
528
+ targetElements: [target],
529
+ x: e.x + 10
530
+ };
531
+ }
523
532
  registerSingleton(IHoverService, HoverService, 1 /* InstantiationType.Delayed */);
524
533
  registerThemingParticipant((theme, collector) => {
525
534
  const hoverBorder = theme.getColor(editorHoverBorder);
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/hover/browser/hoverService.ts","vs/platform/hover/browser/hoverService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtL,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,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,EAA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AS,CAAC,OAAO,CAAC,kGAAkG,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvJ,SAAS,CAAC,OAAO,CAAC,4DAA4D,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClH,CAAC;AACF,CAAC,CAAC,CAAC","file":"hoverService.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { IContextViewProvider, IDelegate } from '../../../base/browser/ui/contextview/contextview.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../base/browser/dom.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { ResultKind } from '../../keybinding/common/keybindingResolver.js';\nimport { IAccessibilityService } from '../../accessibility/common/accessibility.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { ContextViewHandler } from '../../contextview/browser/contextViewService.js';\nimport { isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\nexport class HoverService extends Disposable implements IHoverService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate _contextViewHandler: IContextViewProvider;\n\tprivate _currentHoverOptions: IHoverOptions | undefined;\n\tprivate _currentHover: HoverWidget | undefined;\n\tprivate _currentDelayedHover: HoverWidget | undefined;\n\tprivate _currentDelayedHoverWasShown: boolean = false;\n\tprivate _currentDelayedHoverGroupId: number | string | undefined;\n\tprivate _lastHoverOptions: IHoverOptions | undefined;\n\n\tprivate _lastFocusedElementBeforeOpen: HTMLElement | undefined;\n\n\tprivate readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();\n\tprivate readonly _managedHovers = new Map<HTMLElement, IManagedHover>();\n\n\tconstructor(\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper();\n\n\t\tthis._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));\n\t\tthis._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));\n\n\t\tthis._register(KeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\tid: 'workbench.action.showHover',\n\t\t\tweight: KeybindingWeight.EditorCore,\n\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),\n\t\t\thandler: () => { this._showAndFocusHoverForActiveElement(); },\n\t\t}));\n\t}\n\n\tshowInstantHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {\n\t\tconst hover = this._createHover(options, skipLastFocusedUpdate);\n\t\tif (!hover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._showHover(hover, options, focus);\n\t\treturn hover;\n\t}\n\n\tshowDelayedHover(\n\t\toptions: IHoverOptions,\n\t\tlifecycleOptions: Pick<IHoverLifecycleOptions, 'groupId'>,\n\t): IHoverWidget | undefined {\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (!this._currentDelayedHover || this._currentDelayedHoverWasShown) {\n\t\t\t// Current hover is locked, reject\n\t\t\tif (this._currentHover?.isLocked) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Identity is the same, return current hover\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\treturn this._currentHover;\n\t\t\t}\n\n\t\t\t// Check group identity, if it's the same skip the delay and show the hover immediately\n\t\t\tif (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== undefined && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) {\n\t\t\t\treturn this.showInstantHover({\n\t\t\t\t\t...options,\n\t\t\t\t\tappearance: {\n\t\t\t\t\t\t...options.appearance,\n\t\t\t\t\t\tskipFadeInAnimation: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t// If the hover is the same but timeout is not finished yet, return the current hover\n\t\t\treturn this._currentDelayedHover;\n\t\t}\n\n\t\tconst hover = this._createHover(options, undefined);\n\t\tif (!hover) {\n\t\t\tthis._currentDelayedHover = undefined;\n\t\t\tthis._currentDelayedHoverWasShown = false;\n\t\t\tthis._currentDelayedHoverGroupId = undefined;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._currentDelayedHover = hover;\n\t\tthis._currentDelayedHoverWasShown = false;\n\t\tthis._currentDelayedHoverGroupId = lifecycleOptions?.groupId;\n\n\t\ttimeout(this._configurationService.getValue<number>('workbench.hover.delay')).then(() => {\n\t\t\tif (hover && !hover.isDisposed) {\n\t\t\t\tthis._currentDelayedHoverWasShown = true;\n\t\t\t\tthis._showHover(hover, options);\n\t\t\t}\n\t\t});\n\n\t\treturn hover;\n\t}\n\n\tsetupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target'>) | Omit<IHoverOptions, 'target'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = () => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: {\n\t\t\t\ttargetElements: [target],\n\t\t\t\tx: e !== undefined ? e.x + 10 : undefined,\n\t\t\t}\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): HoverWidget | undefined {\n\t\tthis._currentDelayedHover = undefined;\n\n\t\tif (options.content === '') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this._currentHover?.isLocked) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Set `id` to default if it's undefined\n\t\tif (options.id === undefined) {\n\t\t\toptions.id = getHoverIdFromContent(options.content);\n\t\t}\n\n\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._currentHoverOptions = options;\n\t\tthis._lastHoverOptions = options;\n\t\tconst trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();\n\t\tconst activeElement = getActiveElement();\n\t\t// HACK, remove this check when #189076 is fixed\n\t\tif (!skipLastFocusedUpdate) {\n\t\t\tif (trapFocus && activeElement) {\n\t\t\t\tif (!activeElement.classList.contains('monaco-hover')) {\n\t\t\t\t\tthis._lastFocusedElementBeforeOpen = activeElement as HTMLElement;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastFocusedElementBeforeOpen = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst hoverDisposables = new DisposableStore();\n\t\tconst hover = this._instantiationService.createInstance(HoverWidget, options);\n\t\tif (options.persistence?.sticky) {\n\t\t\thover.isLocked = true;\n\t\t}\n\n\t\t// Adjust target position when a mouse event is provided as the hover position\n\t\tif (options.position?.hoverPosition && !isNumber(options.position.hoverPosition)) {\n\t\t\toptions.target = {\n\t\t\t\ttargetElements: isHTMLElement(options.target) ? [options.target] : options.target.targetElements,\n\t\t\t\tx: options.position.hoverPosition.x + 10\n\t\t\t};\n\t\t}\n\n\t\thover.onDispose(() => {\n\t\t\tconst hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);\n\t\t\tif (hoverWasFocused) {\n\t\t\t\t// Required to handle cases such as closing the hover with the escape key\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\n\t\t\t// Only clear the current options if it's the current hover, the current options help\n\t\t\t// reduce flickering when the same hover is shown multiple times\n\t\t\tif (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {\n\t\t\t\tthis.doHideHover();\n\t\t\t}\n\t\t\thoverDisposables.dispose();\n\t\t}, undefined, hoverDisposables);\n\t\t// Set the container explicitly to enable aux window support\n\t\tif (!options.container) {\n\t\t\tconst targetElement = isHTMLElement(options.target) ? options.target : options.target.targetElements[0];\n\t\t\toptions.container = this._layoutService.getContainer(getWindow(targetElement));\n\t\t}\n\n\t\thover.onRequestLayout(() => this._contextViewHandler.layout(), undefined, hoverDisposables);\n\t\tif (options.persistence?.sticky) {\n\t\t\thoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {\n\t\t\t\tif (!isAncestor(e.target as HTMLElement, hover.domNode)) {\n\t\t\t\t\tthis.doHideHover();\n\t\t\t\t}\n\t\t\t}));\n\t\t} else {\n\t\t\tif ('targetElements' in options.target) {\n\t\t\t\tfor (const element of options.target.targetElements) {\n\t\t\t\t\thoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));\n\t\t\t}\n\t\t\tconst focusedElement = getActiveElement();\n\t\t\tif (focusedElement) {\n\t\t\t\tconst focusedElementDocument = getWindow(focusedElement).document;\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t\thoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));\n\t\t\t}\n\t\t}\n\n\t\tif ('IntersectionObserver' in mainWindow) {\n\t\t\tconst observer = new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 });\n\t\t\tconst firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;\n\t\t\tobserver.observe(firstTargetElement);\n\t\t\thoverDisposables.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\n\t\tthis._currentHover = hover;\n\n\t\treturn hover;\n\t}\n\n\tprivate _showHover(hover: HoverWidget, options: IHoverOptions, focus?: boolean) {\n\t\tthis._contextViewHandler.showContextView(\n\t\t\tnew HoverContextViewDelegate(hover, focus),\n\t\t\toptions.container\n\t\t);\n\t}\n\n\thideHover(force?: boolean): void {\n\t\tif ((!force && this._currentHover?.isLocked) || !this._currentHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doHideHover();\n\t}\n\n\tprivate doHideHover(): void {\n\t\tthis._currentHover = undefined;\n\t\tthis._currentHoverOptions = undefined;\n\t\tthis._contextViewHandler.hideContextView();\n\t}\n\n\tprivate _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {\n\t\tconst entry = entries[entries.length - 1];\n\t\tif (!entry.isIntersecting) {\n\t\t\thover.dispose();\n\t\t}\n\t}\n\n\tshowAndFocusLastHover(): void {\n\t\tif (!this._lastHoverOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis.showInstantHover(this._lastHoverOptions, true, true);\n\t}\n\n\tprivate _showAndFocusHoverForActiveElement(): void {\n\t\t// TODO: if hover is visible, focus it to avoid flickering\n\n\t\tlet activeElement = getActiveElement() as HTMLElement | null;\n\t\twhile (activeElement) {\n\t\t\tconst hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);\n\t\t\tif (hover) {\n\t\t\t\thover.show(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tactiveElement = activeElement.parentElement;\n\t\t}\n\t}\n\n\tprivate _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = true;\n\t\t\treturn;\n\t\t}\n\t\tconst event = new StandardKeyboardEvent(e);\n\t\tconst keybinding = this._keybindingService.resolveKeyboardEvent(event);\n\t\tif (keybinding.getSingleModifierDispatchChords().some(value => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== ResultKind.NoMatchingKb) {\n\t\t\treturn;\n\t\t}\n\t\tif (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {\n\t\t\tthis.hideHover();\n\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t}\n\t}\n\n\tprivate _keyUp(e: KeyboardEvent, hover: HoverWidget) {\n\t\tif (e.key === 'Alt') {\n\t\t\thover.isLocked = false;\n\t\t\t// Hide if alt is released while the mouse is not over hover/target\n\t\t\tif (!hover.isMouseIn) {\n\t\t\t\tthis.hideHover();\n\t\t\t\tthis._lastFocusedElementBeforeOpen?.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Investigate performance of this function. There seems to be a lot of content created\n\t// and thrown away on start up\n\tsetupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {\n\t\tif (hoverDelegate.showNativeHover) {\n\t\t\treturn setupNativeHover(targetElement, content);\n\t\t}\n\n\t\ttargetElement.setAttribute('custom-hover', 'true');\n\n\t\tif (targetElement.title !== '') {\n\t\t\tconsole.warn('HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute.');\n\t\t\tconsole.trace('Stack trace:', targetElement.title);\n\t\t\ttargetElement.title = '';\n\t\t}\n\n\t\tlet hoverPreparation: IDisposable | undefined;\n\t\tlet hoverWidget: ManagedHoverWidget | undefined;\n\n\t\tconst hideHover = (disposeWidget: boolean, disposePreparation: boolean) => {\n\t\t\tconst hadHover = hoverWidget !== undefined;\n\t\t\tif (disposeWidget) {\n\t\t\t\thoverWidget?.dispose();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t\tif (disposePreparation) {\n\t\t\t\thoverPreparation?.dispose();\n\t\t\t\thoverPreparation = undefined;\n\t\t\t}\n\t\t\tif (hadHover) {\n\t\t\t\thoverDelegate.onDidHideHover?.();\n\t\t\t\thoverWidget = undefined;\n\t\t\t}\n\t\t};\n\n\t\tconst triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget, trapFocus?: boolean) => {\n\t\t\treturn new TimeoutTimer(async () => {\n\t\t\t\tif (!hoverWidget || hoverWidget.isDisposed) {\n\t\t\t\t\thoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0);\n\t\t\t\t\tawait hoverWidget.update(typeof content === 'function' ? content() : content, focus, { ...options, trapFocus });\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t};\n\n\t\tconst store = new DisposableStore();\n\t\tlet isMouseDown = false;\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => {\n\t\t\tisMouseDown = true;\n\t\t\thideHover(true, true);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => {\n\t\t\tisMouseDown = false;\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tisMouseDown = false;\n\t\t\t// HACK: `fromElement` is a non-standard property. Not sure what to replace it with,\n\t\t\t// `relatedTarget` is NOT equivalent.\n\t\t\tinterface MouseEventWithFrom extends MouseEvent {\n\t\t\t\tfromElement: Element | null;\n\t\t\t}\n\t\t\thideHover(false, (e as MouseEventWithFrom).fromElement === targetElement);\n\t\t}, true));\n\t\tstore.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e: MouseEvent) => {\n\t\t\tif (hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mouseOverStore: DisposableStore = new DisposableStore();\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tif (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') {\n\t\t\t\t// track the mouse position\n\t\t\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\t\t\ttarget.x = e.x + 10;\n\t\t\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\t\t\thideHover(true, true);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tmouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true));\n\t\t\t}\n\n\t\t\thoverPreparation = mouseOverStore;\n\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the mouse is over another hover target\n\t\t\t}\n\n\t\t\tmouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t}, true));\n\n\t\tconst onFocus = (e: FocusEvent) => {\n\t\t\tif (isMouseDown || hoverPreparation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!eventIsRelatedToTarget(e, targetElement)) {\n\t\t\t\treturn; // Do not show hover when the focus is on another hover target\n\t\t\t}\n\n\t\t\tconst target: IHoverDelegateTarget = {\n\t\t\t\ttargetElements: [targetElement],\n\t\t\t\tdispose: () => { }\n\t\t\t};\n\t\t\tconst toDispose: DisposableStore = new DisposableStore();\n\t\t\tconst onBlur = () => hideHover(true, true);\n\t\t\ttoDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true));\n\t\t\ttoDispose.add(triggerShowHover(typeof hoverDelegate.delay === 'function' ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target));\n\t\t\thoverPreparation = toDispose;\n\t\t};\n\n\t\t// Do not show hover when focusing an input or textarea\n\t\tif (!isEditableElement(targetElement)) {\n\t\t\tstore.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true));\n\t\t}\n\n\t\tconst hover: IManagedHover = {\n\t\t\tshow: focus => {\n\t\t\t\thideHover(false, true); // terminate a ongoing mouse over preparation\n\t\t\t\ttriggerShowHover(0, focus, undefined, focus); // show hover immediately\n\t\t\t},\n\t\t\thide: () => {\n\t\t\t\thideHover(true, true);\n\t\t\t},\n\t\t\tupdate: async (newContent, hoverOptions) => {\n\t\t\t\tcontent = newContent;\n\t\t\t\tawait hoverWidget?.update(content, undefined, hoverOptions);\n\t\t\t},\n\t\t\tdispose: () => {\n\t\t\t\tthis._managedHovers.delete(targetElement);\n\t\t\t\tstore.dispose();\n\t\t\t\thideHover(true, true);\n\t\t\t}\n\t\t};\n\t\tthis._managedHovers.set(targetElement, hover);\n\t\treturn hover;\n\t}\n\n\tshowManagedHover(target: HTMLElement): void {\n\t\tconst hover = this._managedHovers.get(target);\n\t\tif (hover) {\n\t\t\thover.show(true);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._managedHovers.forEach(hover => hover.dispose());\n\t\tsuper.dispose();\n\t}\n}\n\nfunction getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOptions | number | string | undefined {\n\tif (options === undefined) {\n\t\treturn undefined;\n\t}\n\treturn options?.id ?? options;\n}\n\nfunction getHoverIdFromContent(content: string | HTMLElement | IMarkdownString): string | undefined {\n\tif (isHTMLElement(content)) {\n\t\treturn undefined;\n\t}\n\tif (typeof content === 'string') {\n\t\treturn content.toString();\n\t}\n\treturn content.value;\n}\n\nfunction getStringContent(contentOrFactory: IManagedHoverContentOrFactory): string | undefined {\n\tconst content = typeof contentOrFactory === 'function' ? contentOrFactory() : contentOrFactory;\n\tif (isString(content)) {\n\t\t// Icons don't render in the native hover so we strip them out\n\t\treturn stripIcons(content);\n\t}\n\tif (isManagedHoverTooltipMarkdownString(content)) {\n\t\treturn content.markdownNotSupportedFallback;\n\t}\n\treturn undefined;\n}\n\nfunction setupNativeHover(targetElement: HTMLElement, content: IManagedHoverContentOrFactory): IManagedHover {\n\tfunction updateTitle(title: string | undefined) {\n\t\tif (title) {\n\t\t\ttargetElement.setAttribute('title', title);\n\t\t} else {\n\t\t\ttargetElement.removeAttribute('title');\n\t\t}\n\t}\n\n\tupdateTitle(getStringContent(content));\n\treturn {\n\t\tupdate: (content) => updateTitle(getStringContent(content)),\n\t\tshow: () => { },\n\t\thide: () => { },\n\t\tdispose: () => updateTitle(undefined),\n\t};\n}\n\nclass HoverContextViewDelegate implements IDelegate {\n\n\t// Render over all other context views\n\tpublic readonly layer = 1;\n\n\tget anchorPosition() {\n\t\treturn this._hover.anchor;\n\t}\n\n\tconstructor(\n\t\tprivate readonly _hover: HoverWidget,\n\t\tprivate readonly _focus: boolean = false\n\t) {\n\t}\n\n\trender(container: HTMLElement) {\n\t\tthis._hover.render(container);\n\t\tif (this._focus) {\n\t\t\tthis._hover.focus();\n\t\t}\n\t\treturn this._hover;\n\t}\n\n\tgetAnchor() {\n\t\treturn {\n\t\t\tx: this._hover.x,\n\t\t\ty: this._hover.y\n\t\t};\n\t}\n\n\tlayout() {\n\t\tthis._hover.layout();\n\t}\n}\n\nfunction eventIsRelatedToTarget(event: UIEvent, target: HTMLElement): boolean {\n\treturn isHTMLElement(event.target) && getHoverTargetElement(event.target, 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, 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"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor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AE;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 { HoverStyle, isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverTarget, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\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 = (e?: MouseEvent) => {\n\t\t\tconst resolved: IHoverOptions = {\n\t\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\t\ttarget\n\t\t\t};\n\t\t\tif (resolved.style === HoverStyle.Mouse && e) {\n\t\t\t\tresolved.target = resolveMouseStyleHoverTarget(target, e);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t};\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: e ? resolveMouseStyleHoverTarget(target, e) : target\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): 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, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nfunction resolveMouseStyleHoverTarget(target: HTMLElement, e: MouseEvent): IHoverTarget {\n\treturn {\n\t\ttargetElements: [target],\n\t\tx: e.x + 10\n\t};\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { registerThemingParticipant } from '../../theme/common/themeService.js';\nimport { editorHoverBorder } from '../../theme/common/colorRegistry.js';\nimport { IHoverService } from './hover.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { HoverWidget } from './hoverWidget.js';\nimport { 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 { HoverStyle, isManagedHoverTooltipMarkdownString, type IHoverLifecycleOptions, type IHoverOptions, type IHoverTarget, type IHoverWidget, type IManagedHover, type IManagedHoverContentOrFactory, type IManagedHoverOptions } from '../../../base/browser/ui/hover/hover.js';\nimport { IHoverDelegate, IHoverDelegateTarget } from '../../../base/browser/ui/hover/hoverDelegate.js';\nimport { ManagedHoverWidget } from './updatableHoverWidget.js';\nimport { timeout, TimeoutTimer } from '../../../base/common/async.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\nimport { isNumber, isString } from '../../../base/common/types.js';\nimport { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js';\nimport { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js';\nimport { IMarkdownString } from '../../../base/common/htmlContent.js';\nimport { stripIcons } from '../../../base/common/iconLabels.js';\n\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 = (e?: MouseEvent) => {\n\t\t\tconst resolved: IHoverOptions = {\n\t\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\t\ttarget\n\t\t\t};\n\t\t\tif (resolved.style === HoverStyle.Mouse && e) {\n\t\t\t\tresolved.target = resolveMouseStyleHoverTarget(target, e);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t};\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tsetupDelayedHoverAtMouse(\n\t\ttarget: HTMLElement,\n\t\toptions: (() => Omit<IHoverOptions, 'target' | 'position'>) | Omit<IHoverOptions, 'target' | 'position'>,\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t): IDisposable {\n\t\tconst resolveHoverOptions = (e?: MouseEvent) => ({\n\t\t\t...typeof options === 'function' ? options() : options,\n\t\t\ttarget: e ? resolveMouseStyleHoverTarget(target, e) : target\n\t\t} satisfies IHoverOptions);\n\t\treturn this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions);\n\t}\n\n\tprivate _setupDelayedHover(\n\t\ttarget: HTMLElement,\n\t\tresolveHoverOptions: ((e?: MouseEvent) => IHoverOptions),\n\t\tlifecycleOptions?: IHoverLifecycleOptions,\n\t) {\n\t\tconst store = new DisposableStore();\n\t\tstore.add(addDisposableListener(target, EventType.MOUSE_OVER, e => {\n\t\t\tthis.showDelayedHover(resolveHoverOptions(e), {\n\t\t\t\tgroupId: lifecycleOptions?.groupId\n\t\t\t});\n\t\t}));\n\t\tif (lifecycleOptions?.setupKeyboardEvents) {\n\t\t\tstore.add(addDisposableListener(target, EventType.KEY_DOWN, e => {\n\t\t\t\tconst evt = new StandardKeyboardEvent(e);\n\t\t\t\tif (evt.equals(KeyCode.Space) || evt.equals(KeyCode.Enter)) {\n\t\t\t\t\tthis.showInstantHover(resolveHoverOptions(), true);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._delayedHovers.set(target, { show: (focus: boolean) => { this.showInstantHover(resolveHoverOptions(), focus); } });\n\t\tstore.add(toDisposable(() => this._delayedHovers.delete(target)));\n\n\t\treturn store;\n\t}\n\n\tprivate _createHover(options: IHoverOptions, skipLastFocusedUpdate?: boolean): 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, target) === target;\n}\n\nfunction getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement): HTMLElement {\n\tstopElement = stopElement ?? getWindow(element).document.body;\n\twhile (!element.hasAttribute('custom-hover') && element !== stopElement) {\n\t\telement = element.parentElement!;\n\t}\n\treturn element;\n}\n\nfunction resolveMouseStyleHoverTarget(target: HTMLElement, e: MouseEvent): IHoverTarget {\n\treturn {\n\t\ttargetElements: [target],\n\t\tx: e.x + 10\n\t};\n}\n\nregisterSingleton(IHoverService, HoverService, InstantiationType.Delayed);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t}\n});\n"]}
@@ -12,12 +12,14 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  var AbstractCommandsQuickAccessProvider_1, CommandsHistory_1;
15
+ import { Codicon } from '../../../base/common/codicons.js';
15
16
  import { toErrorMessage } from '../../../base/common/errorMessage.js';
16
17
  import { isCancellationError } from '../../../base/common/errors.js';
17
18
  import { matchesBaseContiguousSubString, matchesWords, or } from '../../../base/common/filters.js';
18
19
  import { createSingleCallFunction } from '../../../base/common/functional.js';
19
20
  import { Disposable } from '../../../base/common/lifecycle.js';
20
21
  import { LRUCache } from '../../../base/common/map.js';
22
+ import { ThemeIcon } from '../../../base/common/themables.js';
21
23
  import { TfIdfCalculator, normalizeTfIdfScores } from '../../../base/common/tfIdf.js';
22
24
  import { localize } from '../../../nls.js';
23
25
  import { ICommandService } from '../../commands/common/commands.js';
@@ -26,7 +28,7 @@ import { IDialogService } from '../../dialogs/common/dialogs.js';
26
28
  import { IInstantiationService } from '../../instantiation/common/instantiation.js';
27
29
  import { IKeybindingService } from '../../keybinding/common/keybinding.js';
28
30
  import { ILogService } from '../../log/common/log.js';
29
- import { PickerQuickAccessProvider } from './pickerQuickAccess.js';
31
+ import { PickerQuickAccessProvider, TriggerAction } from './pickerQuickAccess.js';
30
32
  import { IStorageService, WillSaveStateReason } from '../../storage/common/storage.js';
31
33
  import { ITelemetryService } from '../../telemetry/common/telemetry.js';
32
34
  import { Categories } from '../../action/common/actionCommonCategories.js';
@@ -165,8 +167,9 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
165
167
  let addCommonlyUsedSeparator = !!this.options.suggestedCommandIds;
166
168
  for (let i = 0; i < filteredCommandPicks.length; i++) {
167
169
  const commandPick = filteredCommandPicks[i];
170
+ const isInHistory = !!this.commandsHistory.peek(commandPick.commandId);
168
171
  // Separator: recently used
169
- if (i === 0 && this.commandsHistory.peek(commandPick.commandId)) {
172
+ if (i === 0 && isInHistory) {
170
173
  commandPicks.push({ type: 'separator', label: localize(1747, "recently used") });
171
174
  addOtherSeparator = true;
172
175
  }
@@ -175,18 +178,18 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
175
178
  addSuggestedSeparator = false;
176
179
  }
177
180
  // Separator: commonly used
178
- if (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && this.options.suggestedCommandIds?.has(commandPick.commandId)) {
181
+ if (addCommonlyUsedSeparator && commandPick.tfIdfScore === undefined && !isInHistory && this.options.suggestedCommandIds?.has(commandPick.commandId)) {
179
182
  commandPicks.push({ type: 'separator', label: localize(1749, "commonly used") });
180
183
  addOtherSeparator = true;
181
184
  addCommonlyUsedSeparator = false;
182
185
  }
183
186
  // Separator: other commands
184
- if (addOtherSeparator && commandPick.tfIdfScore === undefined && !this.commandsHistory.peek(commandPick.commandId) && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {
187
+ if (addOtherSeparator && commandPick.tfIdfScore === undefined && !isInHistory && !this.options.suggestedCommandIds?.has(commandPick.commandId)) {
185
188
  commandPicks.push({ type: 'separator', label: localize(1750, "other commands") });
186
189
  addOtherSeparator = false;
187
190
  }
188
191
  // Command
189
- commandPicks.push(this.toCommandPick(commandPick, runOptions));
192
+ commandPicks.push(this.toCommandPick(commandPick, runOptions, isInHistory));
190
193
  }
191
194
  if (!this.hasAdditionalCommandPicks(filter, token)) {
192
195
  return commandPicks;
@@ -208,7 +211,7 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
208
211
  })()
209
212
  };
210
213
  }
211
- toCommandPick(commandPick, runOptions) {
214
+ toCommandPick(commandPick, runOptions, isRecentlyUsed = false) {
212
215
  if (commandPick.type === 'separator') {
213
216
  return commandPick;
214
217
  }
@@ -216,11 +219,21 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
216
219
  const ariaLabel = keybinding ?
217
220
  localize(1752, "{0}, {1}", commandPick.label, keybinding.getAriaLabel()) :
218
221
  commandPick.label;
222
+ // Add remove button for recently used items (as the last button, to the right)
223
+ const existingButtons = commandPick.buttons || [];
224
+ const buttons = isRecentlyUsed ? [
225
+ ...existingButtons,
226
+ {
227
+ iconClass: ThemeIcon.asClassName(Codicon.close),
228
+ tooltip: localize(1753, "Remove from Recently Used")
229
+ }
230
+ ] : commandPick.buttons;
219
231
  return {
220
232
  ...commandPick,
221
233
  ariaLabel,
222
234
  detail: this.options.showAlias && commandPick.commandAlias !== commandPick.label ? commandPick.commandAlias : undefined,
223
235
  keybinding,
236
+ buttons,
224
237
  accept: async () => {
225
238
  // Add to history
226
239
  this.commandsHistory.push(commandPick.commandId);
@@ -237,10 +250,23 @@ let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvi
237
250
  }
238
251
  catch (error) {
239
252
  if (!isCancellationError(error)) {
240
- this.dialogService.error(localize(1753, "Command '{0}' resulted in an error", commandPick.label), toErrorMessage(error));
253
+ this.dialogService.error(localize(1754, "Command '{0}' resulted in an error", commandPick.label), toErrorMessage(error));
241
254
  }
242
255
  }
243
- }
256
+ },
257
+ trigger: isRecentlyUsed ? (buttonIndex, keyMods) => {
258
+ // The remove button is now the last button
259
+ const removeButtonIndex = existingButtons.length;
260
+ if (buttonIndex === removeButtonIndex) {
261
+ this.commandsHistory.remove(commandPick.commandId);
262
+ return TriggerAction.REMOVE_ITEM;
263
+ }
264
+ // Handle other buttons (e.g., configure keybinding button)
265
+ if (commandPick.trigger) {
266
+ return commandPick.trigger(buttonIndex, keyMods);
267
+ }
268
+ return TriggerAction.NO_ACTION;
269
+ } : commandPick.trigger
244
270
  };
245
271
  }
246
272
  // TF-IDF string to be indexed
@@ -336,6 +362,13 @@ let CommandsHistory = class CommandsHistory extends Disposable {
336
362
  peek(commandId) {
337
363
  return CommandsHistory_1.cache?.peek(commandId);
338
364
  }
365
+ remove(commandId) {
366
+ if (!CommandsHistory_1.cache) {
367
+ return;
368
+ }
369
+ CommandsHistory_1.cache.delete(commandId);
370
+ CommandsHistory_1.hasChanges = true;
371
+ }
339
372
  saveState() {
340
373
  if (!CommandsHistory_1.cache) {
341
374
  return;