69 references to FormatLiteral
ConfigurationSchemaGenerator (1)
RuntimeSource\SourceGenerators\CSharpSyntaxUtilities.cs (1)
28
return SymbolDisplay.
FormatLiteral
(@string, quote: true);
Microsoft.AspNetCore.App.Analyzers (1)
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
187
string s => SymbolDisplay.
FormatLiteral
(s, true),
Microsoft.AspNetCore.Http.RequestDelegateGenerator (59)
RequestDelegateGenerator.cs (1)
147
codeWriter.WriteLine($"{SymbolDisplay.
FormatLiteral
("{*path:nonfile}", true)},");
RequestDelegateGeneratorSources.cs (23)
228
LoggerMessage.Define(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.RequestBodyIOExceptionEventId}}, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.RequestBodyIOExceptionEventName, true)}}), {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.RequestBodyIOExceptionMessage, true)}});
234
var message = string.Format(CultureInfo.InvariantCulture, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.InvalidJsonRequestBodyExceptionMessage, true)}}, parameterTypeName, parameterName);
245
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.InvalidJsonRequestBodyEventId}}, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.InvalidJsonRequestBodyEventName, true)}}), {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.InvalidJsonRequestBodyLogMessage, true)}});
251
var message = string.Format(CultureInfo.InvariantCulture, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.ParameterBindingFailedExceptionMessage, true)}}, parameterTypeName, parameterName, sourceValue);
262
LoggerMessage.Define<string, string, string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.ParameterBindingFailedEventId}}, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.ParameterBindingFailedEventName, true)}}), {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.ParameterBindingFailedLogMessage, true)}});
268
var message = string.Format(CultureInfo.InvariantCulture, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.RequiredParameterNotProvidedExceptionMessage, true)}}, parameterTypeName, parameterName, source);
279
LoggerMessage.Define<string, string, string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.RequiredParameterNotProvidedEventId}}, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.RequiredParameterNotProvidedEventName, true)}}), {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.RequiredParameterNotProvidedLogMessage, true)}});
285
var message = string.Format(CultureInfo.InvariantCulture, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.ImplicitBodyNotProvidedExceptionMessage, true)}}, parameterName);
296
LoggerMessage.Define<string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.ImplicitBodyNotProvidedEventId}}, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.ImplicitBodyNotProvidedEventName, true)}}), {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.ImplicitBodyNotProvidedLogMessage, true)}});
302
var message = string.Format(CultureInfo.InvariantCulture, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.UnexpectedJsonContentTypeExceptionMessage, true)}}, contentType);
313
LoggerMessage.Define<string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.UnexpectedJsonContentTypeEventId}}, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.UnexpectedJsonContentTypeEventName, true)}}), {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.UnexpectedJsonContentTypeLogMessage, true)}});
319
var message = string.Format(CultureInfo.InvariantCulture, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.UnexpectedFormContentTypeExceptionMessage, true)}}, contentType);
330
LoggerMessage.Define<string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.UnexpectedFormContentTypeEventId}}, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.UnexpectedFormContentTypeLogEventName, true)}}), {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.UnexpectedFormContentTypeLogMessage, true)}});
336
var message = string.Format(CultureInfo.InvariantCulture, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.InvalidFormRequestBodyExceptionMessage, true)}}, parameterTypeName, parameterName);
347
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId({{RequestDelegateCreationLogging.InvalidFormRequestBodyEventId}}, {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.InvalidFormRequestBodyEventName, true)}}), {{SymbolDisplay.
FormatLiteral
(RequestDelegateCreationLogging.InvalidFormRequestBodyLogMessage, true)}});
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
187
string s => SymbolDisplay.
FormatLiteral
(s, true),
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)
47
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.
FormatLiteral
(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.SymbolName, true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.ToMessageString(), true)});");
65
var assigningCode = $"await GeneratedRouteBuilderExtensionsCore.TryResolveFormAsync(httpContext, logOrThrowExceptionHelper, {SymbolDisplay.
FormatLiteral
(shortParameterTypeName, true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.SymbolName, true)})";
83
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.
FormatLiteral
(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.SymbolName, true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.ToMessageString(), true)});");
180
writer.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.
FormatLiteral
(parameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.
FormatLiteral
(parameter.SymbolName, true)}, {SymbolDisplay.
FormatLiteral
(parameter.ToMessageString(), true)});");
184
writer.WriteLine($@"logOrThrowExceptionHelper.ParameterBindingFailed({SymbolDisplay.
FormatLiteral
(parameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.
FormatLiteral
(parameter.SymbolName, true)}, {inputArgument});");
209
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.
FormatLiteral
(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.SymbolName, true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.ToMessageString(), true)});");
240
codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.
FormatLiteral
(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.SymbolName, true)}, {SymbolDisplay.
FormatLiteral
(endpointParameter.ToMessageString(), true)});");
256
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)";
317
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)";
376
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 (5)
45
var propertyInfo = $"typeof({property.ContainingType.ToDisplayString()})!.GetProperty({SymbolDisplay.
FormatLiteral
(property.Name, true)})!";
103
AssigningCode = $"httpContext.Request.Form.Files[{SymbolDisplay.
FormatLiteral
(LookupName, true)}]";
121
? $"(string?)httpContext.Request.Form[{SymbolDisplay.
FormatLiteral
(LookupName, true)}]"
122
: $"httpContext.Request.Form[{SymbolDisplay.
FormatLiteral
(LookupName, true)}].ToArray()";
208
AssigningCode = $"httpContext.Request.Form.Files[{SymbolDisplay.
FormatLiteral
(LookupName, true)}]";
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (1)
393
var parameterName = SymbolDisplay.
FormatLiteral
(parameter.SymbolName, true);
Microsoft.CodeAnalysis.CSharp (1)
Syntax\SyntaxFactory.cs (1)
570
return Literal(SymbolDisplay.
FormatLiteral
(value, quote: true), value);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
108
var valueString = SymbolDisplay.
FormatLiteral
(val, quote: true);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\UnsafeTests.cs (1)
5245
text = SymbolDisplay.
FormatLiteral
(text, quote: false);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
108
var valueString = SymbolDisplay.
FormatLiteral
(val, quote: true);
Microsoft.Gen.Logging (1)
Emission\Emitter.Utils.cs (1)
16
internal static string EscapeMessageString(string s) => SymbolDisplay.
FormatLiteral
(s, true);
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Emitter.cs (1)
1459
private static string FormatStringLiteral(string? value) => value is null ? "null" : SymbolDisplay.
FormatLiteral
(value, quote: true);
src\libraries\Common\src\SourceGenerators\CSharpSyntaxUtilities.cs (1)
28
return SymbolDisplay.
FormatLiteral
(@string, quote: true);
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Emitter.cs (1)
5417
private static string Literal(string s, bool quote = true) => SymbolDisplay.
FormatLiteral
(s, quote);