提交 d68c4995 编写于 作者: R Ravi Chande

Support range variables in C# F1 help

上级 62987d96
......@@ -153,6 +153,13 @@ private bool TryGetTextForSymbol(SyntaxToken token, SemanticModel semanticModel,
symbol = ((ILocalSymbol)symbol).Type;
}
// Range variable: use the type
if (symbol is IRangeVariableSymbol)
{
var info = semanticModel.GetTypeInfo(token.Parent, CancellationToken.None);
symbol = info.Type;
}
// Just use syntaxfacts for operators
if (symbol is IMethodSymbol && ((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator)
{
......
......@@ -506,5 +506,22 @@ void M()
}
}", "dynamic_CSharpKeyword");
}
[Fact, Trait(Traits.Feature, Traits.Features.F1Help)]
public void TestRangeVariable()
{
Test(@"using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
class Program
{
static void Main(string[] args)
{
var zzz = from y in args select [||]y;
}
}", "System.String");
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册