Skip to content

Commit

Permalink
Updated documentation comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
zaytsev-victor committed Nov 27, 2017
1 parent d112b4b commit 5f1603d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f1603d

Please sign in to comment.