diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index f03cf308b61..170d097fe80 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -395,10 +395,6 @@ export class ContentHoverController extends Disposable { public goToBottom(): void { this._widget.goToBottom(); } - - public escape(): void { - this._widget.escape(); - } } class HoverResult { @@ -730,7 +726,7 @@ export class ContentHoverWidget extends ResizableContentWidget { if (!this._visibleData) { return; } - const stoleFocus = this._visibleData.stoleFocus; + const stoleFocus = this._visibleData.stoleFocus || this._hoverFocusedKey.get(); this._setHoverData(undefined); this._resizableNode.maxSize = new dom.Dimension(Infinity, Infinity); this._resizableNode.clearSashHoverState(); @@ -822,10 +818,6 @@ export class ContentHoverWidget extends ResizableContentWidget { public goToBottom(): void { this._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight }); } - - public escape(): void { - this._editor.focus(); - } } export class EditorHoverStatusBar extends Disposable implements IEditorHoverStatusBar { diff --git a/src/vs/editor/contrib/hover/browser/hover.ts b/src/vs/editor/contrib/hover/browser/hover.ts index 881435fe4c9..46c94e313df 100644 --- a/src/vs/editor/contrib/hover/browser/hover.ts +++ b/src/vs/editor/contrib/hover/browser/hover.ts @@ -302,10 +302,6 @@ export class ModesHoverController implements IEditorContribution { this._contentWidget?.goToBottom(); } - public escape(): void { - this._contentWidget?.escape(); - } - public isHoverVisible(): boolean | undefined { return this._contentWidget?.isVisible(); } @@ -665,36 +661,6 @@ class GoToBottomHoverAction extends EditorAction { } } -class EscapeFocusHoverAction extends EditorAction { - - constructor() { - super({ - id: 'editor.action.escapeFocusHover', - label: nls.localize({ - key: 'escapeFocusHover', - comment: [ - 'Action that allows to escape from the hover widget with the escape command when the hover widget is focused.' - ] - }, "Escape Focus Hover"), - alias: 'Escape Focus Hover', - precondition: EditorContextKeys.hoverFocused, - kbOpts: { - kbExpr: EditorContextKeys.hoverFocused, - primary: KeyCode.Escape, - weight: KeybindingWeight.EditorContrib - } - }); - } - - public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = ModesHoverController.get(editor); - if (!controller) { - return; - } - controller.escape(); - } -} - registerEditorContribution(ModesHoverController.ID, ModesHoverController, EditorContributionInstantiation.BeforeFirstInteraction); registerEditorAction(ShowOrFocusHoverAction); registerEditorAction(ShowDefinitionPreviewHoverAction); @@ -706,7 +672,6 @@ registerEditorAction(PageUpHoverAction); registerEditorAction(PageDownHoverAction); registerEditorAction(GoToTopHoverAction); registerEditorAction(GoToBottomHoverAction); -registerEditorAction(EscapeFocusHoverAction); HoverParticipantRegistry.register(MarkdownHoverParticipant); HoverParticipantRegistry.register(MarkerHoverParticipant);