137 references to SymbolDisplay
ConfigurationSchemaGenerator (2)
RuntimeSource\SourceGenerators\CSharpSyntaxUtilities.cs (2)
28
return
SymbolDisplay
.FormatLiteral(@string, quote: true);
30
return
SymbolDisplay
.FormatLiteral(@char, quote: true);
Microsoft.AspNetCore.App.Analyzers (7)
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (7)
249
return $"({enumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}){
SymbolDisplay
.FormatPrimitive(defaultValue!, false, false)}";
259
return $"({underlyingEnumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}){
SymbolDisplay
.FormatPrimitive(defaultValue!, false, false)}";
264
string s =>
SymbolDisplay
.FormatLiteral(s, true),
265
char c =>
SymbolDisplay
.FormatLiteral(c, true),
271
float f => $"{
SymbolDisplay
.FormatPrimitive(f, false, false)}F",
275
decimal d => $"{
SymbolDisplay
.FormatPrimitive(d, false, false)}M",
276
_ =>
SymbolDisplay
.FormatPrimitive(defaultValue, false, false)!,
Microsoft.AspNetCore.Http.RequestDelegateGenerator (66)
RequestDelegateGenerator.Emitter.cs (1)
110
codeWriter.WriteLine($"{
SymbolDisplay
.FormatLiteral("{*path:nonfile}", true)},");
RequestDelegateGeneratorSources.cs (23)
249
LoggerMessage.Define(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.RequestBodyIOExceptionEventId}}, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.RequestBodyIOExceptionEventName, true)}}), {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.RequestBodyIOExceptionMessage, true)}});
255
var message = string.Format(CultureInfo.InvariantCulture, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.InvalidJsonRequestBodyExceptionMessage, true)}}, parameterTypeName, parameterName);
266
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.InvalidJsonRequestBodyEventId}}, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.InvalidJsonRequestBodyEventName, true)}}), {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.InvalidJsonRequestBodyLogMessage, true)}});
272
var message = string.Format(CultureInfo.InvariantCulture, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.ParameterBindingFailedExceptionMessage, true)}}, parameterTypeName, parameterName, sourceValue);
283
LoggerMessage.Define<string, string, string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.ParameterBindingFailedEventId}}, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.ParameterBindingFailedEventName, true)}}), {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.ParameterBindingFailedLogMessage, true)}});
289
var message = string.Format(CultureInfo.InvariantCulture, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.RequiredParameterNotProvidedExceptionMessage, true)}}, parameterTypeName, parameterName, source);
300
LoggerMessage.Define<string, string, string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.RequiredParameterNotProvidedEventId}}, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.RequiredParameterNotProvidedEventName, true)}}), {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.RequiredParameterNotProvidedLogMessage, true)}});
306
var message = string.Format(CultureInfo.InvariantCulture, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.ImplicitBodyNotProvidedExceptionMessage, true)}}, parameterName);
317
LoggerMessage.Define<string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.ImplicitBodyNotProvidedEventId}}, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.ImplicitBodyNotProvidedEventName, true)}}), {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.ImplicitBodyNotProvidedLogMessage, true)}});
323
var message = string.Format(CultureInfo.InvariantCulture, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.UnexpectedJsonContentTypeExceptionMessage, true)}}, contentType);
334
LoggerMessage.Define<string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.UnexpectedJsonContentTypeEventId}}, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.UnexpectedJsonContentTypeEventName, true)}}), {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.UnexpectedJsonContentTypeLogMessage, true)}});
340
var message = string.Format(CultureInfo.InvariantCulture, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.UnexpectedFormContentTypeExceptionMessage, true)}}, contentType);
351
LoggerMessage.Define<string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.UnexpectedFormContentTypeEventId}}, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.UnexpectedFormContentTypeLogEventName, true)}}), {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.UnexpectedFormContentTypeLogMessage, true)}});
357
var message = string.Format(CultureInfo.InvariantCulture, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.InvalidFormRequestBodyExceptionMessage, true)}}, parameterTypeName, parameterName);
368
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.InvalidFormRequestBodyEventId}}, {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.InvalidFormRequestBodyEventName, true)}}), {{
SymbolDisplay
.FormatLiteral(RequestDelegateCreationLogging.InvalidFormRequestBodyLogMessage, true)}});
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (7)
249
return $"({enumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}){
SymbolDisplay
.FormatPrimitive(defaultValue!, false, false)}";
259
return $"({underlyingEnumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}){
SymbolDisplay
.FormatPrimitive(defaultValue!, false, false)}";
264
string s =>
SymbolDisplay
.FormatLiteral(s, true),
265
char c =>
SymbolDisplay
.FormatLiteral(c, true),
271
float f => $"{
SymbolDisplay
.FormatPrimitive(f, false, false)}F",
275
decimal d => $"{
SymbolDisplay
.FormatPrimitive(d, false, false)}M",
276
_ =>
SymbolDisplay
.FormatPrimitive(defaultValue, false, false)!,
StaticRouteHandlerModel\Emitters\EndpointEmitter.cs (2)
121
codeWriter.WriteLine($"ResolveJsonBodyOrService<{parameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)}>(logOrThrowExceptionHelper, {
SymbolDisplay
.FormatLiteral(shortParameterTypeName, true)}, {
SymbolDisplay
.FormatLiteral(parameter.SymbolName, true)}, jsonSerializerOptions, serviceProviderIsService);");
StaticRouteHandlerModel\Emitters\EndpointParameterEmitter.cs (26)
50
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({
SymbolDisplay
.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.SymbolName, true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.ToMessageString(), true)});");
68
var assigningCode = $"await GeneratedRouteBuilderExtensionsCore.TryResolveFormAsync(httpContext, logOrThrowExceptionHelper, {
SymbolDisplay
.FormatLiteral(shortParameterTypeName, true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.SymbolName, true)})";
86
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({
SymbolDisplay
.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.SymbolName, true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.ToMessageString(), true)});");
183
writer.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({
SymbolDisplay
.FormatLiteral(parameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {
SymbolDisplay
.FormatLiteral(parameter.SymbolName, true)}, {
SymbolDisplay
.FormatLiteral(parameter.ToMessageString(), true)});");
187
writer.WriteLine($@"logOrThrowExceptionHelper.ParameterBindingFailed({
SymbolDisplay
.FormatLiteral(parameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {
SymbolDisplay
.FormatLiteral(parameter.SymbolName, true)}, {inputArgument});");
212
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({
SymbolDisplay
.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.SymbolName, true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.ToMessageString(), true)});");
243
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({
SymbolDisplay
.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.SymbolName, true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.ToMessageString(), true)});");
259
var assigningCode = $"await GeneratedRouteBuilderExtensionsCore.TryResolveBodyAsync<{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)}>(httpContext, logOrThrowExceptionHelper, {(endpointParameter.IsOptional ? "true" : "false")}, {
SymbolDisplay
.FormatLiteral(shortParameterTypeName, true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.SymbolName, true)}, {endpointParameter.SymbolName}_JsonTypeInfo)";
320
var assigningCode = $"await GeneratedRouteBuilderExtensionsCore.TryResolveBodyAsync<{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)}>(httpContext, logOrThrowExceptionHelper, {(endpointParameter.IsOptional ? "true" : "false")}, {
SymbolDisplay
.FormatLiteral(shortParameterTypeName, true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.SymbolName, true)}, {endpointParameter.SymbolName}_JsonTypeInfo)";
379
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({
SymbolDisplay
.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.SymbolName, true)}, {
SymbolDisplay
.FormatLiteral(endpointParameter.ToMessageString(), true)});");
StaticRouteHandlerModel\EndpointParameter.cs (6)
46
var propertyInfo = $"typeof({property.ContainingType.ToDisplayString()})!.GetProperty({
SymbolDisplay
.FormatLiteral(property.Name, true)})!";
104
AssigningCode = $"httpContext.Request.Form.Files[{
SymbolDisplay
.FormatLiteral(LookupName, true)}]";
122
? $"(string?)httpContext.Request.Form[{
SymbolDisplay
.FormatLiteral(LookupName, true)}]"
123
: $"httpContext.Request.Form[{
SymbolDisplay
.FormatLiteral(LookupName, true)}].ToArray()";
160
KeyedServiceKey =
SymbolDisplay
.FormatPrimitive(constructorArgument.Value!, true, true);
209
AssigningCode = $"httpContext.Request.Form.Files[{
SymbolDisplay
.FormatLiteral(LookupName, true)}]";
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (1)
392
var parameterName =
SymbolDisplay
.FormatLiteral(parameter.SymbolName, true);
Microsoft.CodeAnalysis.CSharp (26)
Errors\MessageProvider.cs (1)
106
return
SymbolDisplay
.ToDisplayString(symbol, SymbolDisplayFormat.CSharpShortErrorMessageFormat);
SymbolDisplay\SymbolDisplayVisitor_Constants.cs (1)
45
var valueString =
SymbolDisplay
.FormatPrimitive(value, quoteStrings: true, useHexadecimalNumbers: false);
Symbols\PublicModel\PreprocessingSymbol.cs (5)
80
return
SymbolDisplay
.ToDisplayString(this, format);
85
return
SymbolDisplay
.ToDisplayParts(this, format);
90
return
SymbolDisplay
.ToMinimalDisplayString(this, Symbol.GetCSharpSemanticModel(semanticModel), position, format);
95
return
SymbolDisplay
.ToMinimalDisplayParts(this, Symbol.GetCSharpSemanticModel(semanticModel), position, format);
136
return
SymbolDisplay
.ToDisplayString(this);
Symbols\PublicModel\Symbol.cs (5)
166
return
SymbolDisplay
.ToDisplayString(this, format);
171
return
SymbolDisplay
.ToDisplayParts(this, format);
176
return
SymbolDisplay
.ToMinimalDisplayString(this, GetCSharpSemanticModel(semanticModel), position, format);
181
return
SymbolDisplay
.ToMinimalDisplayParts(this, GetCSharpSemanticModel(semanticModel), position, format);
254
return
SymbolDisplay
.ToDisplayString(this);
Symbols\PublicModel\TypeSymbol.cs (4)
177
return
SymbolDisplay
.ToDisplayString(this, topLevelNullability, format);
182
return
SymbolDisplay
.ToDisplayParts(this, topLevelNullability, format);
187
return
SymbolDisplay
.ToMinimalDisplayString(this, topLevelNullability, semanticModel, position, format);
192
return
SymbolDisplay
.ToMinimalDisplayParts(this, topLevelNullability, semanticModel, position, format);
Symbols\Symbol.cs (4)
1485
return
SymbolDisplay
.ToDisplayString(ISymbol, format);
1490
return
SymbolDisplay
.ToDisplayParts(ISymbol, format);
1498
return
SymbolDisplay
.ToMinimalDisplayString(ISymbol, semanticModel, position, format);
1506
return
SymbolDisplay
.ToMinimalDisplayParts(ISymbol, semanticModel, position, format);
Symbols\TypedConstantExtensions.cs (1)
43
var result =
SymbolDisplay
.FormatPrimitive(constant.ValueInternal, quoteStrings: true, useHexadecimalNumbers: false);
Symbols\TypeSymbol.cs (4)
669
return
SymbolDisplay
.ToDisplayString((ITypeSymbol)ISymbol, topLevelNullability, format);
674
return
SymbolDisplay
.ToDisplayParts((ITypeSymbol)ISymbol, topLevelNullability, format);
683
return
SymbolDisplay
.ToMinimalDisplayString((ITypeSymbol)ISymbol, topLevelNullability, semanticModel, position, format);
692
return
SymbolDisplay
.ToMinimalDisplayParts((ITypeSymbol)ISymbol, topLevelNullability, semanticModel, position, format);
Syntax\SyntaxFactory.cs (1)
599
return Literal(
SymbolDisplay
.FormatLiteral(value, quote: true), value);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
31
=>
SymbolDisplay
.ToDisplayString(disposeImplMethod, format);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
114
var valueString =
SymbolDisplay
.FormatLiteral(val, quote: true);
121
var literal =
SymbolDisplay
.FormatLiteral(val, quote: true);
Microsoft.CodeAnalysis.CSharp.Features (6)
GenerateConstructors\CSharpGenerateConstructorsCodeRefactoringProvider.cs (1)
48
=>
SymbolDisplay
.ToDisplayString(parameter, format);
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (2)
120
var displayParts = CodeAnalysis.CSharp.
SymbolDisplay
.ToMinimalDisplayParts(symbol, semanticModel, position, format);
170
=> symbol == null ? null : CodeAnalysis.CSharp.
SymbolDisplay
.ToDisplayString(symbol, SymbolDisplayFormat.MinimallyQualifiedFormat);
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.cs (2)
45
static symbol => symbol is null ? null :
SymbolDisplay
.ToDisplayString(symbol, SymbolDisplayFormat.MinimallyQualifiedFormat));
82
result.AddRange(
SymbolDisplay
.ToMinimalDisplayParts(method, semanticModel, position, MinimallyQualifiedWithoutParametersFormat));
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
31
=>
SymbolDisplay
.ToDisplayString(disposeImplMethod, format);
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Performance\CSharpUseSearchValues.Fixer.cs (1)
134
string stringLiteral =
SymbolDisplay
.FormatLiteral(valuesString, quote: true);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
114
var valueString =
SymbolDisplay
.FormatLiteral(val, quote: true);
121
var literal =
SymbolDisplay
.FormatLiteral(val, quote: true);
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (1)
494
withAttributes.Append(
SymbolDisplay
.FormatPrimitive(arg.Value!, quoteStrings: true, useHexadecimalNumbers: true));
Microsoft.Extensions.Configuration.Binder.SourceGeneration (2)
src\runtime\src\libraries\Common\src\SourceGenerators\CSharpSyntaxUtilities.cs (2)
28
return
SymbolDisplay
.FormatLiteral(@string, quote: true);
30
return
SymbolDisplay
.FormatLiteral(@char, quote: true);
Microsoft.Extensions.Logging.Generators (3)
LoggerMessageGenerator.Emitter.cs (3)
188
{nestedIndentation}return {formatMethodBegin}${
SymbolDisplay
.FormatLiteral(lm.Message, quote: true)}{formatMethodEnd};
289
_builder.AppendLine($" {nestedIndentation}{index++} => new global::System.Collections.Generic.KeyValuePair<string, object?>(\"{{OriginalFormat}}\", {
SymbolDisplay
.FormatLiteral(lm.Message, quote: true)}),");
453
_builder.Append(@$"({level}, new global::Microsoft.Extensions.Logging.EventId({lm.EventId}, {eventName}), {
SymbolDisplay
.FormatLiteral(lm.Message, quote: true)}, new global::Microsoft.Extensions.Logging.LogDefineOptions() {{ SkipEnabledCheck = true }});
Microsoft.Extensions.Validation.ValidationsGenerator (9)
Emitters\ValidationsGenerator.Emitter.cs (2)
409
return $"new global::Microsoft.Extensions.Validation.Generated.LiteralDisplayName({
SymbolDisplay
.FormatLiteral(member.DisplayName, quote: true)})";
422
return $"new global::Microsoft.Extensions.Validation.Generated.LiteralDisplayName({
SymbolDisplay
.FormatLiteral(validatableType.DisplayName, quote: true)})";
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (7)
249
return $"({enumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}){
SymbolDisplay
.FormatPrimitive(defaultValue!, false, false)}";
259
return $"({underlyingEnumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}){
SymbolDisplay
.FormatPrimitive(defaultValue!, false, false)}";
264
string s =>
SymbolDisplay
.FormatLiteral(s, true),
265
char c =>
SymbolDisplay
.FormatLiteral(c, true),
271
float f => $"{
SymbolDisplay
.FormatPrimitive(f, false, false)}F",
275
decimal d => $"{
SymbolDisplay
.FormatPrimitive(d, false, false)}M",
276
_ =>
SymbolDisplay
.FormatPrimitive(defaultValue, false, false)!,
Microsoft.Gen.Logging (1)
Emission\Emitter.Utils.cs (1)
16
internal static string EscapeMessageString(string s) =>
SymbolDisplay
.FormatLiteral(s, true);
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
114
var valueString =
SymbolDisplay
.FormatLiteral(val, quote: true);
121
var literal =
SymbolDisplay
.FormatLiteral(val, quote: true);
System.Text.Json.SourceGeneration (4)
JsonSourceGenerator.Emitter.cs (2)
2396
private static string FormatStringLiteral(string? value) => value is null ? "null" :
SymbolDisplay
.FormatLiteral(value, quote: true);
2397
private static string FormatCharLiteral(char value) =>
SymbolDisplay
.FormatLiteral(value, quote: true);
src\runtime\src\libraries\Common\src\SourceGenerators\CSharpSyntaxUtilities.cs (2)
28
return
SymbolDisplay
.FormatLiteral(@string, quote: true);
30
return
SymbolDisplay
.FormatLiteral(@char, quote: true);
System.Text.RegularExpressions.Generator (2)
RegexGenerator.Emitter.cs (2)
5547
private static string Literal(char c) =>
SymbolDisplay
.FormatLiteral(c, quote: true);
5550
private static string Literal(string s, bool quote = true) =>
SymbolDisplay
.FormatLiteral(s, quote);