未验证 提交 0e1cac79 编写于 作者: J Jinu 提交者: GitHub

Merge pull request #35247 from JoeRobich/try-classify-membergroup

Fix `nameof(MethodName)` not classifying MethodName
......@@ -2290,6 +2290,34 @@ void goo()
Class("C"));
}
[Fact, Trait(Traits.Feature, Traits.Features.Classification)]
public async Task NameOfLocalMethod()
{
await TestAsync(
@"class C
{
void goo()
{
var x = nameof(M);
void M()
{
}
void M(int a)
{
}
void M(string s)
{
}
}
}",
Keyword("var"),
Keyword("nameof"),
Method("M"));
}
[Fact, Trait(Traits.Feature, Traits.Features.Classification)]
public async Task MethodCalledNameOfInScope()
{
......
......@@ -68,7 +68,8 @@ protected override bool IsParentAnAttribute(SyntaxNode node)
ArrayBuilder<ClassifiedSpan> result,
CancellationToken cancellationToken)
{
if (symbolInfo.CandidateReason == CandidateReason.Ambiguous)
if (symbolInfo.CandidateReason == CandidateReason.Ambiguous ||
symbolInfo.CandidateReason == CandidateReason.MemberGroup)
{
return TryClassifyAmbiguousSymbol(name, symbolInfo, semanticModel, result, cancellationToken);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册