-
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
Add Move Static Member To Existing Type #61519
Conversation
…ot working bc of a few bugs
No behavior created after dialog exited Still working on destination type/filename selection formatting
…ox, assuming new class (c# only, no automated tests yet)
…as the semantic model cannot get the symbol for VB declared fields from the node. Fields are added as part of the dialog box however.
…oveStaticMembers Merge main to features/MoveStaticMembers
…ling due to the way AddMembers reuses syntax. Fixed a few bugs
…er2/roslyn into MoveStaticMembersNewType
…icMembersNewType
… refactoring in VB, but unsure about extensions since we do not generate a module.
* WIP Dialog work * Rename + refactor * WIP rename, add xaml elements * WIP dialog/VM work * WIP, Reverted Pull Member up change, updated destination selection, not working bc of a few bugs * Refactoring provider now shows up and launches dialog No behavior created after dialog exited Still working on destination type/filename selection formatting * Rename/Refactor name to MoveStaticMembers. Feature working with textbox, assuming new class (c# only, no automated tests yet) * Accessibility, theming, resources, and sizing retweaks * Added VB refactoring provider. Currently does not trigger on fields, as the semantic model cannot get the symbol for VB declared fields from the node. Fields are added as part of the dialog box however. * Addressing some of the feedback * Fixed fields not being able to trigger dialog in VB * Remove unnecessary usings * Fixed nullable error * Added test classes for view model and C# impl, made VB able to get dependents * Finished Writing impl tests for C# and VB. VB tests are currently failing due to the way AddMembers reuses syntax. Fixed a few bugs * Fixed resources and removed nullable disable annotation * Adress small feedback points * Small test fix. Works with generator changes (sepearate PR) Co-authored-by: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com>
… in C# to set some readonly properties
…m/ryzngard/roslyn into features/move_static_existing
src/EditorFeatures/TestUtilities/MoveStaticMembers/TestMoveStaticMembersService.cs
Outdated
Show resolved
Hide resolved
var initialDestinationMarkup = @" | ||
public class Class1Helpers | ||
{ | ||
}"; |
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.
Would be interesting to have the destination use a different namespace to see the initial source document updated with either a using directive or qualified name.
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.
That's a great idea, and I think good for follow up as a small fix/bug fix.
src/VisualStudio/Core/Def/MoveStaticMembers/MoveStaticMembersDialog.xaml
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/MoveStaticMembers/MoveStaticMembersDialogViewModel.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/MoveStaticMembers/MoveStaticMembersOptions.cs
Outdated
Show resolved
Hide resolved
…ticMembersService.cs Co-authored-by: Joey Robichaud <[email protected]>
This reverts commit 74c3abe.
This reverts commit 6e46737.
…ures/semi-auto-props * upstream/main: (887 commits) Ensure elastic trivia for reusable syntax in field generator (#62346) Fix typos in the incremental generators doc (#62343) Theme The "Generate Overrides" Dialog (#62244) Walk green-nodes in incremental-generator attribute-finding path (#62295) Cache the hash in compilation options (#62289) Respect dotnet_style_namespace_match_folder (#62310) Remove unreachable condition Specify builder capacities in incremental generation to avoid wasted scratch arrays. (#62285) Skip the test (#62287) Revert "Revert "Add Move Static Member To Existing Type (#61519)"" (#62284) Highlight the search term in the options page (#61301) Synch handlers with fix (#62209) Disable integration tests Fix Set capacity of builder to avoid expensive garbage. Add public APIs for opened and closed event handling for non-source documents Handle possible null symbols in `getAttributeTarget` (#62137) Perform a lookahead rather than a parsing attempt in order to determine if current token starts a conversion operator declaration. (#62240) Fix a race in CachingDictionary. (#62248) Simplify ...
Ports #56131 and updates slightly. I did my best to keep the initial intent of the PR because @Soreloser2 did a great job with it :)
From the original PR:
Adds support for moving static members to existing types.
Searches for types that:
Ns.Class1
as our original type, thenNs.Class2
andNs.ExtraNs.Class3
will show, butDifferentNs.Class4
will notTypes will be displayed with their full namespace qualification, any generic type parameters, and their file name (in case of partially declared types)
The user can select a pre-defined type using the dropdown menu, or type in a new, separate non-conflicting type to create a new type in a new file. New files will have an icon as well as a preview of the new type name, similar to the previous iteration of this feature. Currently existing types do not have any icon, but this is open to change based on feedback.
ExistingTypeDemo.mp4