提交 f23417ed 编写于 作者: A Ankita Khera

Added interpolated strings and tests

上级 b7913a66
......@@ -336,5 +336,29 @@ class A
Await VerifyParamHints(input)
End Function
<WpfFact, Trait(Traits.Feature, Traits.Features.InlineParameterNameHints)>
Public Async Function TestInterpolatedString() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
class A
{
string testMethod(string x)
{
return x;
}
void Main()
{
testMethod({|x:$""|});
}
}
</Document>
</Project>
</Workspace>
Await VerifyParamHints(input)
End Function
End Class
End Namespace
......@@ -330,5 +330,27 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.InlineParameterNameHints
Await VerifyParamHints(input)
End Function
<WpfFact, Trait(Traits.Feature, Traits.Features.InlineParameterNameHints)>
Public Async Function TestInterpolatedString() As Task
Dim input =
<Workspace>
<Project Language="Visual Basic" CommonReferences="true">
<Document>
Class Foo
Sub Main(args As String())
TestMethod({|x:$""|})
End Sub
Sub TestMethod(x As String)
End Sub
End Class
</Document>
</Project>
</Workspace>
Await VerifyParamHints(input)
End Function
End Class
End Namespace
......@@ -81,6 +81,11 @@ private static bool IsExpressionWithNoName(ExpressionSyntax arg)
// We want to adorn literals no matter what
return true;
}
if (arg is InterpolatedStringExpressionSyntax)
{
// We want to adorn all types of strings
return true;
}
if (arg is ObjectCreationExpressionSyntax)
{
// We want to adorn object invocations that exist as arguments because they are not declared anywhere
......
......@@ -43,6 +43,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.InlineParameterNameHints
Return True
End If
If TypeOf arg Is InterpolatedStringExpressionSyntax Then
' We want to adorn all types of strings
Return True
End If
If TypeOf arg Is ObjectCreationExpressionSyntax Then
' We want to adorn object invocations that exist as arguments because they are Not declared anywhere
' else in the file
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册