提交 26ca2ba4 编写于 作者: C CyrusNajmabadi

Be less aggressive when offering to generate a method in VB.

上级 ebf4437e
......@@ -43,6 +43,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.GenerateMethod
End Function
Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
' If we have a diagnostic on "a.b.c" in something like a.b.c(...), then don't try to
' perform fixes on 'a' or 'a.b'.
Dim diagnosticSpan = diagnostic.Location.SourceSpan
If node.Span.Start = diagnosticSpan.Start AndAlso node.Span.End < diagnosticSpan.End Then
Return False
End If
Return TypeOf node Is QualifiedNameSyntax OrElse
TypeOf node Is SimpleNameSyntax OrElse
TypeOf node Is MemberAccessExpressionSyntax OrElse
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册