From a9e67cddfed3673be4e91dbe71f31cc3e7456d55 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 18 Aug 2023 17:06:34 +0200 Subject: [PATCH] adding a setting in order to be able to control the hiding timeout delay --- src/vs/editor/common/config/editorOptions.ts | 13 +++++++++++++ src/vs/editor/contrib/hover/browser/hover.ts | 4 +++- src/vs/monaco.d.ts | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index eee7baf03c6..b9a7019a0ff 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2031,6 +2031,11 @@ export interface IEditorHoverOptions { * Defaults to true. */ sticky?: boolean; + /** + * Controls how long the hover is visible after you hovered out of it. + * Require sticky setting to be true. + */ + hidingTimeout?: number; /** * Should the hover be shown above the line if possible? * Defaults to false. @@ -2049,6 +2054,7 @@ class EditorHover extends BaseEditorOption this._onEditorMouseDown(e))); this._toUnhook.add(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e))); @@ -255,7 +257,7 @@ export class ModesHoverController implements IEditorContribution { this._hideWidgetsTimeout = setTimeout(() => { this._hideWidgets(); this._hideWidgetsTimeout = undefined; - }, 1000); + }, this._hidingTimeoutDelay); this._mouseWasOverWidget = false; } else { this._hideWidgets(); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 8fbfcd493ae..15d7529a5e3 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4168,6 +4168,11 @@ declare namespace monaco.editor { * Defaults to true. */ sticky?: boolean; + /** + * Controls how long the hover is visible after you hovered out of it. + * Require sticky setting to be true. + */ + hidingTimeout?: number; /** * Should the hover be shown above the line if possible? * Defaults to false.