Render both debug frame indicator and breakpoint (#180448)

This commit is contained in:
Joyce Er 2023-04-20 15:35:46 -07:00 committed by GitHub
parent b58314d377
commit 2c10a8e083
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

View file

@ -229,15 +229,21 @@ export class GlyphMarginOverlay extends DedupOverlay {
if (decorations.length === 0) {
continue;
}
decorations.sort((a, b) => {
// Sort decorations to render in descending order by zIndex
return b.zIndex - a.zIndex;
});
decorations.sort((a, b) => b.zIndex - a.zIndex);
// Render winning decorations with the same zIndex together
const winningDecoration: RenderedDecoration = decorations[0];
const winningDecorationClassNames = [winningDecoration.className];
for (let i = 1; i < decorations.length; i += 1) {
const decoration = decorations[i];
if (decoration.zIndex !== winningDecoration.zIndex) {
break;
}
winningDecorationClassNames.push(decoration.className);
}
const left = (this._glyphMarginLeft + (lane - 1) * this._lineHeight).toString();
css += (
'<div class="cgmr codicon '
+ winningDecoration.className // TODO@joyceerhl Implement overflow for remaining decorations
+ winningDecorationClassNames.join(' ') // TODO@joyceerhl Implement overflow for remaining decorations
+ common
+ 'left:' + left + 'px;"></div>'
);

View file

@ -10,7 +10,7 @@ import { Constants } from 'vs/base/common/uint';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { Range } from 'vs/editor/common/core/range';
import { IEditorContribution } from 'vs/editor/common/editorCommon';
import { IModelDecorationOptions, IModelDeltaDecoration, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';
import { GlyphMarginLane, IModelDecorationOptions, IModelDeltaDecoration, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';
import { localize } from 'vs/nls';
import { ILogService } from 'vs/platform/log/common/log';
import { registerColor } from 'vs/platform/theme/common/colorRegistry';
@ -29,6 +29,8 @@ const stickiness = TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;
const TOP_STACK_FRAME_MARGIN: IModelDecorationOptions = {
description: 'top-stack-frame-margin',
glyphMarginClassName: ThemeIcon.asClassName(debugStackframe),
glyphMargin: { position: GlyphMarginLane.Right },
zIndex: 9999,
stickiness,
overviewRuler: {
position: OverviewRulerLane.Full,
@ -38,6 +40,8 @@ const TOP_STACK_FRAME_MARGIN: IModelDecorationOptions = {
const FOCUSED_STACK_FRAME_MARGIN: IModelDecorationOptions = {
description: 'focused-stack-frame-margin',
glyphMarginClassName: ThemeIcon.asClassName(debugStackframeFocused),
glyphMargin: { position: GlyphMarginLane.Right },
zIndex: 9999,
stickiness,
overviewRuler: {
position: OverviewRulerLane.Full,