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

Make change signature more async and remove UI dialogs from the service #47768

Merged
merged 21 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ChangeSignature
{
public partial class ChangeSignatureTests : AbstractChangeSignatureTests
{
[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameterAddsAllImports()
{
var markup = @"
Expand Down Expand Up @@ -48,7 +48,7 @@ void M(Dictionary<ConsoleColor, Task<AsyncOperation>> test) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameterAddsOnlyMissingImports()
{
var markup = @"
Expand Down Expand Up @@ -82,7 +82,7 @@ void M(Dictionary<ConsoleColor, Task<AsyncOperation>> test) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameterAddsImportsOnCascading()
{
var markup = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ChangeSignature
{
public partial class ChangeSignatureTests : AbstractChangeSignatureTests
{
[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToImplementedMethod()
{
var markup = @"
Expand Down Expand Up @@ -50,7 +50,7 @@ public void M(string y, int newIntegerParameter, int x)
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: permutation, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToImplementedMethod_WithTuples()
{
var markup = @"
Expand Down Expand Up @@ -84,7 +84,7 @@ public void M((string a, string b) y, int newIntegerParameter, (int, int) x)
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: permutation, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToImplementingMethod()
{
var markup = @"
Expand Down Expand Up @@ -118,7 +118,7 @@ public void M(string y, int newIntegerParameter, int x)
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: permutation, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToOverriddenMethod()
{
var markup = @"
Expand Down Expand Up @@ -154,7 +154,7 @@ public override void M(string y, int newIntegerParameter, int x)
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: permutation, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToOverridingMethod()
{
var markup = @"
Expand Down Expand Up @@ -190,7 +190,7 @@ public override void M(string y, int newIntegerParameter, int x)
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: permutation, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToOverriddenMethod_Transitive()
{
var markup = @"
Expand Down Expand Up @@ -238,7 +238,7 @@ public override void M(string y, int newIntegerParameter, int x)
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: permutation, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToOverridingMethod_Transitive()
{
var markup = @"
Expand Down Expand Up @@ -286,7 +286,7 @@ public override void M(string y, int newIntegerParameter, int x)
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: permutation, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToMethods_Complex()
{
//// B I I2
Expand Down Expand Up @@ -323,7 +323,7 @@ class C : I3 { public void M(string y, int newIntegerParameter, int x) { } }";
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: permutation, expectedUpdatedInvocationDocumentCode: updatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Cascade_ToMethods_WithDifferentParameterNames()
{
var markup = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ChangeSignature
{
public partial class ChangeSignatureTests : AbstractChangeSignatureTests
{
[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_ImplicitInvokeCalls()
{
var markup = @"
Expand Down Expand Up @@ -50,7 +50,7 @@ await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSi
expectedUpdatedInvocationDocumentCode: expectedUpdatedCode, expectedSelectedIndex: 0);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_ExplicitInvokeCalls()
{
var markup = @"
Expand Down Expand Up @@ -84,7 +84,7 @@ await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSi
expectedUpdatedInvocationDocumentCode: expectedUpdatedCode, expectedSelectedIndex: 1);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_BeginInvokeCalls()
{
var markup = @"
Expand Down Expand Up @@ -118,7 +118,7 @@ await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSi
expectedUpdatedInvocationDocumentCode: expectedUpdatedCode, expectedSelectedIndex: 2);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_AnonymousMethods()
{
var markup = @"
Expand Down Expand Up @@ -153,7 +153,7 @@ void M()
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_Lambdas()
{
var markup = @"
Expand Down Expand Up @@ -186,7 +186,7 @@ void M()
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_Lambdas_RemovingOnlyParameterIntroducesParentheses()
{
var markup = @"
Expand Down Expand Up @@ -221,7 +221,7 @@ void M()
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_CascadeThroughMethodGroups_AssignedToVariable()
{
var markup = @"
Expand Down Expand Up @@ -264,7 +264,7 @@ void Goo(int a, object b, bool c) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_CascadeThroughMethodGroups_DelegateConstructor()
{
var markup = @"
Expand Down Expand Up @@ -305,7 +305,7 @@ void Goo(int a, object b, bool c) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_CascadeThroughMethodGroups_PassedAsArgument()
{
var markup = @"
Expand Down Expand Up @@ -350,7 +350,7 @@ void Goo(int a, object b, bool c) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_CascadeThroughMethodGroups_ReturnValue()
{
var markup = @"
Expand Down Expand Up @@ -399,7 +399,7 @@ void Goo(int a, object b, bool c) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_CascadeThroughMethodGroups_YieldReturnValue()
{
var markup = @"
Expand Down Expand Up @@ -450,7 +450,7 @@ void Goo(int a, object b, bool c) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_ReferencingLambdas_MethodArgument()
{
var markup = @"
Expand Down Expand Up @@ -485,7 +485,7 @@ void Target(MyDelegate d) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_ReferencingLambdas_YieldReturn()
{
var markup = @"
Expand Down Expand Up @@ -518,7 +518,7 @@ private IEnumerable<MyDelegate> Result3()
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_Recursive()
{
var markup = @"
Expand Down Expand Up @@ -551,7 +551,7 @@ void M()
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_DocComments()
{
var markup = @"
Expand Down Expand Up @@ -614,7 +614,7 @@ void Goo(bool c, int newIntegerParameter, string b) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_CascadeThroughEventAdd()
{
var markup = @"
Expand Down Expand Up @@ -651,7 +651,7 @@ void Program_MyEvent(bool c, int newIntegerParameter, string b) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_Generics1()
{
var markup = @"
Expand Down Expand Up @@ -696,7 +696,7 @@ void B()
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_Generics2()
{
var markup = @"
Expand Down Expand Up @@ -725,7 +725,7 @@ internal void M17(int newIntegerParameter) { }
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_GenericParams()
{
var markup = @"
Expand Down Expand Up @@ -778,7 +778,7 @@ void B()
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegates_Generic_RemoveArgumentAtReference()
{
var markup = @"public class CD<T>
Expand Down Expand Up @@ -810,7 +810,7 @@ await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSi
expectedUpdatedInvocationDocumentCode: expectedUpdatedCode, expectedSelectedIndex: 0);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task AddParameter_Delegate_Generics_RemoveStaticArgument()
{
var markup = @"
Expand Down Expand Up @@ -853,7 +853,7 @@ void B()
await TestChangeSignatureViaCommandAsync(LanguageNames.CSharp, markup, updatedSignature: updatedSignature, expectedUpdatedInvocationDocumentCode: expectedUpdatedCode);
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
[Fact, Trait(Traits.Feature, Traits.Features.ChangeSignature)]
public async Task TestAddParameter_Delegates_Relaxation_ParameterlessFunctionToFunction()
{
var markup = @"
Expand Down
Loading