Skip to content

Commit

Permalink
Render both debug frame indicator and breakpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl committed Apr 20, 2023
1 parent 208bbb0 commit dea706f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit dea706f

Please sign in to comment.