@@ -14,6 +14,8 @@ import { HoverWidget } from 'vs/workbench/services/hover/browser/hoverWidget';
14
14
import { IContextViewProvider , IDelegate } from 'vs/base/browser/ui/contextview/contextview' ;
15
15
import { DisposableStore , IDisposable , toDisposable } from 'vs/base/common/lifecycle' ;
16
16
import { addDisposableListener , EventType } from 'vs/base/browser/dom' ;
17
+ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
18
+ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent' ;
17
19
18
20
export class HoverService implements IHoverService {
19
21
declare readonly _serviceBrand : undefined ;
@@ -24,7 +26,8 @@ export class HoverService implements IHoverService {
24
26
constructor (
25
27
@IInstantiationService private readonly _instantiationService : IInstantiationService ,
26
28
@IContextViewService private readonly _contextViewService : IContextViewService ,
27
- @IContextMenuService contextMenuService : IContextMenuService
29
+ @IContextMenuService contextMenuService : IContextMenuService ,
30
+ @IKeybindingService private readonly _keybindingService : IKeybindingService
28
31
) {
29
32
contextMenuService . onDidShowContextMenu ( ( ) => this . hideHover ( ) ) ;
30
33
}
@@ -102,6 +105,11 @@ export class HoverService implements IHoverService {
102
105
hover . isLocked = true ;
103
106
return ;
104
107
}
108
+ const event = new StandardKeyboardEvent ( e ) ;
109
+ const keybinding = this . _keybindingService . resolveKeyboardEvent ( event ) ;
110
+ if ( keybinding . getSingleModifierDispatchParts ( ) . some ( value => ! ! value ) || this . _keybindingService . softDispatch ( event , event . target ) ) {
111
+ return ;
112
+ }
105
113
this . hideHover ( ) ;
106
114
}
107
115
0 commit comments