Skip to content

Commit 91a2af3

Browse files
Merge pull request #64593 from DoctorKrolic/completions-after-required
Fix symbol colpletions after required keyword
2 parents a8b0ed6 + 02df45c commit 91a2af3

18 files changed

+172
-0
lines changed

src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11893,6 +11893,17 @@ public async Task ParameterAvailableInDelegateParameterAttributeNameof()
1189311893
await VerifyItemExistsAsync(MakeMarkup(source, languageVersion: "10"), "parameter", skipSpeculation: true);
1189411894
}
1189511895

11896+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
11897+
public async Task AfterRequired()
11898+
{
11899+
var source = @"
11900+
class C
11901+
{
11902+
required $$
11903+
}";
11904+
await VerifyAnyItemExistsAsync(source);
11905+
}
11906+
1189611907
private static string MakeMarkup(string source, string languageVersion = "Preview")
1189711908
{
1189811909
return $$"""

src/EditorFeatures/CSharpTest2/Recommendations/BoolKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,5 +789,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
789789
await VerifyAbsenceAsync(AddInsideMethod($@"
790790
{keyword} $$"));
791791
}
792+
793+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
794+
public async Task TestAfterRequired()
795+
{
796+
await VerifyKeywordAsync(@"
797+
class C
798+
{
799+
required $$
800+
}");
801+
}
792802
}
793803
}

src/EditorFeatures/CSharpTest2/Recommendations/ByteKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,5 +790,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
790790
await VerifyAbsenceAsync(AddInsideMethod($@"
791791
{keyword} $$"));
792792
}
793+
794+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
795+
public async Task TestAfterRequired()
796+
{
797+
await VerifyKeywordAsync(@"
798+
class C
799+
{
800+
required $$
801+
}");
802+
}
793803
}
794804
}

src/EditorFeatures/CSharpTest2/Recommendations/CharKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,5 +829,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
829829
await VerifyAbsenceAsync(AddInsideMethod($@"
830830
{keyword} $$"));
831831
}
832+
833+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
834+
public async Task TestAfterRequired()
835+
{
836+
await VerifyKeywordAsync(@"
837+
class C
838+
{
839+
required $$
840+
}");
841+
}
832842
}
833843
}

src/EditorFeatures/CSharpTest2/Recommendations/DecimalKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,5 +781,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
781781
await VerifyAbsenceAsync(AddInsideMethod($@"
782782
{keyword} $$"));
783783
}
784+
785+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
786+
public async Task TestAfterRequired()
787+
{
788+
await VerifyKeywordAsync(@"
789+
class C
790+
{
791+
required $$
792+
}");
793+
}
784794
}
785795
}

src/EditorFeatures/CSharpTest2/Recommendations/DoubleKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
767767
await VerifyAbsenceAsync(AddInsideMethod($@"
768768
{keyword} $$"));
769769
}
770+
771+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
772+
public async Task TestAfterRequired()
773+
{
774+
await VerifyKeywordAsync(@"
775+
class C
776+
{
777+
required $$
778+
}");
779+
}
770780
}
771781
}

src/EditorFeatures/CSharpTest2/Recommendations/FloatKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,5 +740,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
740740
await VerifyAbsenceAsync(AddInsideMethod($@"
741741
{keyword} $$"));
742742
}
743+
744+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
745+
public async Task TestAfterRequired()
746+
{
747+
await VerifyKeywordAsync(@"
748+
class C
749+
{
750+
required $$
751+
}");
752+
}
743753
}
744754
}

src/EditorFeatures/CSharpTest2/Recommendations/IntKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,5 +854,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
854854
await VerifyAbsenceAsync(AddInsideMethod($@"
855855
{keyword} $$"));
856856
}
857+
858+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
859+
public async Task TestAfterRequired()
860+
{
861+
await VerifyKeywordAsync(@"
862+
class C
863+
{
864+
required $$
865+
}");
866+
}
857867
}
858868
}

src/EditorFeatures/CSharpTest2/Recommendations/LongKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
767767
await VerifyAbsenceAsync(AddInsideMethod($@"
768768
{keyword} $$"));
769769
}
770+
771+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
772+
public async Task TestAfterRequired()
773+
{
774+
await VerifyKeywordAsync(@"
775+
class C
776+
{
777+
required $$
778+
}");
779+
}
770780
}
771781
}

src/EditorFeatures/CSharpTest2/Recommendations/NativeIntegerKeywordRecommenderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,5 +373,15 @@ public async Task TestNotInPreprocessorDirective()
373373
await VerifyAbsenceAsync(
374374
@"#$$");
375375
}
376+
377+
[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
378+
public async Task TestAfterRequired()
379+
{
380+
await VerifyKeywordAsync(@"
381+
class C
382+
{
383+
required $$
384+
}");
385+
}
376386
}
377387
}

0 commit comments

Comments
 (0)