Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7473569
Refactoring
DoctorKrolic Mar 29, 2022
9bd4088
Added IsAsyncMemberDeclarationContext property, more refactoring
DoctorKrolic Mar 29, 2022
9e262fd
Symbol filtering for C#
DoctorKrolic Mar 29, 2022
b94ccf3
Allow symbols to be from mscorlib, fixed existed tests
DoctorKrolic Mar 30, 2022
69c8090
Moved IsFromSystemRuntimeOrMscorlibAssembly to extension methods, imp…
DoctorKrolic Mar 31, 2022
5866ea2
Exclude inappropriate completion keywords for C#
DoctorKrolic Mar 31, 2022
fd38cbe
Exclude inappropriate completion keywords for VB
DoctorKrolic Mar 31, 2022
7b0ff38
Preselect Task in both C# and VB
DoctorKrolic Apr 1, 2022
61f9667
A bit more tests for C#
DoctorKrolic Apr 1, 2022
3179e49
Excluded Task.CompletionTask from completion list in async member dec…
DoctorKrolic Apr 1, 2022
210dba3
Fixed char recomendations test
DoctorKrolic Apr 2, 2022
939c9e3
Got rid of AsyncModifierName constants
DoctorKrolic Apr 2, 2022
37f6a1e
Fixed tests for all other keywords
DoctorKrolic Apr 2, 2022
6cbe6b8
Merge branch 'dotnet:main' into async-suggestions-improvements
DoctorKrolic Apr 3, 2022
ed63a39
Cleaned up keyword tests
DoctorKrolic Apr 3, 2022
aa9b8b2
PR feedback part 1
DoctorKrolic Apr 6, 2022
b9bd76c
PR feedback part 2
DoctorKrolic Apr 6, 2022
aaaebba
Merge branch 'dotnet:main' into async-suggestions-improvements
DoctorKrolic Apr 6, 2022
1e07bbc
Changed algorithm of detecting IAsyncEnumerable and IAsyncEnumerator,…
DoctorKrolic Apr 7, 2022
4fadc5f
Got rid of IsSystemRuntimeOrMscorlibAssembly method
DoctorKrolic Apr 7, 2022
f945644
Merge remote-tracking branch 'upstream/main' into async-suggestions-i…
CyrusNajmabadi Apr 7, 2022
ba93ac6
Filter down to task-like types when in an async context
CyrusNajmabadi Apr 7, 2022
76c8918
Update providers
CyrusNajmabadi Apr 7, 2022
9ebffda
Merge branch 'taskCompletion' into async-suggestions-improvements
CyrusNajmabadi Apr 7, 2022
adf887a
Cleanup
CyrusNajmabadi Apr 7, 2022
b325b01
Revert
CyrusNajmabadi Apr 7, 2022
59757ef
Revert
CyrusNajmabadi Apr 7, 2022
ef6a8b9
Revert
CyrusNajmabadi Apr 7, 2022
54f6084
Simplify
CyrusNajmabadi Apr 7, 2022
bdf93d8
Restore logic
CyrusNajmabadi Apr 7, 2022
9252075
Update test
CyrusNajmabadi Apr 7, 2022
da31131
Merge remote-tracking branch 'upstream/main' into async-suggestions-i…
CyrusNajmabadi Apr 7, 2022
e11ce04
Clean up syntax context
CyrusNajmabadi Apr 8, 2022
60313e0
Clean up syntax context
CyrusNajmabadi Apr 8, 2022
0bd3df3
Clean up syntax context
CyrusNajmabadi Apr 8, 2022
e62395c
Clean up syntax context
CyrusNajmabadi Apr 8, 2022
f749f21
Simplify
CyrusNajmabadi Apr 8, 2022
882f85f
Update tests
CyrusNajmabadi Apr 8, 2022
66bbd9c
Lint
CyrusNajmabadi Apr 9, 2022
0f5dd87
Fallout
CyrusNajmabadi Apr 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,33 @@ readonly struct Colors
await VerifyItemIsAbsentAsync(markup + colorsLike, "Colors");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task NotAfterAsync1()
{
var markup = @"
class Test
{
public async $$
}";

await VerifyNoItemsExistAsync(markup);
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task NotAfterAsync2()
{
var markup = @"
class Test
{
public async $$
public void M() {}
}";

await VerifyNoItemsExistAsync(markup);
}

[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task NotAfterDot()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2296,22 +2296,16 @@ void M(String parameter)
await VerifyItemIsAbsentAsync(markup, "parameter");
}

[WorkItem(53585, "https://github.com/dotnet/roslyn/issues/53585")]
[Theory, Trait(Traits.Feature, Traits.Features.Completion)]
[WorkItem(53585, "https://github.com/dotnet/roslyn/issues/53585")]
[InlineData("extern")]
[InlineData("static extern")]
[InlineData("extern static")]
[InlineData("async")]
[InlineData("static async")]
[InlineData("async static")]
[InlineData("unsafe")]
[InlineData("static unsafe")]
[InlineData("unsafe static")]
[InlineData("async unsafe")]
[InlineData("unsafe async")]
[InlineData("unsafe extern")]
[InlineData("extern unsafe")]
[InlineData("extern unsafe async static")]
public async Task AfterLocalFunction_TypeOnly(string keyword)
{
var markup = $@"
Expand All @@ -2328,21 +2322,45 @@ void M(String parameter)
await VerifyItemIsAbsentAsync(markup, "parameter");
}

[Theory, Trait(Traits.Feature, Traits.Features.Completion)]
[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[InlineData("async")]
[InlineData("static async")]
[InlineData("async static")]
[InlineData("async unsafe")]
[InlineData("unsafe async")]
[InlineData("extern unsafe async static")]
public async Task AfterLocalFunction_TypeOnly_Async(string keyword)
{
var markup = $@"
using System;
class C
{{
void M(String parameter)
{{
{keyword} $$
}}
}}
";
await VerifyItemIsAbsentAsync(markup, "String");
await VerifyItemIsAbsentAsync(markup, "parameter");
}

[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
[WorkItem(53585, "https://github.com/dotnet/roslyn/issues/53585")]
[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
public async Task AfterAsyncLocalFunctionWithTwoAsyncs()
{
var markup = @"
using System;
class C
{
void M(String parameter)
void M(string parameter)
{
async async $$
}
}
";
await VerifyItemExistsAsync(markup, "String");
await VerifyItemIsAbsentAsync(markup, "String");
await VerifyItemIsAbsentAsync(markup, "parameter");
}

Expand Down Expand Up @@ -7252,6 +7270,55 @@ public async T$$
await VerifyItemExistsAsync(markup, "Task");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task AfterAsync3()
{
var markup = @"
using System.Threading.Tasks;
class Program
{
public async $$

public void M() {}
}";

await VerifyItemExistsAsync(markup, "Task");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task AfterAsync4()
{
var markup = @"
using System;
using System.Threading.Tasks;
class Program
{
public async $$
}";

await VerifyItemExistsAsync(markup, "Task");
await VerifyItemIsAbsentAsync(markup, "Console");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task AfterAsync5()
{
var markup = @"
using System.Threading.Tasks;
class Program
{
public async $$
}

class Test {}";

await VerifyItemExistsAsync(markup, "Task");
await VerifyItemIsAbsentAsync(markup, "Test");
}

[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task NotAfterAsyncInMethodBody()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,13 +694,15 @@ class C { }
");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsync()
=> await VerifyKeywordAsync(@"class c { async $$ }");
public async Task TestNotAfterAsync()
=> await VerifyAbsenceAsync(@"class c { async $$ }");

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsyncAsType()
=> await VerifyKeywordAsync(@"class c { async async $$ }");
public async Task TestNotAfterAsyncAsType()
=> await VerifyAbsenceAsync(@"class c { async async $$ }");

[WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
Expand Down Expand Up @@ -786,10 +788,19 @@ class C

[WorkItem(53585, "https://github.com/dotnet/roslyn/issues/53585")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunction))]
public async Task TestAfterKeywordIndicatingLocalFunction(string keyword)
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithoutAsync))]
public async Task TestAfterKeywordIndicatingLocalFunctionWithoutAsync(string keyword)
{
await VerifyKeywordAsync(AddInsideMethod($@"
{keyword} $$"));
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithAsync))]
public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string keyword)
{
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,13 +695,15 @@ class C { }
");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsync()
=> await VerifyKeywordAsync(@"class c { async $$ }");
public async Task TestNotAfterAsync()
=> await VerifyAbsenceAsync(@"class c { async $$ }");

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsyncAsType()
=> await VerifyKeywordAsync(@"class c { async async $$ }");
public async Task TestNotAfterAsyncAsType()
=> await VerifyAbsenceAsync(@"class c { async async $$ }");

[WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
Expand Down Expand Up @@ -787,10 +789,19 @@ class C

[WorkItem(53585, "https://github.com/dotnet/roslyn/issues/53585")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunction))]
public async Task TestAfterKeywordIndicatingLocalFunction(string keyword)
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithoutAsync))]
public async Task TestAfterKeywordIndicatingLocalFunctionWithoutAsync(string keyword)
{
await VerifyKeywordAsync(AddInsideMethod($@"
{keyword} $$"));
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithAsync))]
public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string keyword)
{
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,15 @@ class C { }
");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsync()
=> await VerifyKeywordAsync(@"class c { async $$ }");
public async Task TestNotAfterAsync()
=> await VerifyAbsenceAsync(@"class c { async $$ }");

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsyncAsType()
=> await VerifyKeywordAsync(@"class c { async async $$ }");
public async Task TestNotAfterAsyncAsType()
=> await VerifyAbsenceAsync(@"class c { async async $$ }");

[WorkItem(988025, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/988025")]
[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
Expand Down Expand Up @@ -816,10 +818,19 @@ class C

[WorkItem(53585, "https://github.com/dotnet/roslyn/issues/53585")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunction))]
public async Task TestAfterKeywordIndicatingLocalFunction(string keyword)
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithoutAsync))]
public async Task TestAfterKeywordIndicatingLocalFunctionWithoutAsync(string keyword)
{
await VerifyKeywordAsync(AddInsideMethod($@"
{keyword} $$"));
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithAsync))]
public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string keyword)
{
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,15 @@ class C { }
");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsync()
=> await VerifyKeywordAsync(@"class c { async $$ }");
public async Task TestNotAfterAsync()
=> await VerifyAbsenceAsync(@"class c { async $$ }");

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsyncAsType()
=> await VerifyKeywordAsync(@"class c { async async $$ }");
public async Task TestNotAfterAsyncAsType()
=> await VerifyAbsenceAsync(@"class c { async async $$ }");

[WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
Expand Down Expand Up @@ -780,10 +782,19 @@ class C

[WorkItem(53585, "https://github.com/dotnet/roslyn/issues/53585")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunction))]
public async Task TestAfterKeywordIndicatingLocalFunction(string keyword)
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithoutAsync))]
public async Task TestAfterKeywordIndicatingLocalFunctionWithoutAsync(string keyword)
{
await VerifyKeywordAsync(AddInsideMethod($@"
{keyword} $$"));
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithAsync))]
public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string keyword)
{
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,15 @@ class C { }
");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsync()
=> await VerifyKeywordAsync(@"class c { async $$ }");
public async Task TestNotAfterAsync()
=> await VerifyAbsenceAsync(@"class c { async $$ }");

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsyncAsType()
=> await VerifyKeywordAsync(@"class c { async async $$ }");
public async Task TestNotAfterAsyncAsType()
=> await VerifyAbsenceAsync(@"class c { async async $$ }");

[WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
Expand Down Expand Up @@ -764,10 +766,19 @@ class C

[WorkItem(53585, "https://github.com/dotnet/roslyn/issues/53585")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunction))]
public async Task TestAfterKeywordIndicatingLocalFunction(string keyword)
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithoutAsync))]
public async Task TestAfterKeywordIndicatingLocalFunctionWithoutAsync(string keyword)
{
await VerifyKeywordAsync(AddInsideMethod($@"
{keyword} $$"));
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Theory, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[ClassData(typeof(TheoryDataKeywordsIndicatingLocalFunctionWithAsync))]
public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string keyword)
{
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,13 +635,15 @@ await VerifyAbsenceAsync(
}");
}

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsync()
=> await VerifyKeywordAsync(@"class c { async $$ }");
public async Task TestNotAfterAsync()
=> await VerifyAbsenceAsync(@"class c { async $$ }");

[WorkItem(60341, "https://github.com/dotnet/roslyn/issues/60341")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestAfterAsyncAsType()
=> await VerifyKeywordAsync(@"class c { async async $$ }");
public async Task TestNotAfterAsyncAsType()
=> await VerifyAbsenceAsync(@"class c { async async $$ }");

[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestInFunctionPointerType()
Expand Down
Loading