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

EnC: Parameter and property analysis #69774

Merged
merged 14 commits into from
Sep 26, 2023
Merged

Conversation

tmat
Copy link
Member

@tmat tmat commented Aug 31, 2023

Redesigns parameter and property analysis.

The current approach had issues with method bodies not being properly analyzed when parameters change.
Instead of creating containing symbol changes while analyzing parameters the new approach adds these updates in the set of symbol changes compiled early in the semantic analysis. All non-synthesized members then go through the same body update analysis regardless of whether they were caused by a parameter change, an attribute change or a body change.

Fixes #68708

Other fixes and improvements:

  • Allows edits of parameter and return type modifiers. If the actual type doesn't change (e.g. ref changed to out) only an update edit is generated, otherwise delete + insert edits are generated like any other parameter type change.
  • Adds more validation to SemanticEdit constructor to catch issues earlier.
  • Simplifies handling of deleted events and properties in the compiler. The IDE is now expected to create edits for properties and events when they are deleted or inserted, instead of just for the accessors. The compiler doesn't need to infer these edits.
  • Improves diagnostic locations for rude trivia edits.
  • Fixes comparison of object and dynamic in signatures.
  • Fixes partial method analysis - changes in attributes of both partial definition and implementation parts are now accounted for. Fixes EnC: partial definitions can't be ignored in the analysis since they may contribute attributes, Implements, Handles clauses #54800
  • Fixes merging of partial type edits.
  • Fixes matching of renamed parameters via SymbolKey. If a parameter can't be matched by name we match by its ordinal.
  • Fixes EnC: Renaming a property with initializer doesn't work as expected #69216

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 31, 2023
@tmat tmat changed the title Parameters EnC: Parameter and property analysis Sep 11, 2023
@tmat tmat marked this pull request as ready for review September 11, 2023 21:22
@tmat tmat requested review from a team as code owners September 11, 2023 21:22
@tmat
Copy link
Member Author

tmat commented Sep 11, 2023

@davidwengier PTAL
@cston @dotnet/roslyn-compiler for compiler changes

Copy link
Member

@cston cston left a comment

Choose a reason for hiding this comment

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

Compiler changes LGTM.

@jaredpar
Copy link
Member

@tmat consider retargeting to release/dev17.8 before merging as snap has occurred.

Co-authored-by: Jan Jones <jan.jones.cz@gmail.com>
@tmat tmat changed the base branch from main to release/dev17.8 September 26, 2023 19:05
@tmat tmat merged commit 4666ca0 into dotnet:release/dev17.8 Sep 26, 2023
@tmat tmat deleted the Parameters branch September 26, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
5 participants