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

Add Move Static Member To Existing Type #61519

Merged
merged 81 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
952d435
WIP Dialog work
Jul 14, 2021
3eb8edb
Rename + refactor
Jul 14, 2021
44c49b6
WIP rename, add xaml elements
Jul 16, 2021
a36baf8
WIP dialog/VM work
Jul 20, 2021
ddfbb13
WIP, Reverted Pull Member up change, updated destination selection, n…
Jul 23, 2021
1cb6b2f
Refactoring provider now shows up and launches dialog
Jul 27, 2021
5b188e6
Rename/Refactor name to MoveStaticMembers. Feature working with textb…
Jul 28, 2021
b87c671
Accessibility, theming, resources, and sizing retweaks
Jul 29, 2021
f215bef
Added VB refactoring provider. Currently does not trigger on fields, …
Jul 30, 2021
dfe55f5
Addressing some of the feedback
Jul 30, 2021
50ff662
Fixed fields not being able to trigger dialog in VB
Jul 30, 2021
5944640
Remove unnecessary usings
Jul 30, 2021
9af7a12
Fixed nullable error
Jul 31, 2021
bc4bfef
Merge pull request #55324 from dotnet/merges/main-to-features/MoveSta…
Aug 1, 2021
75cd384
Added test classes for view model and C# impl, made VB able to get de…
Aug 3, 2021
0fcc387
Merge branch 'features/MoveStaticMembers' into MoveStaticMembersNewType
Soreloser2 Aug 3, 2021
4f6c03f
Finished Writing impl tests for C# and VB. VB tests are currently fai…
Aug 5, 2021
30b1a79
Merge branch 'MoveStaticMembersNewType' of https://github.com/Sorelos…
Aug 5, 2021
dc1edd4
Fixed resources and removed nullable disable annotation
Aug 5, 2021
08ca13c
Adress small feedback points
Aug 5, 2021
40dedaf
Small test fix. Works with generator changes (sepearate PR)
Aug 5, 2021
10c0ec4
WIP untested, refactoring references to moved members
Aug 9, 2021
aa2212f
Merge branch 'main' of https://github.com/dotnet/roslyn into MoveStat…
Aug 9, 2021
bf2c490
Added tests for refactoring and extensions for C#. Will add tests for…
Aug 10, 2021
6fbd753
Move static members to a New Type (#55204)
Soreloser2 Aug 10, 2021
8a43f2a
Make module now for VB, add refactor tests
Aug 10, 2021
226b83f
Updated C# tests to a new framework. May need to rewrite VB test file…
Aug 10, 2021
2943f7f
Changed VB tests to new Framework. Revealed an error in the way vb me…
Aug 11, 2021
8d2b55f
Fixed VB tests by removing shared modifier when moving to a module
Aug 11, 2021
ee54edd
Fixed more tests to account for member spacing innaccuracy
Aug 12, 2021
5d0c195
Refactored tests, added vb extension tests
Aug 12, 2021
59baf07
Added tests for file banner and moving from a static class/module
Aug 12, 2021
61b2cf0
Added tests to enure operator and static constructors are not able to…
Aug 12, 2021
9a00886
Merged with upstream feature branch
Aug 12, 2021
93d0bd7
Make service field readonly
Aug 12, 2021
7b6c9cd
Test framework movement (#55586)
Soreloser2 Aug 12, 2021
0637f53
Small fixes/changes to pass tests and address some of the feedback
Aug 13, 2021
f3cf97c
Added support for alias refactoring + tests
Aug 13, 2021
aac3b8a
Refactored references on source type. Added simplifier annotation to …
Aug 17, 2021
81953f3
Merged in destination selection dropdown
Aug 19, 2021
82342c7
WIP, select existing destinations work
Aug 20, 2021
ca820d2
Merge remote-tracking branch 'origin/features/MoveStaticMembers' into…
JoeRobich Aug 24, 2021
b2e5cff
Fix api change
JoeRobich Aug 24, 2021
aa13ffd
Update FeatureResources xlf
JoeRobich Aug 24, 2021
08f7d70
Merge remote-tracking branch 'origin/main' into merges/main-to-featur…
JoeRobich Aug 24, 2021
6942117
Changed tests to use new default accessibility modifier for new docum…
Aug 25, 2021
c25b0d8
Merge pull request #55628 from dotnet/merges/main-to-features/MoveSta…
dotnet-bot Aug 25, 2021
0d93aae
Move Static Members: Refactor moved member references (#55581)
Soreloser2 Aug 26, 2021
ec01937
Move Static Members: Show destination name (#55650)
Soreloser2 Aug 27, 2021
6ea2ef7
merge
Aug 30, 2021
9301ad8
small changes to fix merge
Aug 30, 2021
682e7cc
Changed destination selection mechanics
Aug 31, 2021
46a78b5
Removed theming (#56013)
Soreloser2 Aug 31, 2021
d87b4f7
Move static members Root Namespace + OK button enabled fixes (#56035)
Soreloser2 Aug 31, 2021
276e652
Changed CanSubmit property
Aug 31, 2021
d430cc7
Merge with feature branch for small changes
Aug 31, 2021
50741a1
Dialog changes, now in line with move to namespace more or less
Aug 31, 2021
7c36482
Added history functionality
Aug 31, 2021
bdf98b9
Added separate conflicting type name list, added tests for viewModel
Sep 1, 2021
e4088a7
Added some basic tests and implementation
Sep 2, 2021
b075771
Available types has extra filtering for static-ness
Sep 2, 2021
76d708f
Small fixes and dialog resizing
Sep 2, 2021
2af1216
Fixed some nullable suppressions
Sep 2, 2021
dac1a8e
Added some more tests. Not all are passing
Sep 2, 2021
7bb29a1
Fixed bug where refactoring references in an existing destination cau…
Sep 3, 2021
3bc2999
Add small fix to handle possible partial class declarations for desti…
Sep 3, 2021
876ddfb
Attempt to merge from main. More work to be done
ryzngard May 17, 2022
7e8c3ac
Remove Implementation folder
ryzngard May 17, 2022
3627259
WIP
ryzngard May 17, 2022
41d2f10
It compiles
ryzngard May 20, 2022
c57022f
Merge branch 'main' into features/move_static_existing
ryzngard May 20, 2022
8c8baa8
Merge branch 'main' into features/move_static_existing
ryzngard May 25, 2022
cf5c10b
Fix submit logic and some of the tests. More to follow
ryzngard May 25, 2022
719d065
Use declaring syntax instead of locations
ryzngard May 25, 2022
5f8804d
Merge branch 'features/move_static_existing' of https://www.github.co…
ryzngard May 27, 2022
7f8f879
Fix test expectations
ryzngard May 27, 2022
51849e5
Update src/EditorFeatures/TestUtilities/MoveStaticMembers/TestMoveSta…
ryzngard May 30, 2022
39490bb
PR feedback. Update search to work with combobox
ryzngard May 30, 2022
3c912ad
Fix that destination will include prepended namespace if it's a new type
ryzngard May 30, 2022
be2f31a
Merge branch 'features/move_static_existing' of https://www.github.co…
ryzngard May 30, 2022
dfaea2b
Merge branch 'main' into features/move_static_existing
ryzngard Jun 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

using System.Collections.Immutable;
using System.Composition;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.MoveStaticMembers;
using Microsoft.CodeAnalysis.Shared.Extensions;

namespace Microsoft.CodeAnalysis.Test.Utilities.MoveStaticMembers
{
Expand All @@ -20,23 +23,31 @@ public TestMoveStaticMembersService()
{
}

public string? DestinationType { get; set; }
public string? DestinationName { get; set; }

public ImmutableArray<string> SelectedMembers { get; set; }

public string? Filename { get; set; }

public bool CreateNew { get; set; } = true;

public MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ISymbol? selectedNodeSymbol)
{
var selectedMembers = selectedType.GetMembers().WhereAsArray(symbol => SelectedMembers.Contains(symbol.Name));
var namespaceDisplay = selectedType.ContainingNamespace.IsGlobalNamespace
? string.Empty
: selectedType.ContainingNamespace.ToDisplayString();
// just return all the selected members
return new MoveStaticMembersOptions(
Filename!,
string.Join(".", namespaceDisplay, DestinationType!),
selectedMembers);
if (CreateNew)
{
var namespaceDisplay = selectedType.ContainingNamespace.IsGlobalNamespace
? string.Empty
: selectedType.ContainingNamespace.ToDisplayString();
// just return all the selected members
return new MoveStaticMembersOptions(
Filename!,
string.Join(".", namespaceDisplay, DestinationName!),
selectedMembers);
}

var destination = selectedType.ContainingNamespace.GetAllTypes(CancellationToken.None).First(t => t.ToDisplayString() == DestinationName);
return new MoveStaticMembersOptions(destination, selectedMembers);
}
}
}
Loading