未验证 提交 c412fc39 编写于 作者: C CyrusNajmabadi 提交者: GitHub

Merge pull request #42278 from CyrusNajmabadi/nameofF1

Add f1 support for 'nameof' keyword
......@@ -244,6 +244,12 @@ private bool TryGetTextForPreProcessor(SyntaxToken token, ISyntaxFactsService sy
private bool TryGetTextForContextualKeyword(SyntaxToken token, out string text)
{
if (token.Text == "nameof")
{
text = Keyword("nameof");
return true;
}
if (token.IsContextualKeyword())
{
switch (token.Kind())
......
......@@ -562,5 +562,19 @@ static void Main(string[] args)
}
}", "System.String");
}
[WorkItem(36001, "https://github.com/dotnet/roslyn/issues/36001")]
[Fact, Trait(Traits.Feature, Traits.Features.F1Help)]
public async Task TestNameof()
{
await Test_KeywordAsync(
@"class C
{
void goo()
{
var v = [||]nameof(goo);
}
}", "nameof");
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册