diff --git a/src/Compilers/CSharp/Portable/CSharpExtensions.cs b/src/Compilers/CSharp/Portable/CSharpExtensions.cs
index 8c44283402fcee2407f7ba3dafbe4c06268740d7..06da90f727aaf9548d5ace124b676f62343db59d 100644
--- a/src/Compilers/CSharp/Portable/CSharpExtensions.cs
+++ b/src/Compilers/CSharp/Portable/CSharpExtensions.cs
@@ -6,29 +6,52 @@
using System.Threading;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-using Microsoft.CodeAnalysis.CSharp.Symbols;
-using Microsoft.CodeAnalysis.Syntax;
using Microsoft.CodeAnalysis.Operations;
+using Microsoft.CodeAnalysis.Syntax;
namespace Microsoft.CodeAnalysis
{
public static class CSharpExtensions
{
+ ///
+ /// Determines if is of a specified kind.
+ ///
+ /// The source token.
+ /// The syntax kind to test for.
+ /// true if token is of specified kind; false otherwise.
public static bool IsKind(this SyntaxToken token, SyntaxKind kind)
{
return token.RawKind == (int)kind;
}
+ ///
+ /// Determines if is of a specified kind.
+ ///
+ /// The source trivia.
+ /// The syntax kind to test for.
+ /// true if trivia is of specified kind; false otherwise.
public static bool IsKind(this SyntaxTrivia trivia, SyntaxKind kind)
{
return trivia.RawKind == (int)kind;
}
+ ///
+ /// Determines if is of a specified kind.
+ ///
+ /// The source node.
+ /// The syntax kind to test for.
+ /// true if node is of specified kind; false otherwise.
public static bool IsKind(this SyntaxNode node, SyntaxKind kind)
{
return node?.RawKind == (int)kind;
}
+ ///
+ /// Determines if is of a specified kind.
+ ///
+ /// The source node or token.
+ /// The syntax kind to test for.
+ /// true if node or token is of specified kind; false otherwise.
public static bool IsKind(this SyntaxNodeOrToken nodeOrToken, SyntaxKind kind)
{
return nodeOrToken.RawKind == (int)kind;
@@ -139,6 +162,11 @@ namespace Microsoft.CodeAnalysis.CSharp
{
public static class CSharpExtensions
{
+ ///
+ /// Determines if the given raw kind value belongs to the C# enumeration.
+ ///
+ /// The raw value to test.
+ /// true when the raw value belongs to the C# syntax kind; false otherwise.
internal static bool IsCSharpKind(int rawKind)
{
const int FirstVisualBasicKind = (int)SyntaxKind.List + 1;
@@ -148,24 +176,36 @@ internal static bool IsCSharpKind(int rawKind)
return unchecked((uint)(rawKind - FirstVisualBasicKind)) > (FirstCSharpKind - 1 - FirstVisualBasicKind);
}
+ ///
+ /// Returns for from property.
+ ///
public static SyntaxKind Kind(this SyntaxToken token)
{
var rawKind = token.RawKind;
return IsCSharpKind(rawKind) ? (SyntaxKind)rawKind : SyntaxKind.None;
}
+ ///
+ /// Returns for from property.
+ ///
public static SyntaxKind Kind(this SyntaxTrivia trivia)
{
var rawKind = trivia.RawKind;
return IsCSharpKind(rawKind) ? (SyntaxKind)rawKind : SyntaxKind.None;
}
+ ///
+ /// Returns for from property.
+ ///
public static SyntaxKind Kind(this SyntaxNode node)
{
var rawKind = node.RawKind;
return IsCSharpKind(rawKind) ? (SyntaxKind)rawKind : SyntaxKind.None;
}
+ ///
+ /// Returns for from property.
+ ///
public static SyntaxKind Kind(this SyntaxNodeOrToken nodeOrToken)
{
var rawKind = nodeOrToken.RawKind;
diff --git a/src/Compilers/VisualBasic/Portable/VisualBasicExtensions.vb b/src/Compilers/VisualBasic/Portable/VisualBasicExtensions.vb
index 629342c93047f6fd51bb2d37149c35f8bcb5b303..bf579208089c95e66291d613c76e8cc504104ba8 100644
--- a/src/Compilers/VisualBasic/Portable/VisualBasicExtensions.vb
+++ b/src/Compilers/VisualBasic/Portable/VisualBasicExtensions.vb
@@ -2,8 +2,6 @@
Imports System.Collections.Immutable
Imports System.Collections.ObjectModel
-Imports System.ComponentModel
-Imports System.IO
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices
Imports System.Threading
@@ -20,42 +18,44 @@ Namespace Microsoft.CodeAnalysis
Public Module VisualBasicExtensions
'''
- ''' Determines if SyntaxTrivia is a specified kind.
+ ''' Determines if is of a specified kind.
'''
- '''The Source SyntaxTrivia.
- ''' The SyntaxKind to test for.
+ ''' The source trivia.
+ ''' The syntax kind to test for.
+ ''' true if triviq is of specified kind; false otherwise.
Public Function IsKind(trivia As SyntaxTrivia, kind As SyntaxKind) As Boolean
Return trivia.RawKind = kind
End Function
'''
- ''' Determines if SyntaxToken is a specified kind.
+ ''' Determines if is of a specified kind.
'''
- '''The Source SyntaxToken.
- ''' The SyntaxKind to test for.
+ ''' The source token.
+ ''' The syntax kind to test for.
+ ''' true if token is of specified kind; false otherwise.
Public Function IsKind(token As SyntaxToken, kind As SyntaxKind) As Boolean
Return token.RawKind = kind
End Function
'''
- ''' Determines if SyntaxNode is a specified kind.
+ ''' Determines if is of a specified kind.
'''
- ''' The Source SyntaxNode.
- ''' The SyntaxKind to test for.
- ''' A boolean value if node is of specified kind; otherwise false.
+ ''' The Source node.
+ ''' The syntax kind to test for.
+ ''' true if node is of specified kind; false otherwise.
Public Function IsKind(node As SyntaxNode, kind As SyntaxKind) As Boolean
Return node IsNot Nothing AndAlso node.RawKind = kind
End Function
'''
- ''' Determines if a SyntaxNodeOrToken is a specified kind.
+ ''' Determines if is of a specified kind.
'''
- ''' The source SyntaxNodeOrToken.
- ''' The SyntaxKind to test for.
- ''' A boolean value if nodeOrToken is of specified kind; otherwise false.
+ ''' The source node or token.
+ ''' The syntax kind to test for.
+ ''' true if node or token is of specified kind; false otherwise.
Public Function IsKind(nodeOrToken As SyntaxNodeOrToken, kind As SyntaxKind) As Boolean
Return nodeOrToken.RawKind = kind
@@ -164,6 +164,11 @@ End Namespace
Namespace Microsoft.CodeAnalysis.VisualBasic
Public Module VisualBasicExtensions
+ '''
+ ''' Determines if the given raw kind value belongs to the Visual Basic enumeration.
+ '''
+ ''' The raw value to test.
+ ''' true when the raw value belongs to the Visual Basic syntax kind; false otherwise.
Friend Function IsVisualBasicKind(rawKind As Integer) As Boolean
Const LastPossibleVisualBasicKind As Integer = 8192
@@ -171,7 +176,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Function
'''
- ''' Returns for nodes.
+ ''' Returns for from property.
'''
Public Function Kind(trivia As SyntaxTrivia) As SyntaxKind
@@ -189,7 +194,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Function
'''
- ''' Returns for from property.
+ ''' Returns for from property.
'''
Public Function Kind(node As SyntaxNode) As SyntaxKind
@@ -198,7 +203,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Function
'''
- ''' Returns for from property.
+ ''' Returns for from property.
'''
Public Function Kind(nodeOrToken As SyntaxNodeOrToken) As SyntaxKind