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

Fix symbol completions after required keyword #64593

Merged
merged 2 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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);
DoctorKrolic marked this conversation as resolved.
Show resolved Hide resolved
}

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