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