-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Debugger breakpoints cannot be set with patterns. #9095
Comments
There are no cases in the language today where you can set a breakpoint on a subexpression. You cannot set a breakpoint on a case clause today. So this is a feature request. |
The intent of breakpoint spans is to be able to set them on sequence points. However, the IDE has never been able to get a spec/API from the compiler side to actually specify what the sequence points are. So we've always attempted to reverse engineer it. Any places where we don't support this today are not intentional omissions, but are due to mistakes trying to make these determinations. Other places we support breaking on expressions: the components of a for statement. The expression of foreach statement. Many of the subexpressions inside a query expression (including from/let/join/where/select/orderby/group). |
@CyrusNajmabadi Your lambda body example isn't actually an expression. It's a return statement as far as the debugger is concerned. When reasoning about sequence points you need to reason about the IL not the syntax representation. Currently the debugger doesn't support sequence points at places where evaluation stack is not empty. We would need to spill the stack in order to place a sequence point. This is a non-trivial feature request. |
If you use an expression with a pattern as the body of a lambda, you will still be able to set a breakpoint there. |
To all users it is. And, afaict, from the language perspective it is. I'm not going to get in a semantics argument about this. I'm simply stating how users will want this to behave given the language feature and given how previous language features have worked.
Great. We've been asking for such an API for apprx 10+ years. If you can get us one, i'll move us over to using it. But, for now, we go the syntax route because that's all we have :) Currently:
That's the issue. How we go about actually making this happen is another matter altogether. But this bug is about tracking the feature deficiency vis as vis the breakpoint feature and the patterns feature :) |
@CyrusNajmabadi I'm just pointing out that there is a difference between subexpressions and "top-level" expressions. We support placing breakpoints on the latter but not the former. |
To be clear, I do not expect we will be supporting breakpoints inside patterns. The spec clearly leaves the order of evaluation of patterns unspecified. |
Since similar feature request have been made previously I have filed a more general issue to track feature of placing breakpoint on an arbitrary expression: #22016. I would not hold my breath though expecting this feature to be implemented any time soon. |
x is Point { Left is Constant(0) }
. i.e. on theLeft is Constant 0
line. During debugging i would expect to be able to hover onLeft
and see what it actualy is.The text was updated successfully, but these errors were encountered: