-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Breakpoint and instrumentation support for new C# 7 language features #14535
Conversation
…or, dtor, and accessors Fixes dotnet#14438
👍 so far. I suggest merging now and opening new PR for the rest of the changes. Although related they are of different nature. |
@dotnet/roslyn-compiler @tmat @JohnHamby This PR adds sequence points, IDE breakpoint support, and instrumentation for all new language constructs. Please review. |
The changes for dynamic analysis look good to me. Thanks!!! |
@CyrusNajmabadi Can you please review this from an IDE perspective? |
case SyntaxKind.DestructorDeclaration: | ||
return TryCreateSpanForNode(((DestructorDeclarationSyntax)node).Body, position); | ||
var methodDeclaration = (BaseMethodDeclarationSyntax)node; | ||
return (methodDeclaration.Body != null) ? CreateSpanForBlock(methodDeclaration.Body, position) : methodDeclaration.ExpressionBody?.Expression.Span; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also add support for the expression body on a constructor?
@@ -284,6 +291,12 @@ private static int GetEndPosition(SyntaxNodeOrToken nodeOrToken) | |||
var groupClause = (GroupClauseSyntax)node; | |||
return TryCreateSpanForNode(groupClause.GroupExpression, position); | |||
|
|||
case SyntaxKind.LocalFunctionStatement: | |||
var localFunction = (LocalFunctionStatementSyntax)node; | |||
return (localFunction.Body != null) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- unnecessary parens.
- ? and : go on the next line.
@@ -308,12 +321,18 @@ private static TextSpan CreateSpanForConstructorDeclaration(ConstructorDeclarati | |||
return CreateSpanForConstructorInitializer(constructorSyntax.Initializer); | |||
} | |||
|
|||
if (constructorSyntax.ExpressionBody != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh. n/m. you did do it.
minor nits. otherwise LGTM> |
LGTM |
@MattGertz @jaredpar I forgot to get approval for this RC change before integrating. This fixes sequence points, breakpoints, and instrumentation for all new language constructs. |
CC @Pilchie and @ManishJayaswal who are approvals today. |
Approved (after the fact). |
This is a work in progress. I will send it out for review when all of the relevant issues have been addressed. The issues that will be addressed in this PR (ideally one commit per issue) are: