diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 1f89f9a51ba14040e1bac7ec5d767cf08a794d61..bb9f270b8cddf0aeaad5d2fd025606d953bfc8df 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -1776,6 +1776,11 @@ export interface IEditorHoverOptions { * Defaults to true. */ sticky?: boolean; + /** + * Should the hover be shown below the line if possible? + * Defaults to false. + */ + below?: boolean; } /** @@ -1789,7 +1794,8 @@ class EditorHover extends BaseEditorOption { this._hoverOperation.setHoverTime(this._editor.getOption(EditorOption.hover).delay); + this._preferBelow = this._editor.getOption(EditorOption.hover).below; })); this._register(TokenizationRegistry.onDidChange(() => { if (this._isVisible && this._lastAnchor && this._messages.length > 0) { @@ -368,10 +371,13 @@ export class ModesContentHoverWidget extends Widget implements IContentWidget, I return { position: this._showAtPosition, range: this._showAtRange, - preference: [ + preference: this._preferBelow ? [ + ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE, - ContentWidgetPositionPreference.BELOW - ] + ] : [ + ContentWidgetPositionPreference.ABOVE, + ContentWidgetPositionPreference.BELOW, + ], }; } return null; diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 9ef905ca15c9fd400a018727540f636ef84c5d6f..5e96b497df7ade646ebb71375f210bc11b5f5c5c 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3510,6 +3510,11 @@ declare namespace monaco.editor { * Defaults to true. */ sticky?: boolean; + /** + * Should the hover be shown below the line if possible? + * Defaults to false. + */ + below?: boolean; } /**