Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support init accessor in CSharpSyntaxFacts#48137

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sharwell merged 8 commits intodotnet:masterfromYoussef1313:patch-40
Oct 14, 2020

Conversation

@Youssef1313
Copy link
Member

@Youssef1313Youssef1313 commentedSep 28, 2020
edited
Loading

Prefer squash/merge.

@Youssef1313Youssef1313 requested a review froma team as acode ownerSeptember 28, 2020 23:10
@jinujosephjinujoseph added Area-IDE CommunityThe pull request was submitted by a contributor who is not a Microsoft employee. labelsSep 29, 2020
Copy link
Member

@davidwengierdavidwengier left a comment

Choose a reason for hiding this comment

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

This change makes sense, but I don't see too much value in aggressively updating all of these APIs without known consuming use cases, or tests (or both!).

@Youssef1313
Copy link
MemberAuthor

@davidwengier I looked at the usages of one of these changes, and it ends up being used for the public API SyntaxGenerator.WithAccessibility.

It may not be needed internally for roslyncurrently. But consumers of this API should get the desired behavior.

I haven't confirmed whether the other change ends up being used in a public API or not.

@CyrusNajmabadi
Copy link
Member

and it ends up being used for the public API SyntaxGenerator.WithAccessibility.

THis is a testable scenario :) Plz add test.

@davidwengier
Copy link
Member

It may not be needed internally for roslyn currently. But consumers of this API should get the desired behavior.

I don't disagree, but there could also be issues if things light up in areas that they were never intended to, or otherwise don't support. Hopefully, of course, the existing test coverage validates that :)

@Youssef1313
Copy link
MemberAuthor

@davidwengier Got it. Let me check what tests will fail in#48158 and update these tests for init accessor in this PR.

caseSyntaxKind.PropertyDeclaration:
caseSyntaxKind.GetAccessorDeclaration:
caseSyntaxKind.SetAccessorDeclaration:
caseSyntaxKind.InitAccessorDeclaration:
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@davidwengier I removed both GetAccessorDeclaration and InitAccessorDeclaration in a draft. There are no test failures. So the current tests, unfortunately, doesn't cover those.

The usages that depend on this method are in:

  • CodeLens\CodeLensReferencesService.cs (there is a call tosyntaxFactsService.IsDeclaration(node))
  • CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (there is a call to.DescendantNodes(n => !syntaxFacts.IsDeclaration(n)))

Unlike the other change, I'm not able to guess the effect of this change.
I'll try to change the method to onlyreturn false in the draft in a hope to see test failures (i.e. other switch arms are tested).

caseSyntaxKind.PropertyDeclaration:
caseSyntaxKind.GetAccessorDeclaration:
caseSyntaxKind.SetAccessorDeclaration:
caseSyntaxKind.InitAccessorDeclaration:
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I don't think it's a good idea to update this one without knowing the change it introduce.

Thiswhole method isn't covered in the tests. See how#48158 is green.

@Youssef1313
Copy link
MemberAuthor

@CyrusNajmabadi@davidwengier Is this ready to merge?

@davidwengier
Copy link
Member

@sharwell

@sharwellsharwell merged commita09a5a2 intodotnet:masterOct 14, 2020
@ghostghost added this to theNext milestoneOct 14, 2020
@Youssef1313Youssef1313 deleted the patch-40 branchOctober 14, 2020 13:17
@allisonchouallisonchou modified the milestones:Next,16.9.P2Nov 24, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@davidwengierdavidwengierdavidwengier approved these changes

@CyrusNajmabadiCyrusNajmabadiCyrusNajmabadi approved these changes

+1 more reviewer

@sharwellsharwellsharwell approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@sharwellsharwell

Labels

Area-IDECommunityThe pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Milestone

16.9.P2

Development

Successfully merging this pull request may close these issues.

6 participants

@Youssef1313@CyrusNajmabadi@davidwengier@sharwell@jinujoseph@allisonchou

[8]ページ先頭

©2009-2025 Movatter.jp