The reason the second parameter is optional is because the text is implied for some values SyntaxKind. For example, if you pass SyntaxKind.TrueLiteralfor the first argument, you can omit the second. However, when there is no reasonable default value for the second parameter based on the first parameter, we give up ArgumentOutOfRangeException.
In your example, you can create an expression with:
Syntax.LiteralExpression(SyntaxKind.CharacterLiteralExpression, Syntax.Literal('a'))
source
share