Uh oh!
There was an error while loading. Please reload this page.
Put breakpoints on the line number margin and let a file type restrict them - #357
Draft
danielpourbakhsh wants to merge 1 commit into
Draft
Put breakpoints on the line number margin and let a file type restrict them#357danielpourbakhsh wants to merge 1 commit into
danielpourbakhsh wants to merge 1 commit into
Conversation
danielpourbakhshforce-pushed
the
feature/breakpoint-line-pattern
branch
from
September 4, 2026 20:49
21280bc to
8aa3e64Compare…t them Three changes that belong together, all around the editor margin. Breakpoints move onto the line numbers: a line that carries one shows the dot in place of its number, as Rider and VS Code do. MeasureOverride stays inherited, so the column is exactly as wide as it was without breakpoints. BreakPointMargin stays and is marked obsolete. Nothing in the tree points at it any more, but it is public API, so it goes out with the next batch rather than on its own. It loses a leak on the way: the store outlives the margin, so the subscription moves into OnTextViewChanged and is released when the margin detaches. ExtendedTextEditor handed every margin a new BreakpointStore(), so a breakpoint lived in an object per editor that no debug session ever saw. The margin gets BreakpointStore.Instance instead, which also lets a breakpoint survive closing and reopening its file. ITypeAssistance gains BreakPointLinePattern, a regular expression whose null means no restriction, so a language without a rule notices nothing. Not every line of every language can carry a breakpoint: in assembly one on a data word does not fail but slips, because the line table has no entry for it and the backend moves it to the next line that has code. The rule travels as data and not as a predicate - a callback would put the core into plugin code on every click and every pointer move over the margin. Removing a breakpoint always stays possible, and the preview dot appears only where a click would take effect. SetEnableBreakpoints therefore takes the ITypeAssistance instead of a bool: the margin needs the flag and the pattern as a unit. BreakPoint carries whether the target armed it, and the margin draws a grey hollow ring when it did not, inside the same diameter so the column keeps its width. The store raises VerificationChanged for that, because the change alters no collection and a margin listening only to CollectionChanged would never repaint. The store also carries whether the target is running; while it is, the margin takes no breakpoint in either direction and says why. Both stay inert until a debug session sets them.
danielpourbakhshforce-pushed
the
feature/breakpoint-line-pattern
branch
from
September 4, 2026 20:52
8aa3e64 to
eb55a47Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three changes around the editor margin.
Breakpoints move onto the line numbers. A line that carries one shows the dot in place of its number, as Rider and VS Code do.
MeasureOverridestays inherited, so the column is exactly as wide as it was before.BreakPointMarginstays and is marked[Obsolete]— nothing in the tree points at it any more, but it is public API. It loses a leak on the way: the store outlives the margin, so the subscription moves intoOnTextViewChangedand is released when the margin detaches.One store instead of one per editor.
ExtendedTextEditorhanded every margin anew BreakpointStore(), so a breakpoint lived in an object that no debug session ever saw. The margin getsBreakpointStore.Instancenow, and a breakpoint survives closing and reopening its file.A file type can restrict which lines take a breakpoint.
ITypeAssistance.BreakPointLinePatternis a regular expression,nullmeaning no restriction — a language without a rule notices nothing of this. Assembly needs it: a breakpoint on a data word does not fail, it slips, because the line table has no entry for it and the backend moves it to the next line that has code. The rule travels as data and not as a predicate, so the core never calls into plugin code on a click or a pointer move. Removing a breakpoint always stays possible, and the preview dot appears only where a click would take effect.SetEnableBreakpointstakes theITypeAssistanceinstead of a bool, because the margin needs the flag and the pattern as a unit.Also in here:
BreakPointrecords whether the target armed it and the margin draws a grey hollow ring when it did not; the store raisesVerificationChangedfor that, since the change alters no collection and a margin listening only toCollectionChangedwould never repaint. The store also says whether the target is running — while it is, the margin takes no breakpoint in either direction and says why. Both stay inert until a debug session sets them.Builds on its own against
main.