调试状态下,当断点图标显示成白色圆圈线时,增加显示相应悬浮窗口提示.

This commit is contained in:
chriswang521 2023-11-14 15:58:40 +08:00
parent 5df518aac9
commit 9ec3e5a9c9
1 changed files with 18 additions and 0 deletions

View File

@ -224,6 +224,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private altPressed = false; private altPressed = false;
private oldDecorations = this.editor.createDecorationsCollection(); private oldDecorations = this.editor.createDecorationsCollection();
private readonly debounceInfo: IFeatureDebounceInformation; private readonly debounceInfo: IFeatureDebounceInformation;
private gutterIsHovered = false;
constructor( constructor(
private editor: ICodeEditor, private editor: ICodeEditor,
@ -433,6 +434,14 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this.hideHoverWidget(); this.hideHoverWidget();
} }
private updateHoverConfiguration(): void {
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
const model = this.editor.getModel();
if (model) {
this.applyHoverConfiguration(model, stackFrame);
}
}
private onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { private onEditorMouseMove(mouseEvent: IEditorMouseEvent): void {
if (this.debugService.state !== State.Stopped) { if (this.debugService.state !== State.Stopped) {
return; return;
@ -440,6 +449,15 @@ export class DebugEditorContribution implements IDebugEditorContribution {
const target = mouseEvent.target; const target = mouseEvent.target;
const stopKey = env.isMacintosh ? 'metaKey' : 'ctrlKey'; const stopKey = env.isMacintosh ? 'metaKey' : 'ctrlKey';
if (!this.altPressed) {
if (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN) {
this.editor.updateOptions({ hover: { enabled: true } });
this.gutterIsHovered = true;
} else if (this.gutterIsHovered) {
this.gutterIsHovered = false;
this.updateHoverConfiguration();
}
}
if (target.type === MouseTargetType.CONTENT_WIDGET && target.detail === DebugHoverWidget.ID && !(<any>mouseEvent.event)[stopKey]) { if (target.type === MouseTargetType.CONTENT_WIDGET && target.detail === DebugHoverWidget.ID && !(<any>mouseEvent.event)[stopKey]) {
// mouse moved on top of debug hover widget // mouse moved on top of debug hover widget