mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 15:40:41 -05:00
@@ -113,6 +113,7 @@ export class TreeView extends Disposable implements ITreeView {
|
||||
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService,
|
||||
@IHoverService private readonly hoverService: IHoverService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService
|
||||
) {
|
||||
super();
|
||||
@@ -434,6 +435,7 @@ export class TreeView extends Disposable implements ITreeView {
|
||||
}
|
||||
|
||||
private onContextMenu(treeMenus: TreeMenus, treeEvent: ITreeContextMenuEvent<ITreeItem>, actionRunner: MultipleSelectionActionRunner): void {
|
||||
this.hoverService.hideHover();
|
||||
const node: ITreeItem | null = treeEvent.element;
|
||||
if (node === null) {
|
||||
return;
|
||||
@@ -1026,7 +1028,7 @@ export class CustomTreeView extends TreeView {
|
||||
@IHoverService hoverService: IHoverService,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
) {
|
||||
super(id, title, themeService, instantiationService, commandService, configurationService, progressService, contextMenuService, keybindingService, notificationService, viewDescriptorService, contextKeyService);
|
||||
super(id, title, themeService, instantiationService, commandService, configurationService, progressService, contextMenuService, keybindingService, notificationService, viewDescriptorService, hoverService, contextKeyService);
|
||||
}
|
||||
|
||||
setVisibility(isVisible: boolean): void {
|
||||
|
||||
@@ -30,6 +30,11 @@ export interface IHoverService {
|
||||
* ```
|
||||
*/
|
||||
showHover(options: IHoverOptions, focus?: boolean): IDisposable | undefined;
|
||||
|
||||
/**
|
||||
* Hides the hover if it was visible.
|
||||
*/
|
||||
hideHover(): void;
|
||||
}
|
||||
|
||||
export interface IHoverOptions {
|
||||
|
||||
@@ -47,6 +47,14 @@ export class HoverService implements IHoverService {
|
||||
return hover;
|
||||
}
|
||||
|
||||
hideHover(): void {
|
||||
if (!this._currentHoverOptions) {
|
||||
return;
|
||||
}
|
||||
this._currentHoverOptions = undefined;
|
||||
this._contextViewService.hideContextView();
|
||||
}
|
||||
|
||||
private _intersectionChange(entries: IntersectionObserverEntry[], hover: IDisposable): void {
|
||||
const entry = entries[entries.length - 1];
|
||||
if (!entry.isIntersecting) {
|
||||
|
||||
Reference in New Issue
Block a user