未验证 提交 0b0b0f82 编写于 作者: I Isidor Nikolic 提交者: GitHub

Merge pull request #48747 from Microsoft/isidorn/nonDebugHovers

debug: debug.hideNonDebugHovers
......@@ -351,6 +351,7 @@ export interface IDebugConfiguration {
showInStatusBar: 'never' | 'always' | 'onFirstSessionStart';
internalConsoleOptions: 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart';
extensionHostDebugAdapter: boolean;
enableAllHovers: boolean;
}
export interface IGlobalConfig {
......
......@@ -205,6 +205,11 @@ configurationRegistry.registerConfiguration({
default: 'openOnFirstSessionStart',
description: nls.localize('openDebug', "Controls whether debug view should be open on debugging session start.")
},
'debug.enableAllHovers': {
type: 'boolean',
description: nls.localize({ comment: ['This is the description for a setting'], key: 'enableAllHovers' }, "Controls if the non debug hovers should be enabled while debugging. If true the hover providers will be called to provide a hover. Regular hovers will not be shown even if this setting is true."),
default: false
},
'launch': {
type: 'object',
description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces"),
......
......@@ -45,6 +45,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ContextSubMenu } from 'vs/base/browser/contextmenu';
import { memoize } from 'vs/base/common/decorators';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { getHover } from 'vs/editor/contrib/hover/getHover';
const HOVER_DELAY = 300;
const LAUNCH_JSON_REGEX = /launch\.json$/;
......@@ -57,6 +58,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private toDispose: lifecycle.IDisposable[];
private hoverWidget: DebugHoverWidget;
private nonDebugHoverPosition: Position;
private hoverRange: Range;
private breakpointHintDecoration: string[];
......@@ -239,6 +241,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this.toDispose.push(this.editor.onMouseDown((e: IEditorMouseEvent) => this.onEditorMouseDown(e)));
this.toDispose.push(this.editor.onMouseMove((e: IEditorMouseEvent) => this.onEditorMouseMove(e)));
this.toDispose.push(this.editor.onMouseLeave((e: IEditorMouseEvent) => {
this.provideNonDebugHoverScheduler.cancel();
const hoverDomNode = this.hoverWidget.getDomNode();
if (!hoverDomNode) {
return;
......@@ -332,12 +335,28 @@ export class DebugEditorContribution implements IDebugEditorContribution {
@memoize
private get showHoverScheduler(): RunOnceScheduler {
return new RunOnceScheduler(() => this.showHover(this.hoverRange, false), HOVER_DELAY);
const scheduler = new RunOnceScheduler(() => this.showHover(this.hoverRange, false), HOVER_DELAY);
this.toDispose.push(scheduler);
return scheduler;
}
@memoize
private get hideHoverScheduler(): RunOnceScheduler {
return new RunOnceScheduler(() => this.hoverWidget.hide(), HOVER_DELAY);
const scheduler = new RunOnceScheduler(() => this.hoverWidget.hide(), HOVER_DELAY);
this.toDispose.push(scheduler);
return scheduler;
}
@memoize
private get provideNonDebugHoverScheduler(): RunOnceScheduler {
const scheduler = new RunOnceScheduler(() => {
getHover(this.editor.getModel(), this.nonDebugHoverPosition);
}, HOVER_DELAY);
this.toDispose.push(scheduler);
return scheduler;
}
private hideHoverWidget(): void {
......@@ -345,6 +364,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this.hideHoverScheduler.schedule();
}
this.showHoverScheduler.cancel();
this.provideNonDebugHoverScheduler.cancel();
}
// hover business
......@@ -362,6 +382,10 @@ export class DebugEditorContribution implements IDebugEditorContribution {
return;
}
if (!this.configurationService.getValue<IDebugConfiguration>('debug').enableAllHovers) {
this.nonDebugHoverPosition = mouseEvent.target.position;
this.provideNonDebugHoverScheduler.schedule();
}
const targetType = mouseEvent.target.type;
const stopKey = env.isMacintosh ? 'metaKey' : 'ctrlKey';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册