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: Implement support for editing types with primary constructors #68477

Merged
merged 9 commits into from
Jun 26, 2023

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:

@dotnet-issue-labeler dotnet-issue-labeler bot 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