Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dedicated lane for breakpoint decorations #180013

Merged
merged 9 commits into from
Apr 19, 2023

Conversation

joyceerhl
Copy link
Collaborator

@joyceerhl joyceerhl commented Apr 14, 2023

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 joyceerhl self-assigned this Apr 14, 2023
@joyceerhl joyceerhl requested a review from alexdima April 14, 2023 21:35
@joyceerhl joyceerhl marked this pull request as ready for review April 14, 2023 21:35
@vscodenpa 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 joyceerhl force-pushed the dev/joyceerhl/intact-mastodon branch from 5b59ddb to 27f38b2 Compare April 18, 2023 16:49
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

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

Nice! 👏

@alexdima alexdima enabled auto-merge (squash) April 19, 2023 23:03
@alexdima alexdima merged commit b5e90fd into main Apr 19, 2023
@alexdima alexdima deleted the dev/joyceerhl/intact-mastodon branch April 19, 2023 23:26
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2023
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