25 references to FormatPrimitive
Microsoft.AspNetCore.App.Analyzers (3)
src\Shared\RoslynUtils\SymbolExtensions.cs (3)
194float f => $"{SymbolDisplay.FormatPrimitive(f, false, false)}F", 198decimal d => $"{SymbolDisplay.FormatPrimitive(d, false, false)}M", 199_ => SymbolDisplay.FormatPrimitive(defaultValue, false, false),
Microsoft.AspNetCore.Http.RequestDelegateGenerator (4)
src\Shared\RoslynUtils\SymbolExtensions.cs (3)
194float f => $"{SymbolDisplay.FormatPrimitive(f, false, false)}F", 198decimal d => $"{SymbolDisplay.FormatPrimitive(d, false, false)}M", 199_ => SymbolDisplay.FormatPrimitive(defaultValue, false, false),
StaticRouteHandlerModel\EndpointParameter.cs (1)
159KeyedServiceKey = SymbolDisplay.FormatPrimitive(constructorArgument.Value!, true, true);
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor_Constants.cs (1)
45var valueString = SymbolDisplay.FormatPrimitive(value, quoteStrings: true, useHexadecimalNumbers: false);
Symbols\TypedConstantExtensions.cs (1)
43return SymbolDisplay.FormatPrimitive(constant.ValueInternal, quoteStrings: true, useHexadecimalNumbers: false);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (16)
SymbolDisplay\SymbolDisplayTests.cs (16)
5070Assert.Equal("1", SymbolDisplay.FormatPrimitive(1, quoteStrings: false, useHexadecimalNumbers: false)); 5071Assert.Equal("1", SymbolDisplay.FormatPrimitive((uint)1, quoteStrings: false, useHexadecimalNumbers: false)); 5072Assert.Equal("1", SymbolDisplay.FormatPrimitive((byte)1, quoteStrings: false, useHexadecimalNumbers: false)); 5073Assert.Equal("1", SymbolDisplay.FormatPrimitive((sbyte)1, quoteStrings: false, useHexadecimalNumbers: false)); 5074Assert.Equal("1", SymbolDisplay.FormatPrimitive((short)1, quoteStrings: false, useHexadecimalNumbers: false)); 5075Assert.Equal("1", SymbolDisplay.FormatPrimitive((ushort)1, quoteStrings: false, useHexadecimalNumbers: false)); 5076Assert.Equal("1", SymbolDisplay.FormatPrimitive((long)1, quoteStrings: false, useHexadecimalNumbers: false)); 5077Assert.Equal("1", SymbolDisplay.FormatPrimitive((ulong)1, quoteStrings: false, useHexadecimalNumbers: false)); 5078Assert.Equal("x", SymbolDisplay.FormatPrimitive('x', quoteStrings: false, useHexadecimalNumbers: false)); 5079Assert.Equal("true", SymbolDisplay.FormatPrimitive(true, quoteStrings: false, useHexadecimalNumbers: false)); 5080Assert.Equal("1.5", SymbolDisplay.FormatPrimitive(1.5, quoteStrings: false, useHexadecimalNumbers: false)); 5081Assert.Equal("1.5", SymbolDisplay.FormatPrimitive((float)1.5, quoteStrings: false, useHexadecimalNumbers: false)); 5082Assert.Equal("1.5", SymbolDisplay.FormatPrimitive((decimal)1.5, quoteStrings: false, useHexadecimalNumbers: false)); 5083Assert.Equal("null", SymbolDisplay.FormatPrimitive(null, quoteStrings: false, useHexadecimalNumbers: false)); 5084Assert.Equal("abc", SymbolDisplay.FormatPrimitive("abc", quoteStrings: false, useHexadecimalNumbers: false)); 5085Assert.Null(SymbolDisplay.FormatPrimitive(SymbolDisplayFormat.TestFormat, quoteStrings: false, useHexadecimalNumbers: false));