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 ref and out keyword completion to appear in local functions #22374

Closed
wants to merge 1 commit into from
Closed
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 @@ -405,5 +405,13 @@ void main(out goo) { }

await VerifyKeywordAsync(text);
}

[WorkItem(22253, "https://github.com/dotnet/roslyn/issues/22253")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestInLocalFunction()
{
await VerifyKeywordAsync(AddInsideMethod(
@"void F(int x, $$"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -806,5 +806,13 @@ public async Task TestInArrowLambda()
await VerifyKeywordWithRefsAsync(AddInsideMethod(
@" D1 lambda = () => $$"));
}

[WorkItem(22253, "https://github.com/dotnet/roslyn/issues/22253")]
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestInLocalMethod()
{
await VerifyKeywordWithRefsAsync(AddInsideMethod(
@" void Goo(int test, $$) "));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public static bool IsDelegateOrConstructorOrMethodParameterList(this SyntaxNode
return
node.IsParentKind(SyntaxKind.MethodDeclaration) ||
node.IsParentKind(SyntaxKind.ConstructorDeclaration) ||
node.IsParentKind(SyntaxKind.DelegateDeclaration);
node.IsParentKind(SyntaxKind.DelegateDeclaration) ||
node.IsParentKind(SyntaxKind.LocalFunctionStatement);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗️ The method name appears to be misleading now.

}
}
}