Skip to content

Commit

Permalink
Merge pull request #64593 from DoctorKrolic/completions-after-required
Browse files Browse the repository at this point in the history
Fix symbol colpletions after required keyword
  • Loading branch information
CyrusNajmabadi authored Oct 10, 2022
2 parents a8b0ed6 + 02df45c commit 91a2af3
Show file tree
Hide file tree
Showing 18 changed files with 172 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11893,6 +11893,17 @@ public async Task ParameterAvailableInDelegateParameterAttributeNameof()
await VerifyItemExistsAsync(MakeMarkup(source, languageVersion: "10"), "parameter", skipSpeculation: true);
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task AfterRequired()
{
var source = @"
class C
{
required $$
}";
await VerifyAnyItemExistsAsync(source);
}

private static string MakeMarkup(string source, string languageVersion = "Preview")
{
return $$"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,5 +789,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -790,5 +790,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -829,5 +829,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -781,5 +781,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -740,5 +740,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -854,5 +854,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -373,5 +373,15 @@ public async Task TestNotInPreprocessorDirective()
await VerifyAbsenceAsync(
@"#$$");
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -788,5 +788,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -803,5 +803,15 @@ class C
{
delegate*$$");
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,15 @@ public async Task TestNotAfterKeywordIndicatingLocalFunctionWithAsync(string key
await VerifyAbsenceAsync(AddInsideMethod($@"
{keyword} $$"));
}

[Fact, WorkItem(64585, "https://github.com/dotnet/roslyn/issues/64585")]
public async Task TestAfterRequired()
{
await VerifyKeywordAsync(@"
class C
{
required $$
}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static ISet<SyntaxKind> GetPrecedingModifiers(
case SyntaxKind.RefKeyword:
case SyntaxKind.OutKeyword:
case SyntaxKind.InKeyword:
case SyntaxKind.RequiredKeyword:
result.Add(token.Kind());
positionBeforeModifiers = token.FullSpan.Start;
token = token.GetPreviousToken(includeSkipped: true);
Expand Down

0 comments on commit 91a2af3

Please sign in to comment.