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

Semantic snippets: Work on ctor snippet after modifiers #71869

Merged
merged 6 commits into from
Feb 14, 2024
Merged

Semantic snippets: Work on ctor snippet after modifiers #71869

merged 6 commits into from
Feb 14, 2024

Conversation

DoctorKrolic
Copy link
Contributor

Originally I wanted to make ctor snippet appear after accessibility modifiers and static keyword, so user can type e.g. private ctor and immediately get private constructor instead of either typing it all himself or changing accessibility modifier after activating ctor snippet. Part of that work required to move GenerateSnippetTextChangeAsync to CSharpConstructorSnippetProvider since PrecedingModifiers are only available on C# level. I refactored the method to use more C#-specific APIs to get other things, e.g. used CSharpSyntaxContext.ContainingTypeDeclaration instead of searching for node ourselves. As it turned out, these APIs are smarter and handle some edge cases, that were not handled before. So this PR also:
Fixes #68176
Fixes AB#1818584
Closes #68177 (as a replacement)

@DoctorKrolic DoctorKrolic requested a review from a team as a code owner January 30, 2024 09:04
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 30, 2024
@ghost ghost added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Jan 30, 2024
@DoctorKrolic DoctorKrolic marked this pull request as draft January 30, 2024 15:46
@DoctorKrolic
Copy link
Contributor Author

@sharwell What are we gonna do with this PR?

@sharwell
Copy link
Member

sharwell commented Feb 1, 2024

@DoctorKrolic My PR to fix this is going to be in #71872. I was delayed by the unexpected failure in the integration test pipeline but should be able to move it forward over the next few hours.

@DoctorKrolic
Copy link
Contributor Author

My PR to fix this is going to be in #71872

I'll wait for it to merge first and then fix this one considering its changes. I'll appreciate if you prioritize it a bit to unblock me though

@DoctorKrolic DoctorKrolic marked this pull request as ready for review February 13, 2024 11:55
@akhera99 akhera99 merged commit 2660d9c into dotnet:main Feb 14, 2024
27 checks passed
@ghost ghost added this to the Next milestone Feb 14, 2024
@akhera99
Copy link
Member

Looks good, thanks for the contribution @DoctorKrolic!

@DoctorKrolic DoctorKrolic deleted the ctor-after-modifiers branch February 14, 2024 20:09
@jjonescz jjonescz removed this from the Next milestone Feb 27, 2024
@jjonescz jjonescz added this to the 17.10 P2 milestone Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. 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.

'ctor' snippet generate wrong name in nested class
4 participants