提交 19a13586 编写于 作者: B Brett V. Forsgren

When gathering symbols for invocation expression signature help, consider the...

When gathering symbols for invocation expression signature help, consider the left expression explicitly, not just by name
上级 4b6ee166
......@@ -43,7 +43,8 @@ internal partial class InvocationExpressionSignatureHelpProvider
}
var includeInstance = !throughExpression.IsKind(SyntaxKind.IdentifierName) ||
semanticModel.LookupSymbols(throughExpression.SpanStart, name: throughSymbol.Name).Any(s => !(s is INamedTypeSymbol));
semanticModel.LookupSymbols(throughExpression.SpanStart, name: throughSymbol.Name).Any(s => !(s is INamedTypeSymbol)) ||
(!(throughSymbol is INamespaceOrTypeSymbol) && semanticModel.LookupSymbols(throughExpression.SpanStart, container: throughSymbol.ContainingType).Any(s => !(s is INamedTypeSymbol)));
var includeStatic = throughSymbol is INamedTypeSymbol ||
(throughExpression.IsKind(SyntaxKind.IdentifierName) &&
......
......@@ -1947,5 +1947,29 @@ void M()
Test(markup, expectedOrderedItems);
}
[WorkItem(4144, "https://github.com/dotnet/roslyn/issues/4144")]
[Fact, Trait(Traits.Feature, Traits.Features.SignatureHelp)]
public void TestSigHelpIsVisibleOnInaccessibleItem()
{
var markup = @"
using System.Collections.Generic;
class A
{
List<int> args;
}
class B : A
{
void M()
{
args.Add($$
}
}
";
Test(markup, new[] { new SignatureHelpTestItem("void List<int>.Add(int item)") });
}
}
}
......@@ -1849,5 +1849,27 @@ End Class
"
Test(markup, SpecializedCollections.SingletonEnumerable(New SignatureHelpTestItem("C.Next()", String.Empty)))
End Sub
<WorkItem(4144, "https://github.com/dotnet/roslyn/issues/4144")>
<Fact, Trait(Traits.Feature, Traits.Features.SignatureHelp)>
Public Sub TestSigHelpIsVisibleOnInaccessibleItem()
Dim markup = "
Imports System.Collections.Generic
Class A
Dim args As List(Of Integer)
End Class
Class B
Inherits A
Sub M()
args.Add($$
End Sub
End Class
"
Test(markup, {New SignatureHelpTestItem("List(Of Integer).Add(item As Integer)")})
End Sub
End Class
End Namespace
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册