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

Breakpoint and instrumentation support for new C# 7 language features #14535

Merged
merged 6 commits into from
Oct 18, 2016

Conversation

gafter
Copy link
Member

@gafter gafter commented Oct 14, 2016

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:

@gafter gafter added Area-Compilers PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. labels Oct 14, 2016
@gafter gafter added this to the 2.0 (RC) milestone Oct 14, 2016
@gafter gafter self-assigned this Oct 14, 2016
@tmat
Copy link
Member

tmat commented Oct 17, 2016

👍 so far. I suggest merging now and opening new PR for the rest of the changes. Although related they are of different nature.

@gafter gafter added Feature Request 4 - In Review A fix for the issue is submitted for review. and removed PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. labels Oct 17, 2016
@gafter
Copy link
Member Author

gafter commented Oct 17, 2016

@dotnet/roslyn-compiler @tmat @JohnHamby This PR adds sequence points, IDE breakpoint support, and instrumentation for all new language constructs. Please review.

@msJohnHamby
Copy link
Contributor

The changes for dynamic analysis look good to me. Thanks!!!

@gafter
Copy link
Member Author

gafter commented Oct 18, 2016

@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;
Copy link
Member

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) ?
Copy link
Member

Choose a reason for hiding this comment

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

  1. unnecessary parens.
  2. ? and : go on the next line.

@@ -308,12 +321,18 @@ private static TextSpan CreateSpanForConstructorDeclaration(ConstructorDeclarati
return CreateSpanForConstructorInitializer(constructorSyntax.Initializer);
}

if (constructorSyntax.ExpressionBody != null)
Copy link
Member

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.

@CyrusNajmabadi
Copy link
Member

minor nits. otherwise LGTM>

@AlekseyTs
Copy link
Contributor

LGTM

@gafter gafter merged commit 61cfaca into dotnet:dev15-rc Oct 18, 2016
@gafter
Copy link
Member Author

gafter commented Oct 18, 2016

@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.

@jaredpar
Copy link
Member

CC @Pilchie and @ManishJayaswal who are approvals today.

@Pilchie
Copy link
Member

Pilchie commented Oct 18, 2016

Approved (after the fact).

@gafter gafter added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Oct 18, 2016
@gafter gafter removed the 4 - In Review A fix for the issue is submitted for review. label Oct 18, 2016
@gafter gafter deleted the dev15-rc-instrumentation branch May 24, 2018 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved to merge Area-Compilers cla-already-signed Feature Request Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants