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)
4898
Assert.Equal("1", SymbolDisplay.
FormatPrimitive
(1, quoteStrings: false, useHexadecimalNumbers: false));
4899
Assert.Equal("1", SymbolDisplay.
FormatPrimitive
((uint)1, quoteStrings: false, useHexadecimalNumbers: false));
4900
Assert.Equal("1", SymbolDisplay.
FormatPrimitive
((byte)1, quoteStrings: false, useHexadecimalNumbers: false));
4901
Assert.Equal("1", SymbolDisplay.
FormatPrimitive
((sbyte)1, quoteStrings: false, useHexadecimalNumbers: false));
4902
Assert.Equal("1", SymbolDisplay.
FormatPrimitive
((short)1, quoteStrings: false, useHexadecimalNumbers: false));
4903
Assert.Equal("1", SymbolDisplay.
FormatPrimitive
((ushort)1, quoteStrings: false, useHexadecimalNumbers: false));
4904
Assert.Equal("1", SymbolDisplay.
FormatPrimitive
((long)1, quoteStrings: false, useHexadecimalNumbers: false));
4905
Assert.Equal("1", SymbolDisplay.
FormatPrimitive
((ulong)1, quoteStrings: false, useHexadecimalNumbers: false));
4906
Assert.Equal("x", SymbolDisplay.
FormatPrimitive
('x', quoteStrings: false, useHexadecimalNumbers: false));
4907
Assert.Equal("true", SymbolDisplay.
FormatPrimitive
(true, quoteStrings: false, useHexadecimalNumbers: false));
4908
Assert.Equal("1.5", SymbolDisplay.
FormatPrimitive
(1.5, quoteStrings: false, useHexadecimalNumbers: false));
4909
Assert.Equal("1.5", SymbolDisplay.
FormatPrimitive
((float)1.5, quoteStrings: false, useHexadecimalNumbers: false));
4910
Assert.Equal("1.5", SymbolDisplay.
FormatPrimitive
((decimal)1.5, quoteStrings: false, useHexadecimalNumbers: false));
4911
Assert.Equal("null", SymbolDisplay.
FormatPrimitive
(null, quoteStrings: false, useHexadecimalNumbers: false));
4912
Assert.Equal("abc", SymbolDisplay.
FormatPrimitive
("abc", quoteStrings: false, useHexadecimalNumbers: false));
4913
Assert.Null(SymbolDisplay.
FormatPrimitive
(SymbolDisplayFormat.TestFormat, quoteStrings: false, useHexadecimalNumbers: false));