提交 5f1603dd 编写于 作者: V Victor Z

Updated documentation comments.

上级 d112b4b1
......@@ -16,7 +16,9 @@ protected override string GetLanguageName()
protected override bool IsAlreadyQualifiedMemberAccess(SyntaxNode node)
=> node.IsKind(SyntaxKind.ThisExpression);
// If the member is already qualified with `base.`, it cannot be further qualified.
// If the member is already qualified with `base.`,
// or member is in object initialization context,
// or member in property or field initialization, it cannot be qualified.
protected override bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node)
=> !(node.IsKind(SyntaxKind.BaseExpression) ||
node.Parent.Parent.IsKind(SyntaxKind.ObjectInitializerExpression) ||
......
......@@ -17,7 +17,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.QualifyMemberAccess
End Function
Protected Overrides Function CanMemberAccessBeQualified(containingSymbol As ISymbol, node As SyntaxNode) As Boolean
' If the member is already qualified with `MyBase.`, or `MyClass.`, it cannot be further qualified.
' If the member is already qualified with `MyBase.`, or `MyClass.`,
' or member is in object initialization context, it cannot be qualified.
Return Not (node.IsKind(SyntaxKind.MyBaseExpression) OrElse node.IsKind(SyntaxKind.MyClassExpression) OrElse node.IsKind(SyntaxKind.ObjectCreationExpression))
End Function
End Class
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册