-
Notifications
You must be signed in to change notification settings - Fork 4k
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 - propg
and propi
snippets
#65979
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
added
the
Community
The pull request was submitted by a contributor who is not a Microsoft employee.
label
Dec 13, 2022
Can I get a review here? @akhera99 ? |
Looking! |
akhera99
approved these changes
Feb 2, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me other than the things noted!
...arpTest/Completion/CompletionProviders/Snippets/CSharpAutoPropertyCompletionProviderTests.cs
Outdated
Show resolved
Hide resolved
...arpTest/Completion/CompletionProviders/Snippets/CSharpAutoPropertyCompletionProviderTests.cs
Outdated
Show resolved
Hide resolved
ghost
added this to the Next milestone
Feb 3, 2023
Merged, thanks for the contribution! |
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Feb 6, 2023
* upstream/main: (547 commits) Add VerifyMethodBody helper as a replacement of VerifyIL (dotnet#66536) don't offer rename for ctor snippet (dotnet#66704) Get `ConditionalAttribute` type only once per compilation Convert language-specific option types to records (dotnet#66633) Enable MSBuild COMM log (dotnet#66708) ⚡️Share AssemblyloadTestFixture on Framework (dotnet#66684) NRT Don't overwrite binary logs in CI (dotnet#66683) Fix 'Generate Enum Member' to work in a 'Color Color' case. Find bitwise operators accessed through logical operators in FAR Semantic snippets - `propg` and `propi` snippets (dotnet#65979) NRT Properly classify aliases in quick info Fix Add tests Add support for finding collection initialiers with FAR Do not suggest replacing lambda with method group if the invoked mehod has `Conditional` attribute Revert "Record added node output states as new (dotnet#61575)" (dotnet#66696) Record added node output states as new (dotnet#61575) Fix formatting issue with convert-to-full-prop ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Abstracted a lot of logic for property generation. In theory, it now allows to generate any kind of auto property, even with different
get
accessor.On top of new abstractions added 2 snippets:
propg
is a replacement of an old snippet. It generates property likepublic int MyProperty { get; private set; }
. The only thing I changed is that when this snippet is executed in interface, it doesn't generateprivate set
accessor, because it leads to compiler error. If a user executespropg
snippet in interface I am 99% sure he wants just aget
accessorpropi
is a new snippet I invented "on the fly". Usage ofinit
properties has grown over years and afterrequired
modifier from C# 11 I assume it would grow even more. I don't see valid reasons against addinginit
-only property snippet thenAbstracted property snippet tests as well. There are now 11 basic cases and an ability to override any special case behaviour like it is done for
propg
inside an interface.I got a bit carried away, so unfortunately the first commit is bit large and could be 100% splitted into smaller parts, sorry for that!