SyntaxFacts Class

Definition

Provides members for determining Syntax facts about characters and Unicode conversions.

public ref class SyntaxFacts
public class SyntaxFacts
type SyntaxFacts = class
Public Class SyntaxFacts
Inheritance
SyntaxFacts

Constructors

SyntaxFacts()

Properties

EqualityComparer

A custom equality comparer for SyntaxKind

Methods

AllowsLeadingImplicitLineContinuation(SyntaxToken)

Indicates whether a newline may validly precede the specified SyntaxToken without requiring an explicit line continuation sequence ' _' or terminating the containing statement.

AllowsTrailingImplicitLineContinuation(SyntaxToken)

Indicates whether a newline may validly follow the specified SyntaxToken without requiring an explicit line continuation sequence ' _' or terminating the containing statement.

GetAccessorStatementKind(SyntaxKind)
GetBaseTypeStatementKind(SyntaxKind)
GetBinaryExpression(SyntaxKind)
GetBlockName(SyntaxKind)

Return keyword or punctuation text based on SyntaxKind

GetContextualKeywordKind(String)
GetContextualKeywordKinds()

Get contextual keywords

GetInstanceExpression(SyntaxKind)

Return correspondent expression syntax for 'Me', 'MyBase' and 'MyClass' keywords or SyntaxKind.None for other syntax kinds

GetKeywordKind(String)
GetKeywordKinds()

Get all reserved and contextual keywords

GetLiteralExpression(SyntaxKind)
GetOperatorKind(String)
GetPreprocessorKeywordKind(String)
GetPreprocessorKeywordKinds()

Get preprocessor keywords

GetPunctuationKinds()

Get punctuations

GetReservedKeywordKinds()

Get all reserved keywords

GetText(Accessibility)
GetText(SyntaxKind)

Return keyword or punctuation text based on SyntaxKind

GetTypeStatementKind(SyntaxKind)
GetUnaryExpression(SyntaxKind)
IsAccessibilityModifier(SyntaxKind)
IsAccessorBlock(SyntaxKind)
IsAccessorStatement(SyntaxKind)
IsAccessorStatementAccessorKeyword(SyntaxKind)
IsAccessorStatementKeyword(SyntaxKind)
IsAddRemoveHandlerStatement(SyntaxKind)
IsAddRemoveHandlerStatementAddHandlerOrRemoveHandlerKeyword(SyntaxKind)
IsAddressOfOperand(ExpressionSyntax)

Returns true if the node is the operand of an AddressOf expression

IsAnyToken(SyntaxKind)
IsAssignmentStatement(SyntaxKind)
IsAssignmentStatementOperatorToken(SyntaxKind)
IsAttributeName(SyntaxNode)

Checks if the SyntaxNode is an attribute name. To be an attribute name, the syntax must be parented by an Attribute and the node itself must be equal to the Attribute.Name property.

IsAttributeTargetAttributeModifier(SyntaxKind)
IsBinaryExpression(SyntaxKind)
IsBinaryExpressionOperatorToken(SyntaxKind)
IsCaseBlock(SyntaxKind)
IsCaseStatement(SyntaxKind)
IsColon(Char)

Determines if the unicode character is a colon character.

IsContextualKeyword(SyntaxKind)

Determine if the kind represents a contextual keyword

IsContinueStatement(SyntaxKind)
IsContinueStatementBlockKeyword(SyntaxKind)
IsCrefOperatorReferenceOperatorToken(SyntaxKind)
IsCrefSignaturePartModifier(SyntaxKind)
IsDeclareStatement(SyntaxKind)
IsDeclareStatementCharsetKeyword(SyntaxKind)
IsDeclareStatementKeyword(SyntaxKind)
IsDeclareStatementSubOrFunctionKeyword(SyntaxKind)
IsDelegateStatement(SyntaxKind)
IsDelegateStatementKeyword(SyntaxKind)
IsDelegateStatementSubOrFunctionKeyword(SyntaxKind)
IsDoLoopBlock(SyntaxKind)
IsDoStatement(SyntaxKind)
IsEndBlockStatement(SyntaxKind)
IsEndBlockStatementBlockKeyword(SyntaxKind)
IsExitStatement(SyntaxKind)
IsExitStatementBlockKeyword(SyntaxKind)
IsHash(Char)

Determines if the unicode character is a hash character.

IsIdentifierPartCharacter(Char)

Determines if the Unicode character can be a part of a Visual Basic identifier.

IsIdentifierStartCharacter(Char)

Determines if the Unicode character can be the starting character of a Visual Basic identifier.

IsIfDirectiveTrivia(SyntaxKind)
IsIfDirectiveTriviaIfOrElseIfKeyword(SyntaxKind)
IsInNamespaceOrTypeContext(SyntaxNode)
IsInstanceExpression(SyntaxKind)

Determine if the token instance represents 'Me', 'MyBase' or 'MyClass' keywords

IsInTypeOnlyContext(ExpressionSyntax)
IsInvocationOrAddressOfOperand(ExpressionSyntax)

Returns true if the node is the operand of an AddressOf expression, or the object of an invocation. This is used for special binding rules around the return value variable inside Functions and Property Get accessors.

IsInvoked(ExpressionSyntax)

Returns true if the node is the object of an invocation expression

IsKeywordEventContainerKeyword(SyntaxKind)
IsKeywordKind(SyntaxKind)
IsLabel(SyntaxKind)
IsLabelLabelToken(SyntaxKind)
IsLabelStatementLabelToken(SyntaxKind)
IsLambdaHeader(SyntaxKind)
IsLambdaHeaderKeyword(SyntaxKind)
IsLambdaHeaderSubOrFunctionKeyword(SyntaxKind)
IsLanguagePunctuation(SyntaxKind)
IsLiteralExpression(SyntaxKind)
IsLiteralExpressionToken(SyntaxKind)
IsLoopStatement(SyntaxKind)
IsMemberAccessExpression(SyntaxKind)
IsMemberAccessExpressionOperatorToken(SyntaxKind)
IsMethodBlock(SyntaxKind)
IsMethodStatement(SyntaxKind)
IsMethodStatementKeyword(SyntaxKind)
IsMethodStatementSubOrFunctionKeyword(SyntaxKind)
IsMultiLineLambdaExpression(SyntaxKind)
IsName(SyntaxKind)
IsNamedArgumentName(SyntaxNode)

Is the node the name of a named argument of an invocation or object creation expression, but not an attribute.

IsNamespaceMemberDeclaration(SyntaxKind)
IsNewLine(Char)

Determines if the Unicode character is a newline character.

IsOnErrorGoToStatement(SyntaxKind)
IsOperator(SyntaxKind)
IsOperatorStatementOperatorToken(SyntaxKind)
IsOptionStatementNameKeyword(SyntaxKind)
IsOptionStatementValueKeyword(SyntaxKind)
IsOrdering(SyntaxKind)
IsOrderingAscendingOrDescendingKeyword(SyntaxKind)
IsPartitionClause(SyntaxKind)
IsPartitionClauseSkipOrTakeKeyword(SyntaxKind)
IsPartitionWhileClause(SyntaxKind)
IsPartitionWhileClauseSkipOrTakeKeyword(SyntaxKind)
IsPredefinedCastExpressionKeyword(SyntaxKind)
IsPredefinedType(SyntaxKind)

Helper to check whether the token is a predefined type

IsPreprocessorDirective(SyntaxKind)
IsPreprocessorKeyword(SyntaxKind)

Determine if the token instance represents a preprocessor keyword

IsPreprocessorPunctuation(SyntaxKind)
IsPunctuation(SyntaxKind)
IsPunctuationOrKeyword(SyntaxKind)
IsReDimStatement(SyntaxKind)
IsRelationalCaseClause(SyntaxKind)
IsRelationalCaseClauseOperatorToken(SyntaxKind)
IsRelationalOperator(SyntaxKind)
IsReservedKeyword(SyntaxKind)

Determine if the kind represents a reserved keyword

IsReservedTupleElementName(String)

Checks whether the element name is reserved.

For example: "Item3" is reserved. "Rest", "ToString" and other members of System.ValueTuple are reserved. Names that are not reserved return False.

IsResumeStatement(SyntaxKind)
IsSingleLineLambdaExpression(SyntaxKind)
IsSpecialConstraint(SyntaxKind)
IsSpecialConstraintConstraintKeyword(SyntaxKind)
IsStopOrEndStatement(SyntaxKind)
IsStopOrEndStatementStopOrEndKeyword(SyntaxKind)
IsTrivia(SyntaxKind)

Determine if the token instance represents a syntax trivia such as comment, whitespace, etc...

IsTypeOfExpression(SyntaxKind)
IsTypeOfExpressionOperatorToken(SyntaxKind)
IsTypeParameterVarianceKeyword(SyntaxKind)
IsUnaryExpression(SyntaxKind)
IsUnaryExpressionOperatorToken(SyntaxKind)
IsUnderscore(Char)

Determines if the unicode character is a underscore character.

IsValidIdentifier(String)

Determines if the name is a valid identifier.

IsWhileOrUntilClause(SyntaxKind)
IsWhileOrUntilClauseWhileOrUntilKeyword(SyntaxKind)
IsWhitespace(Char)

Determines if Unicode character represents a whitespace.

IsXmlCrefAttributeEndQuoteToken(SyntaxKind)
IsXmlCrefAttributeStartQuoteToken(SyntaxKind)
IsXmlMemberAccessExpression(SyntaxKind)
IsXmlMemberAccessExpressionToken2(SyntaxKind)
IsXmlNameAttributeEndQuoteToken(SyntaxKind)
IsXmlNameAttributeStartQuoteToken(SyntaxKind)
IsXmlStringEndQuoteToken(SyntaxKind)
IsXmlStringStartQuoteToken(SyntaxKind)
IsXmlTextToken(SyntaxKind)
IsXmlWhitespace(Char)

Determines if Unicode character represents a XML whitespace.

MakeHalfWidthIdentifier(String)

Creates a half width form Unicode character string.

VarianceKindFromToken(SyntaxToken)

Applies to