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

SyntaxGenerator.TypeExpression generates different SyntaxNode than parser #43950

Open
AArnott opened this issue May 4, 2020 · 4 comments
Open
Labels
Area-Analyzers Concept-API This issue involves adding, removing, clarification, or modification of an API.
Milestone

Comments

@AArnott
Copy link
Contributor

AArnott commented May 4, 2020

Version Used: Microsoft.CodeAnalysis 3.5.0

Steps to Reproduce:

SyntaxGenerator generator;
SyntaxNode completedTaskExpression = generator.MemberAccessExpression(
   generator.TypeExpression(systemThreadingTasksTask),
   generator.IdentifierName(nameof(Task.CompletedTask)));

Expected Behavior:

completedTaskExpression is a syntax tree made up of nested SimpleMemberAccessExpression instances as the parser would produce.

Actual Behavior:

The syntax tree is instead made up of QualifiedName nodes. This causes code fix test failures when the test framework from roslyn-sdk compares the code fix syntax tree to the parsed syntax tree.

The bug appears in both C# and VB syntax generators.

AArnott added a commit to Evangelink/vs-threading that referenced this issue May 4, 2020
@jinujoseph jinujoseph added Area-Analyzers Concept-API This issue involves adding, removing, clarification, or modification of an API. labels May 7, 2020
@jinujoseph jinujoseph added this to the 16.7 milestone May 7, 2020
@jinujoseph
Copy link
Contributor

cc @mavasani @333fred

@mavasani
Copy link
Contributor

mavasani commented May 7, 2020

Also tagging @CyrusNajmabadi if he is aware of this issue in syntax generators.

@AArnott
Copy link
Contributor Author

AArnott commented May 8, 2020

@CyrusNajmabadi
Copy link
Member

Yes, it's a known issue.

@jinujoseph jinujoseph modified the milestones: 16.7, Backlog Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers Concept-API This issue involves adding, removing, clarification, or modification of an API.
Projects
None yet
Development

No branches or pull requests

4 participants