SyntaxFacts Class

Answers questions about JSON kinds that do not need a tree.

public static class SyntaxFacts

Methods

NameDescription
GetKeywordKind(string)Gets the keyword text spells, or SyntaxKind.None when it spells none.
GetLiteralExpression(SyntaxKind)Gets the node kind that wraps a keyword token.
GetText(SyntaxKind)Gets the text a kind is always spelled with, or an empty string when it varies.
IsAnyToken(SyntaxKind)
IsKeyword(SyntaxKind)
IsLiteralExpression(SyntaxKind)
IsPunctuation(SyntaxKind)
IsTrivia(SyntaxKind)
IsValue(SyntaxKind)Determines whether a kind is one of the nodes that can appear where a value is expected.

GetKeywordKind(string)

SyntaxFacts.cs

Gets the keyword text spells, or SyntaxKind.None when it spells none.

public static SyntaxKind GetKeywordKind(string text)

Parameters

text string

Returns

SyntaxKind

GetLiteralExpression(SyntaxKind)

SyntaxFacts.cs

Gets the node kind that wraps a keyword token.

public static SyntaxKind GetLiteralExpression(SyntaxKind tokenKind)

Parameters

tokenKind SyntaxKind

Returns

SyntaxKind

GetText(SyntaxKind)

SyntaxFacts.cs

Gets the text a kind is always spelled with, or an empty string when it varies.

public static string GetText(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

string

IsAnyToken(SyntaxKind)

SyntaxFacts.cs
public static bool IsAnyToken(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsKeyword(SyntaxKind)

SyntaxFacts.cs
public static bool IsKeyword(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsLiteralExpression(SyntaxKind)

SyntaxFacts.cs
public static bool IsLiteralExpression(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsPunctuation(SyntaxKind)

SyntaxFacts.cs
public static bool IsPunctuation(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsTrivia(SyntaxKind)

SyntaxFacts.cs
public static bool IsTrivia(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsValue(SyntaxKind)

SyntaxFacts.cs

Determines whether a kind is one of the nodes that can appear where a value is expected.

public static bool IsValue(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool