From 9ec3e5a9c99c18214636df30b3541045e43a2542 Mon Sep 17 00:00:00 2001 From: chriswang521 Date: Tue, 14 Nov 2023 15:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=8A=B6=E6=80=81=E4=B8=8B,?= =?UTF-8?q?=E5=BD=93=E6=96=AD=E7=82=B9=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=88=90=E7=99=BD=E8=89=B2=E5=9C=86=E5=9C=88=E7=BA=BF=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E7=9B=B8=E5=BA=94?= =?UTF-8?q?=E6=82=AC=E6=B5=AE=E7=AA=97=E5=8F=A3=E6=8F=90=E7=A4=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../debug/browser/debugEditorContribution.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts b/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts index 48a00296..de2de802 100644 --- a/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts +++ b/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts @@ -224,6 +224,7 @@ export class DebugEditorContribution implements IDebugEditorContribution { private altPressed = false; private oldDecorations = this.editor.createDecorationsCollection(); private readonly debounceInfo: IFeatureDebounceInformation; + private gutterIsHovered = false; constructor( private editor: ICodeEditor, @@ -433,6 +434,14 @@ export class DebugEditorContribution implements IDebugEditorContribution { 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 { if (this.debugService.state !== State.Stopped) { return; @@ -440,6 +449,15 @@ export class DebugEditorContribution implements IDebugEditorContribution { const target = mouseEvent.target; 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 && !(mouseEvent.event)[stopKey]) { // mouse moved on top of debug hover widget