Skip to content

EnC: Implement support for editing types with primary constructors#68477

Merged
tmat merged 9 commits intodotnet:mainfrom
tmat:PrimaryCtors
Jun 26, 2023
Merged

EnC: Implement support for editing types with primary constructors#68477
tmat merged 9 commits intodotnet:mainfrom
tmat:PrimaryCtors

Conversation

@tmat
Copy link
Member

@tmat tmat commented Jun 7, 2023

Enables editing types with primary constructors and primary constructors themselves. Enables adding, deleting, renaming and changing types of parameters and switching from primary to non-primary constructor and vice versa.

Fixes various issues with editing record members and implements more unified approach that reduces special casing.

More work is needed to complete the experience and fix issues found during implementation.

Follow up issues:

@ghost ghost added Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 7, 2023
@tmat tmat changed the title Primary ctors EnC: Implement support for editing types with primary constructors Jun 22, 2023
@tmat
Copy link
Member Author

tmat commented Jun 22, 2023

    private bool HasInsertMatchingDelete(ISymbol newSymbol, Compilation oldCompilation, CancellationToken cancellationToken)

This might get simpler if we did two passes on the syntactic edits - first identifies what symbols need to be updated and the second can easily check for delete-insert pairs. Will explore that in a follow up.


Refers to: src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs:6650 in 9283d26. [](commit_id = 9283d26, deletion_comment = False)

@tmat tmat marked this pull request as ready for review June 22, 2023 20:27
@tmat tmat requested review from a team as code owners June 22, 2023 20:27
@tmat
Copy link
Member Author

tmat commented Jun 22, 2023

@davidwengier PTAL
@phil-allen-msft FYI

@tmat tmat enabled auto-merge (squash) June 23, 2023 18:12
@tmat tmat disabled auto-merge June 25, 2023 01:49
@tmat
Copy link
Member Author

tmat commented Jun 26, 2023

@dotnet/roslyn-compiler PTAL at compiler tests.

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

Compiler tests LGTM (commit 8), with some comments for new test helpers.

@tmat tmat merged commit 6af144c into dotnet:main Jun 26, 2023
@tmat tmat deleted the PrimaryCtors branch June 26, 2023 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants