244 references to LiteralExpression
ILLink.CodeFixProvider (4)
RequiresHelpers.cs (1)
19 return new[] { syntaxGenerator.AttributeArgument (syntaxGenerator.LiteralExpression ($"Calls {symbolDisplayName}")) };
UnconditionalSuppressMessageCodeFixProvider.cs (3)
44 syntaxGenerator.LiteralExpression (diagnostic.Descriptor.Category)); 51 syntaxGenerator.LiteralExpression ( 56 syntaxGenerator.LiteralExpression ("<Pending>"));
Microsoft.Analyzers.Extra (2)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
594gen.LiteralExpression(CalcEventId(comp, targetClass, cancellationToken)), 596gen.LiteralExpression(details.Message),
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
47editor.ReplaceNode(node, editor.Generator.LiteralExpression(newDocCommentId).WithTriviaFrom(node));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (3)
92return [factory.ReturnStatement(factory.LiteralExpression(0))]; 189? factory.NegateExpression(factory.LiteralExpression(-value)) 190: factory.LiteralExpression(value);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
102var newLiteral = generator.LiteralExpression(constant.Value);
Microsoft.CodeAnalysis.CSharp.Features (7)
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
94EqualsValueClause((ExpressionSyntax)generator.LiteralExpression(0)))]),
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
286: (ExpressionSyntax)generator.SubtractExpression(end, generator.LiteralExpression(1));
Snippets\CSharpForLoopSnippetProvider.cs (1)
30=> (ExpressionSyntax)generator.LiteralExpression(0);
Snippets\CSharpIntMainSnippetProvider.cs (1)
35var returnStatement = (StatementSyntax)generator.ReturnStatement(generator.LiteralExpression(0));
Snippets\CSharpReversedForLoopSnippetProvider.cs (2)
32return (ExpressionSyntax)generator.SubtractExpression(subtractFrom, generator.LiteralExpression(1)); 36=> (ExpressionSyntax)generator.LiteralExpression(0);
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
102var newLiteral = generator.LiteralExpression(constant.Value);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (81)
CodeGeneration\SyntaxGeneratorTests.cs (81)
66VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0), "0"); 67VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1), "1"); 68VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1), "-1"); 69VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(int.MinValue), "global::System.Int32.MinValue"); 70VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(int.MaxValue), "global::System.Int32.MaxValue"); 72VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0L), "0L"); 73VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1L), "1L"); 74VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1L), "-1L"); 75VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(long.MinValue), "global::System.Int64.MinValue"); 76VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(long.MaxValue), "global::System.Int64.MaxValue"); 78VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0UL), "0UL"); 79VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1UL), "1UL"); 80VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(ulong.MinValue), "0UL"); 81VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(ulong.MaxValue), "global::System.UInt64.MaxValue"); 83VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.0f), "0F"); 84VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1.0f), "1F"); 85VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1.0f), "-1F"); 86VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.MinValue), "global::System.Single.MinValue"); 87VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.MaxValue), "global::System.Single.MaxValue"); 88VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.Epsilon), "global::System.Single.Epsilon"); 89VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.NaN), "global::System.Single.NaN"); 90VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.NegativeInfinity), "global::System.Single.NegativeInfinity"); 91VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(float.PositiveInfinity), "global::System.Single.PositiveInfinity"); 93VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.0), "0D"); 94VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1.0), "1D"); 95VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1.0), "-1D"); 96VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.MinValue), "global::System.Double.MinValue"); 97VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.MaxValue), "global::System.Double.MaxValue"); 98VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.Epsilon), "global::System.Double.Epsilon"); 99VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.NaN), "global::System.Double.NaN"); 100VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.NegativeInfinity), "global::System.Double.NegativeInfinity"); 101VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(double.PositiveInfinity), "global::System.Double.PositiveInfinity"); 103VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0m), "0M"); 104VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.00m), "0.00M"); 105VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1.00m), "1.00M"); 106VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression(-1.00m), "-1.00M"); 107VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1.0000000000m), "1.0000000000M"); 108VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.000000m), "0.000000M"); 109VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0.0000000m), "0.0000000M"); 110VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1000000000m), "1000000000M"); 111VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(123456789.123456789m), "123456789.123456789M"); 112VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1E-28m), "0.0000000000000000000000000001M"); 113VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(0E-28m), "0.0000000000000000000000000000M"); 114VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(1E-29m), "0.0000000000000000000000000000M"); 115VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(-1E-29m), "0.0000000000000000000000000000M"); 116VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(decimal.MinValue), "global::System.Decimal.MinValue"); 117VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(decimal.MaxValue), "global::System.Decimal.MaxValue"); 119VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression('c'), "'c'"); 121VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression("str"), "\"str\""); 122VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression("s\"t\"r"), "\"s\\\"t\\\"r\""); 124VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(true), "true"); 125VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(false), "false"); 131VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((short)0), "0"); 132VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((short)1), "1"); 133VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression((short)-1), "-1"); 134VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(short.MinValue), "global::System.Int16.MinValue"); 135VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(short.MaxValue), "global::System.Int16.MaxValue"); 141VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((ushort)0), "0"); 142VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((ushort)1), "1"); 143VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(ushort.MinValue), "0"); 144VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(ushort.MaxValue), "global::System.UInt16.MaxValue"); 150VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((sbyte)0), "0"); 151VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((sbyte)1), "1"); 152VerifySyntax<PrefixUnaryExpressionSyntax>(Generator.LiteralExpression((sbyte)-1), "-1"); 153VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(sbyte.MinValue), "global::System.SByte.MinValue"); 154VerifySyntax<MemberAccessExpressionSyntax>(Generator.LiteralExpression(sbyte.MaxValue), "global::System.SByte.MaxValue"); 160VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((byte)0), "0"); 161VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression((byte)1), "1"); 162VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(byte.MinValue), "0"); 163VerifySyntax<LiteralExpressionSyntax>(Generator.LiteralExpression(byte.MaxValue), "255"); 380Generator.ArrayCreationExpression(Generator.IdentifierName("x"), Generator.LiteralExpression(10)), 545VerifySyntax<YieldStatementSyntax>(Generator.YieldReturnStatement(Generator.LiteralExpression(1)), "yield return 1;"); 785Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), initializer: Generator.LiteralExpression(0)), 1692Generator.EnumDeclaration("e", members: [Generator.EnumMember("a", Generator.LiteralExpression(0)), Generator.EnumMember("b"), Generator.EnumMember("c", Generator.LiteralExpression(5))]), 1696Generator.EnumDeclaration("e", members: [Generator.FieldDeclaration("a", Generator.IdentifierName("e"), initializer: Generator.LiteralExpression(1))]), 3503Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(x, Generator.LiteralExpression(500))).ToString()); 3504Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(y, Generator.LiteralExpression(500))).ToString()); 3505Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(z, Generator.LiteralExpression(500))).ToString()); 3525Assert.Null(Generator.GetExpression(Generator.WithExpression(x, Generator.LiteralExpression(500)))); 3526Assert.Equal("500", Generator.GetExpression(Generator.WithExpression(y, Generator.LiteralExpression(500))).ToString());
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (72)
CodeGeneration\ExpressionGenerationTests.cs (32)
74f => f.LiteralExpression(0), 85f => f.LiteralExpression(1), 96f => f.LiteralExpression(0L), 107f => f.LiteralExpression(1L), 118f => f.LiteralExpression(0.0f), 129f => f.LiteralExpression(0.5F), 140f => f.LiteralExpression(0.0d), 151f => f.LiteralExpression(0.5D), 163f.LiteralExpression(1), 164f.LiteralExpression(2)), 176f.LiteralExpression(1), 178f.LiteralExpression(2), 179f.LiteralExpression(3))), 192f.LiteralExpression(1), 193f.LiteralExpression(2)), 194f.LiteralExpression(3)), 206f.LiteralExpression(1), 207f.LiteralExpression(2)), 219f.LiteralExpression(1), 221f.LiteralExpression(2), 222f.LiteralExpression(3))), 235f.LiteralExpression(1), 236f.LiteralExpression(2)), 237f.LiteralExpression(3)), 249f.LiteralExpression(1), 250f.LiteralExpression(2)), 262f.LiteralExpression(1), 263f.LiteralExpression(2)), 275f.LiteralExpression(1), 276f.LiteralExpression(2)), 288f.LiteralExpression(1), 289f.LiteralExpression(2)),
CodeGeneration\ExpressionPrecedenceGenerationTests.cs (40)
21f.LiteralExpression(1), 22f.LiteralExpression(2)), 23f.LiteralExpression(3)), 36f.LiteralExpression(1), 37f.LiteralExpression(2)), 38f.LiteralExpression(3)), 50f.LiteralExpression(1), 52f.LiteralExpression(2), 53f.LiteralExpression(3))), 65f.LiteralExpression(1), 67f.LiteralExpression(2), 68f.LiteralExpression(3))), 81f.LiteralExpression(1), 82f.LiteralExpression(2)), 83f.LiteralExpression(3)), 96f.LiteralExpression(1), 97f.LiteralExpression(2)), 98f.LiteralExpression(3)), 110f.LiteralExpression(1), 112f.LiteralExpression(2), 113f.LiteralExpression(3))), 125f.LiteralExpression(1), 127f.LiteralExpression(2), 128f.LiteralExpression(3))), 141f.LiteralExpression(1), 142f.LiteralExpression(2)), 143f.LiteralExpression(3)), 156f.LiteralExpression(1), 157f.LiteralExpression(2)), 158f.LiteralExpression(3)), 170f.LiteralExpression(1), 172f.LiteralExpression(2), 173f.LiteralExpression(3))), 185f.LiteralExpression(1), 187f.LiteralExpression(2), 188f.LiteralExpression(3))), 201f.LiteralExpression(1), 202f.LiteralExpression(2)), 251f.LiteralExpression(1), 252f.LiteralExpression(2)),
Microsoft.CodeAnalysis.Features (6)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (3)
139generator.LiteralExpression(DebuggerDisplayPrefix), 141generator.LiteralExpression(DebuggerDisplaySuffix)); 146attributeArgument = generator.LiteralExpression(
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
211var zero = generator.LiteralExpression(0);
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
163var literalOne = replacer.Generator.LiteralExpression(1);
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
47editor.ReplaceNode(node, editor.Generator.LiteralExpression(newDocCommentId).WithTriviaFrom(node));
Microsoft.CodeAnalysis.VisualBasic.Features (2)
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (2)
96DirectCast(generator.LiteralExpression(0), ExpressionSyntax), 99collectionVariable, foreachInfo.CountName), generator.LiteralExpression(1)), ExpressionSyntax)),
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (56)
CodeGeneration\SyntaxGeneratorTests.vb (56)
62VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(0), "0") 63VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(1), "1") 64VerifySyntax(Of UnaryExpressionSyntax)(Generator.LiteralExpression(-1), "-1") 65VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Integer.MinValue), "Global.System.Int32.MinValue") 66VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Integer.MaxValue), "Global.System.Int32.MaxValue") 68VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(0L), "0L") 69VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(1L), "1L") 70VerifySyntax(Of UnaryExpressionSyntax)(Generator.LiteralExpression(-1L), "-1L") 71VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Long.MinValue), "Global.System.Int64.MinValue") 72VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Long.MaxValue), "Global.System.Int64.MaxValue") 74VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(0UL), "0UL") 75VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(1UL), "1UL") 76VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(ULong.MinValue), "0UL") 77VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(ULong.MaxValue), "Global.System.UInt64.MaxValue") 79VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(0.0F), "0F") 80VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(1.0F), "1F") 81VerifySyntax(Of UnaryExpressionSyntax)(Generator.LiteralExpression(-1.0F), "-1F") 82VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Single.MinValue), "Global.System.Single.MinValue") 83VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Single.MaxValue), "Global.System.Single.MaxValue") 84VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Single.Epsilon), "Global.System.Single.Epsilon") 85VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Single.NaN), "Global.System.Single.NaN") 86VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Single.NegativeInfinity), "Global.System.Single.NegativeInfinity") 87VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Single.PositiveInfinity), "Global.System.Single.PositiveInfinity") 89VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(0.0), "0R") 90VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(1.0), "1R") 91VerifySyntax(Of UnaryExpressionSyntax)(Generator.LiteralExpression(-1.0), "-1R") 92VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Double.MinValue), "Global.System.Double.MinValue") 93VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Double.MaxValue), "Global.System.Double.MaxValue") 94VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Double.Epsilon), "Global.System.Double.Epsilon") 95VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Double.NaN), "Global.System.Double.NaN") 96VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Double.NegativeInfinity), "Global.System.Double.NegativeInfinity") 97VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Double.PositiveInfinity), "Global.System.Double.PositiveInfinity") 99VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(0D), "0D") 100VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(0.00D), "0.00D") 101VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("1.00", CultureInfo.InvariantCulture)), "1.00D") 102VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("-1.00", CultureInfo.InvariantCulture)), "-1.00D") 103VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("1.0000000000", CultureInfo.InvariantCulture)), "1.0000000000D") 104VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("0.000000", CultureInfo.InvariantCulture)), "0.000000D") 105VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("0.0000000", CultureInfo.InvariantCulture)), "0.0000000D") 106VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(1000000000D), "1000000000D") 107VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(123456789.123456789D), "123456789.123456789D") 108VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("1E-28", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000001D") 109VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("0E-28", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D") 110VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("1E-29", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D") 111VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("-1E-29", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D") 112VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Decimal.MinValue), "Global.System.Decimal.MinValue") 113VerifySyntax(Of MemberAccessExpressionSyntax)(Generator.LiteralExpression(Decimal.MaxValue), "Global.System.Decimal.MaxValue") 115VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression("c"c), """c""c") 117VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression("str"), """str""") 119VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(True), "True") 120VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(False), "False") 350Generator.ArrayCreationExpression(Generator.IdentifierName("x"), Generator.LiteralExpression(10)), 484VerifySyntax(Of YieldStatementSyntax)(Generator.YieldReturnStatement(Generator.LiteralExpression(1)), "Yield 1") 832Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), initializer:=Generator.LiteralExpression(0)), 1620Generator.EnumDeclaration("e", members:={Generator.EnumMember("a", Generator.LiteralExpression(0)), Generator.EnumMember("b"), Generator.EnumMember("c", Generator.LiteralExpression(5))}),
Microsoft.CodeAnalysis.Workspaces (6)
Editing\SyntaxGenerator.cs (3)
1813=> LiteralExpression(false); 1819=> LiteralExpression(true); 1825=> LiteralExpression(value: null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (3)
92return [factory.ReturnStatement(factory.LiteralExpression(0))]; 189? factory.NegateExpression(factory.LiteralExpression(-value)) 190: factory.LiteralExpression(value);
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
544generator.LiteralExpression(AppendSuffix(methodName, entryPointSuffix.Value))));
System.Text.RegularExpressions.Generator (2)
UpgradeToGeneratedRegexCodeFixer.cs (2)
215cultureNameValue = generator.LiteralExpression(CultureInfo.CurrentCulture.Name); 305return generator.LiteralExpression(argument.Value.ConstantValue.Value);