Skip to content

Support dedicated lane for breakpoint decorations - #180013

Merged
Alexandru Dima (alexdima) merged 9 commits into
mainfrom
dev/joyceerhl/intact-mastodon
Apr 19, 2023
Merged

Alexandru Dima (alexdima) merged 9 commits into
mainfrom
dev/joyceerhl/intact-mastodon

Conversation

@joyceerhl

@joyceerhl Joyce Er (joyceerhl) commented Apr 14, 2023 •

Copy link
Copy Markdown
Contributor

For #179725

This PR adds support for a dedicated breakpoint decoration lane, so that you can always see both breakpoints and at least one other decoration. The behavior implemented is as follows:

  • When there are no decorations of any sort in an editor, one lane is rendered
  • When there are only breakpoints, one lane is rendered
  • When there are only non-breakpoint decorations, one lane is rendered and the zIndex for the decoration is used to determine which one is rendered (until we have overflow implemented)
  • When there are both breakpoints and decorations but they do not appear on the same line, one lane is rendered
  • When there are both breakpoints and decorations and they appear at least once on the same line, two lanes are rendered
dedicated-debug-lane.mp4

Notes:

  1. I suspect we actually want to have two lanes if there are only non-breakpoint decorations and breakpoints can be set, in order to avoid resizing the editor gutter and breaking muscle memory for rendering the breakpoint hint on a line that already has a non-breakpoint decoration. However, this will involve some more changes to the breakpointEditorContribution.ts, which currently doesn't render the breakpoint hint on hover if there are any other decorations on the same line, so I figured I'd implement that in a separate PR.
  2. I have implemented the breakpoint to always appear in the rightmost lane for now (rationale being that it's closer to the line number). Let me know if you think it should actually appear in the leftmost lane.
  3. I've left open the possibility of showing more than two lanes, in case users want the margin to resize to accommodate unlimited decorations. However I don't intend to expose a setting for this until we receive further feedback to that effect.

@joyceerhl Joyce Er (joyceerhl) self-assigned this Apr 14, 2023
@joyceerhl
Joyce Er (joyceerhl) marked this pull request as ready for review April 14, 2023 21:35
@vscodenpa VS Code Bot (vscodenpa) added this to the April 2023 milestone Apr 14, 2023
Base automatically changed from dev/joyceerhl/troubled-iguana to main April 18, 2023 12:53
@joyceerhl
Joyce Er (joyceerhl) force-pushed the dev/joyceerhl/intact-mastodon branch from 5b59ddb to 27f38b2 Compare April 18, 2023 16:49

@alexdima Alexandru Dima (alexdima) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👏

@alexdima
Alexandru Dima (alexdima) enabled auto-merge (squash) April 19, 2023 23:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants