Move Static Members: Show destination name#55650
Merged
Soreloser2 merged 7 commits intodotnet:features/MoveStaticMembersfrom Aug 27, 2021
Merged
Move Static Members: Show destination name#55650Soreloser2 merged 7 commits intodotnet:features/MoveStaticMembersfrom
Soreloser2 merged 7 commits intodotnet:features/MoveStaticMembersfrom
Conversation
added 3 commits
August 13, 2021 16:22
Discovered an issue with duplicating a root namespace, not fixed here.
… on reference refactoring, and is not merged with the reference refactoring branch currently
…ded, refactored options getting for tests
Closed
JoeRobich
approved these changes
Aug 18, 2021
src/VisualStudio/Core/Def/Implementation/MoveStaticMembers/MoveStaticMembersDialog.xaml
Outdated
Show resolved
Hide resolved
JoeRobich
approved these changes
Aug 27, 2021
Soreloser2
added a commit
that referenced
this pull request
Sep 2, 2021
* Move static members to a New Type (#55204) * 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> * Test framework movement (#55586) * 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) * WIP untested, refactoring references to moved members * Added tests for refactoring and extensions for C#. Will add tests for refactoring in VB, but unsure about extensions since we do not generate a module. * Make module now for VB, add refactor tests * Updated C# tests to a new framework. May need to rewrite VB test file in C# to set some readonly properties * Changed VB tests to new Framework. Revealed an error in the way vb members are moved * Fixed VB tests by removing shared modifier when moving to a module * Fixed more tests to account for member spacing innaccuracy * Refactored tests, added vb extension tests * Added tests for file banner and moving from a static class/module * Added tests to enure operator and static constructors are not able to be selected or trigger refactoring * Make service field readonly * Fixed some code warnings and reverted to before member refactoring, removing a few tests in the process Co-authored-by: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com> * Fix api change * Update FeatureResources xlf * Changed tests to use new default accessibility modifier for new documents * Move Static Members: Refactor moved member references (#55581) * 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) * WIP untested, refactoring references to moved members * Added tests for refactoring and extensions for C#. Will add tests for refactoring in VB, but unsure about extensions since we do not generate a module. * Make module now for VB, add refactor tests * Updated C# tests to a new framework. May need to rewrite VB test file in C# to set some readonly properties * Changed VB tests to new Framework. Revealed an error in the way vb members are moved * Fixed VB tests by removing shared modifier when moving to a module * Fixed more tests to account for member spacing innaccuracy * Refactored tests, added vb extension tests * Added tests for file banner and moving from a static class/module * Added tests to enure operator and static constructors are not able to be selected or trigger refactoring * Make service field readonly * Added support for alias refactoring + tests * Refactored references on source type. Added simplifier annotation to remove unnecessary qualifications. * Now correctly refactors references using symbol annotations and expansions for extension methods, should address conflicting imports issues * Fixed simplifier incorrectly simplifying references inside moved members * Added more tests, generic class refactoring currently isn't working * Added support for generic class member access, copying only the type arguments we moved from the methods * Fixed tests by adding accesibility modifier * Addressed feedback, fixed multiple extension method bug by using docEditor * Changed new type to create the same kind (class/Module) as the source type, refactored tests Co-authored-by: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com> * Move Static Members: Show destination name (#55650) * Now shows the fully qualified name when creating a new type. Discovered an issue with duplicating a root namespace, not fixed here. * Reformatted new type name message * Write tests that utilize root namespace. One is failing as it depends on reference refactoring, and is not merged with the reference refactoring branch currently * Changed way file names are generated so added namespaces aren't included, refactored options getting for tests * Moved destination selection box a little bit to the right to align with message * Changed tests to reflect module changes * Removed theming (#56013) * Move static members Root Namespace + OK button enabled fixes (#56035) * Added tests and changed root namespace filtering. Removes crash bug. * Disabled "OK" button when destination is invalid. Added ability to select no members (will create a new empty class) Co-authored-by: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com> Co-authored-by: Joey Robichaud <jorobich@microsoft.com> Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com> Co-authored-by: dotnet bot <dotnet-bot@dotnetfoundation.org>
This file contains hidden or 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
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.
Should be merged after #55581, as there is a test that depends on reference refactoring. Adds a destination name preview containing the fully qualified namespace, and fixes an error regarding the root namespace in VB.
Also slightly rewrites testing framework to so that ViewModel tests use options service code to get the view model
Here is a demo of the current UI (using a VB file with a root namespace of
ClassLibrary2)NewDestinationDisplayDemo.mp4