Skip to content

Avoid duplicate syntax node callbacks for CompilationUnitSyntax nodes… - #59051

Merged
mavasani merged 1 commit into
dotnet:mainfrom
mavasani:DupeTopLevel
Jan 25, 2022
Merged

mavasani merged 1 commit into
dotnet:mainfrom
mavasani:DupeTopLevel

Conversation

@mavasani

Copy link
Copy Markdown
Contributor

… for files with top level statements

Fixes #58561
Follow-up change to #58482

… for files with top level statements

Fixes dotnet#58561
Follow-up change to dotnet#58482
@mavasani mavasani added this to the 17.2 milestone Jan 25, 2022
@mavasani
mavasani requested review from a team, AlekseyTs and cston January 25, 2022 10:49
@mavasani

Copy link
Copy Markdown
Contributor Author

@Youssef1313

@Youssef1313 Youssef1313 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might be worth adding tests for the nodes checked in:

case PrimaryConstructorBaseTypeSyntax { Parent: BaseListSyntax { Parent: RecordDeclarationSyntax recordDeclaration } } baseType

case ParameterSyntax param when declaredSymbol.Kind == SymbolKind.Property && param.Parent?.Parent is RecordDeclarationSyntax recordDeclaration && recordDeclaration.ParameterList == param.Parent:

If they have issues, we can add a comment in:

to prevent future bugs when new syntax nodes are checked in GetSyntaxNodesToAnalyzeFilter

@mavasani

Copy link
Copy Markdown
Contributor Author

@Youssef1313 Thanks for the suggestions. That would be outside the scope of this PR as it unrelated to top level statements. We can file a separate test issue to increase coverage for those cases.

@AlekseyTs AlekseyTs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM (commit 1)

@mavasani
mavasani merged commit 7cfc9e7 into dotnet:main Jan 25, 2022
@ghost ghost modified the milestones: 17.2, Next Jan 25, 2022
@mavasani
mavasani deleted the DupeTopLevel branch January 25, 2022 20:17
@RikkiGibson RikkiGibson modified the milestones: Next, 17.2.P1 Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate syntax node callbacks for top-level statements

5 participants