未验证 提交 37cc2159 编写于 作者: A Ankita Khera 提交者: GitHub

Merge pull request #46059 from akhera99/single-overload

Single overload - Inline Parameter Name Hints
......@@ -305,6 +305,30 @@ class Foo
{
}
</Document>
</Project>
</Workspace>
Await VerifyParamHints(input)
End Function
<WpfFact, Trait(Traits.Feature, Traits.Features.InlineParameterNameHints)>
Public Async Function TestIncompleteFunctionCall() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
class A
{
int testMethod(int x, object y)
{
return x;
}
void Main()
{
testMethod({|x:-(int)5.5|},);
}
}
</Document>
</Project>
......
......@@ -308,5 +308,27 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.InlineParameterNameHints
Await VerifyParamHints(input)
End Function
<WpfFact, Trait(Traits.Feature, Traits.Features.InlineParameterNameHints)>
Public Async Function TestIncompleteFunctionCall() As Task
Dim input =
<Workspace>
<Project Language="Visual Basic" CommonReferences="true">
<Document>
Class Foo
Sub Main(args As String())
TestMethod({|x:5|},)
End Sub
Sub TestMethod(x As Integer, y As Double)
End Sub
End Class
</Document>
</Project>
</Workspace>
Await VerifyParamHints(input)
End Function
End Class
End Namespace
......@@ -59,7 +59,14 @@ public static RefKind GetRefKind(this ArgumentSyntax argument)
return null;
}
var symbol = semanticModel.GetSymbolInfo(invocableExpression, cancellationToken).Symbol;
// Get the symbol as long if it's not null or if there is only one candidate symbol
var symbolInfo = semanticModel.GetSymbolInfo(invocableExpression, cancellationToken);
var symbol = symbolInfo.Symbol;
if (symbol == null && symbolInfo.CandidateSymbols.Length == 1)
{
symbol = symbolInfo.CandidateSymbols[0];
}
if (symbol == null)
{
return null;
......
......@@ -31,7 +31,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions
Return Nothing
End If
Dim symbol = semanticModel.GetSymbolInfo(argumentList.Parent, cancellationToken).Symbol
' Get the symbol if it is not Nothing or if there is a singular candidate symbol
Dim symbolInfo = semanticModel.GetSymbolInfo(argumentList.Parent, cancellationToken)
Dim symbol = symbolInfo.Symbol
If symbol Is Nothing AndAlso symbolInfo.CandidateSymbols.Length = 1 Then
symbol = symbolInfo.CandidateSymbols.Item(0)
End If
If symbol Is Nothing Then
Return Nothing
End If
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册