未验证 提交 4637b0ff 编写于 作者: A Amaury Levé 提交者: GitHub

Apply suggestions from code review

Co-Authored-By: NSam Harwell <sam@tunnelvisionlabs.com>
上级 4cb0ae2b
...@@ -18,7 +18,7 @@ public static class CSharpExtensions ...@@ -18,7 +18,7 @@ public static class CSharpExtensions
/// </summary> /// </summary>
/// <param name="token">The source token.</param> /// <param name="token">The source token.</param>
/// <param name="kind">The syntax kind to test for.</param> /// <param name="kind">The syntax kind to test for.</param>
/// <returns><c>true</c> if token is of specified kind; <c>false</c> otherwise.</returns> /// <returns><see langword="true"/> if the token is of the specified kind; otherwise, <see langword="false"/>.</returns>
public static bool IsKind(this SyntaxToken token, SyntaxKind kind) public static bool IsKind(this SyntaxToken token, SyntaxKind kind)
{ {
return token.RawKind == (int)kind; return token.RawKind == (int)kind;
...@@ -29,7 +29,7 @@ public static bool IsKind(this SyntaxToken token, SyntaxKind kind) ...@@ -29,7 +29,7 @@ public static bool IsKind(this SyntaxToken token, SyntaxKind kind)
/// </summary> /// </summary>
/// <param name="trivia">The source trivia.</param> /// <param name="trivia">The source trivia.</param>
/// <param name="kind">The syntax kind to test for.</param> /// <param name="kind">The syntax kind to test for.</param>
/// <returns><c>true</c> if trivia is of specified kind; <c>false</c> otherwise.</returns> /// <returns><see langword="true"/> if the trivia is of the specified kind; otherwise, <see langword="false"/>.</returns>
public static bool IsKind(this SyntaxTrivia trivia, SyntaxKind kind) public static bool IsKind(this SyntaxTrivia trivia, SyntaxKind kind)
{ {
return trivia.RawKind == (int)kind; return trivia.RawKind == (int)kind;
...@@ -40,7 +40,7 @@ public static bool IsKind(this SyntaxTrivia trivia, SyntaxKind kind) ...@@ -40,7 +40,7 @@ public static bool IsKind(this SyntaxTrivia trivia, SyntaxKind kind)
/// </summary> /// </summary>
/// <param name="node">The source node.</param> /// <param name="node">The source node.</param>
/// <param name="kind">The syntax kind to test for.</param> /// <param name="kind">The syntax kind to test for.</param>
/// <returns><c>true</c> if node is of specified kind; <c>false</c> otherwise.</returns> /// <returns><see langword="true"/> if the node is of the specified kind; otherwise, <see langword="false"/>.</returns>
public static bool IsKind(this SyntaxNode node, SyntaxKind kind) public static bool IsKind(this SyntaxNode node, SyntaxKind kind)
{ {
return node?.RawKind == (int)kind; return node?.RawKind == (int)kind;
...@@ -51,7 +51,7 @@ public static bool IsKind(this SyntaxNode node, SyntaxKind kind) ...@@ -51,7 +51,7 @@ public static bool IsKind(this SyntaxNode node, SyntaxKind kind)
/// </summary> /// </summary>
/// <param name="nodeOrToken">The source node or token.</param> /// <param name="nodeOrToken">The source node or token.</param>
/// <param name="kind">The syntax kind to test for.</param> /// <param name="kind">The syntax kind to test for.</param>
/// <returns><c>true</c> if node or token is of specified kind; <c>false</c> otherwise.</returns> /// <returns><see langword="true"/> if the node or token is of the specified kind; otherwise, <see langword="false"/>.</returns>
public static bool IsKind(this SyntaxNodeOrToken nodeOrToken, SyntaxKind kind) public static bool IsKind(this SyntaxNodeOrToken nodeOrToken, SyntaxKind kind)
{ {
return nodeOrToken.RawKind == (int)kind; return nodeOrToken.RawKind == (int)kind;
...@@ -166,7 +166,7 @@ public static class CSharpExtensions ...@@ -166,7 +166,7 @@ public static class CSharpExtensions
/// Determines if the given raw kind value belongs to the C# <see cref="SyntaxKind"/> enumeration. /// Determines if the given raw kind value belongs to the C# <see cref="SyntaxKind"/> enumeration.
/// </summary> /// </summary>
/// <param name="rawKind">The raw value to test.</param> /// <param name="rawKind">The raw value to test.</param>
/// <returns><c>true</c> when the raw value belongs to the C# syntax kind; <c>false</c> otherwise.</returns> /// <returns><see langword="true"/> when the raw value belongs to the C# syntax kind; otherwise, <see langword="false"/>.</returns>
internal static bool IsCSharpKind(int rawKind) internal static bool IsCSharpKind(int rawKind)
{ {
const int FirstVisualBasicKind = (int)SyntaxKind.List + 1; const int FirstVisualBasicKind = (int)SyntaxKind.List + 1;
......
...@@ -22,7 +22,7 @@ Namespace Microsoft.CodeAnalysis ...@@ -22,7 +22,7 @@ Namespace Microsoft.CodeAnalysis
''' </summary> ''' </summary>
''' <param name="trivia">The source trivia.</param> ''' <param name="trivia">The source trivia.</param>
''' <param name="kind">The syntax kind to test for.</param> ''' <param name="kind">The syntax kind to test for.</param>
''' <returns><c>true</c> if trivia is of specified kind; <c>false</c> otherwise.</returns> ''' <returns><see langword="true"/> if the trivia is of the specified kind; otherwise, <see langword="false"/>.</returns>
<Extension> <Extension>
Public Function IsKind(trivia As SyntaxTrivia, kind As SyntaxKind) As Boolean Public Function IsKind(trivia As SyntaxTrivia, kind As SyntaxKind) As Boolean
Return trivia.RawKind = kind Return trivia.RawKind = kind
...@@ -33,7 +33,7 @@ Namespace Microsoft.CodeAnalysis ...@@ -33,7 +33,7 @@ Namespace Microsoft.CodeAnalysis
''' </summary> ''' </summary>
''' <param name="token">The source token.</param> ''' <param name="token">The source token.</param>
''' <param name="kind">The syntax kind to test for.</param> ''' <param name="kind">The syntax kind to test for.</param>
''' <returns><c>true</c> if token is of specified kind; <c>false</c> otherwise.</returns> ''' <returns><see langword="true"/> if the token is of the specified kind; otherwise, <see langword="false"/>.</returns>
<Extension> <Extension>
Public Function IsKind(token As SyntaxToken, kind As SyntaxKind) As Boolean Public Function IsKind(token As SyntaxToken, kind As SyntaxKind) As Boolean
Return token.RawKind = kind Return token.RawKind = kind
...@@ -44,7 +44,7 @@ Namespace Microsoft.CodeAnalysis ...@@ -44,7 +44,7 @@ Namespace Microsoft.CodeAnalysis
''' </summary> ''' </summary>
''' <param name="node">The Source node.</param> ''' <param name="node">The Source node.</param>
''' <param name="kind">The syntax kind to test for.</param> ''' <param name="kind">The syntax kind to test for.</param>
''' <returns><c>true</c> if node is of specified kind; <c>false</c> otherwise.</returns> ''' <returns><see langword="true"/> if the node is of the specified kind; otherwise, <see langword="false"/>.</returns>
<Extension> <Extension>
Public Function IsKind(node As SyntaxNode, kind As SyntaxKind) As Boolean Public Function IsKind(node As SyntaxNode, kind As SyntaxKind) As Boolean
Return node IsNot Nothing AndAlso node.RawKind = kind Return node IsNot Nothing AndAlso node.RawKind = kind
...@@ -55,7 +55,7 @@ Namespace Microsoft.CodeAnalysis ...@@ -55,7 +55,7 @@ Namespace Microsoft.CodeAnalysis
''' </summary> ''' </summary>
''' <param name="nodeOrToken">The source node or token.</param> ''' <param name="nodeOrToken">The source node or token.</param>
''' <param name="kind">The syntax kind to test for.</param> ''' <param name="kind">The syntax kind to test for.</param>
''' <returns><c>true</c> if node or token is of specified kind; <c>false</c> otherwise.</returns> ''' <returns><see langword="true"/> if the node or token is of the specified kind; otherwise, <see langword="false"/>.</returns>
<Extension> <Extension>
Public Function IsKind(nodeOrToken As SyntaxNodeOrToken, kind As SyntaxKind) As Boolean Public Function IsKind(nodeOrToken As SyntaxNodeOrToken, kind As SyntaxKind) As Boolean
Return nodeOrToken.RawKind = kind Return nodeOrToken.RawKind = kind
...@@ -168,7 +168,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ...@@ -168,7 +168,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
''' Determines if the given raw kind value belongs to the Visual Basic <see cref="SyntaxKind"/> enumeration. ''' Determines if the given raw kind value belongs to the Visual Basic <see cref="SyntaxKind"/> enumeration.
''' </summary> ''' </summary>
''' <param name="rawKind">The raw value to test.</param> ''' <param name="rawKind">The raw value to test.</param>
''' <returns><c>true</c> when the raw value belongs to the Visual Basic syntax kind; <c>false</c> otherwise.</returns> ''' <returns><see langword="true"/> when the raw value belongs to the Visual Basic syntax kind; otherwise, <see langword="false"/>.</returns>
Friend Function IsVisualBasicKind(rawKind As Integer) As Boolean Friend Function IsVisualBasicKind(rawKind As Integer) As Boolean
Const LastPossibleVisualBasicKind As Integer = 8192 Const LastPossibleVisualBasicKind As Integer = 8192
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册