6 implementations of ToDisplayString
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.Features (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (1)
908 references to ToDisplayString
ConfigurationSchemaGenerator (9)
ILLink.RoslynAnalyzer (5)
Microsoft.Analyzers.Extra (2)
Microsoft.Analyzers.Local (9)
Microsoft.AspNetCore.Analyzers (1)
Microsoft.AspNetCore.Analyzers.Test (1)
Microsoft.AspNetCore.App.Analyzers (2)
Microsoft.AspNetCore.Components.Analyzers (12)
Microsoft.AspNetCore.Components.SdkAnalyzers (11)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (56)
StaticRouteHandlerModel\Emitters\EndpointParameterEmitter.cs (27)
47codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.FormatLiteral(endpointParameter.SymbolName, true)}, {SymbolDisplay.FormatLiteral(endpointParameter.ToMessageString(), true)});");
64var shortParameterTypeName = endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat);
83codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.FormatLiteral(endpointParameter.SymbolName, true)}, {SymbolDisplay.FormatLiteral(endpointParameter.ToMessageString(), true)});");
95var createArray = $"new {endpointParameter.ElementType.ToDisplayString(EmitterConstants.DisplayFormat)}[{endpointParameter.EmitTempArgument()}.Length]";
98codeWriter.WriteLine($"{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)} {endpointParameter.EmitHandlerArgument()} = {createArray};");
128codeWriter.WriteLine($"{endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)} {endpointParameter.EmitHandlerArgument()} = {endpointParameter.EmitTempArgument()}!;");
141codeWriter.WriteLine($"""{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)} {output_argument} = default;""");
167codeWriter.WriteLine($"{endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)} {endpointParameter.EmitHandlerArgument()} = {endpointParameter.EmitParsedTempArgument()}!;");
172codeWriter.WriteLine($"{endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)} {endpointParameter.EmitHandlerArgument()} = {endpointParameter.EmitTempArgument()}!;");
180writer.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.FormatLiteral(parameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.FormatLiteral(parameter.SymbolName, true)}, {SymbolDisplay.FormatLiteral(parameter.ToMessageString(), true)});");
184writer.WriteLine($@"logOrThrowExceptionHelper.ParameterBindingFailed({SymbolDisplay.FormatLiteral(parameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.FormatLiteral(parameter.SymbolName, true)}, {inputArgument});");
209codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.FormatLiteral(endpointParameter.SymbolName, true)}, {SymbolDisplay.FormatLiteral(endpointParameter.ToMessageString(), true)});");
240codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.FormatLiteral(endpointParameter.SymbolName, true)}, {SymbolDisplay.FormatLiteral(endpointParameter.ToMessageString(), true)});");
255var shortParameterTypeName = endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat);
256var 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)";
304codeWriter.WriteLine($"{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)} {endpointParameter.EmitHandlerArgument()} = null!;");
316var shortParameterTypeName = endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat);
317var 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)";
319codeWriter.WriteLine($"var {endpointParameter.SymbolName}_JsonTypeInfo = (JsonTypeInfo<{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)}>)jsonOptions.SerializerOptions.GetTypeInfo(typeof({endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormatWithoutNullability)}));");
341var bindMethodReceiverTypeString = bindMethodReceiverType?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
344var unwrappedTypeString = unwrappedType?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
376codeWriter.WriteLine($@"logOrThrowExceptionHelper.RequiredParameterNotProvided({SymbolDisplay.FormatLiteral(endpointParameter.Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat), true)}, {SymbolDisplay.FormatLiteral(endpointParameter.SymbolName, true)}, {SymbolDisplay.FormatLiteral(endpointParameter.ToMessageString(), true)});");
392$"httpContext.RequestServices.GetService<{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)}>();" :
393$"httpContext.RequestServices.GetRequiredService<{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)}>()";
407$"httpContext.RequestServices.GetKeyedService<{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)}>({endpointParameter.KeyedServiceKey});" :
408$"httpContext.RequestServices.GetRequiredKeyedService<{endpointParameter.Type.ToDisplayString(EmitterConstants.DisplayFormat)}>({endpointParameter.KeyedServiceKey})";
StaticRouteHandlerModel\EndpointParameter.cs (13)
45var propertyInfo = $"typeof({property.ContainingType.ToDisplayString()})!.GetProperty({SymbolDisplay.FormatLiteral(property.Name, true)})!";
167endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InvalidAsParametersNullable, location, Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat)));
183AssigningCode = $"new {namedTypeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)} {{ {parameterList} }}";
188AssigningCode = $"new {namedTypeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}({parameterList})";
343ParsabilityMethod.IParsable => (string inputArgument, string outputArgument) => $$"""GeneratedRouteBuilderExtensionsCore.TryParseExplicit<{{parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}}>({{inputArgument}}!, CultureInfo.InvariantCulture, out var {{outputArgument}})""",
344ParsabilityMethod.TryParseWithFormatProvider => (string inputArgument, string outputArgument) => $$"""{{parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}}.TryParse({{inputArgument}}!, CultureInfo.InvariantCulture, out var {{outputArgument}})""",
345ParsabilityMethod.TryParse => (string inputArgument, string outputArgument) => $$"""{{parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}}.TryParse({{inputArgument}}!, out var {{outputArgument}})""",
346ParsabilityMethod.Enum => (string inputArgument, string outputArgument) => $$"""Enum.TryParse<{{parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}}>({{inputArgument}}!, out var {{outputArgument}})""",
355preferredTryParseInvocation = (string inputArgument, string outputArgument) => $$"""{{parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}}.TryParse({{inputArgument}}!, out var {{outputArgument}})""";
359preferredTryParseInvocation = (string inputArgument, string outputArgument) => $$"""{{parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}}.TryParse({{inputArgument}}!, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AllowWhiteSpaces, out var {{outputArgument}})""";
363preferredTryParseInvocation = (string inputArgument, string outputArgument) => $$"""{{parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}}.TryParse({{inputArgument}}!, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AllowWhiteSpaces, out var {{outputArgument}})""";
367preferredTryParseInvocation = (string inputArgument, string outputArgument) => $$"""{{parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}}.TryParse({{inputArgument}}!, CultureInfo.InvariantCulture, DateTimeStyles.AllowWhiteSpaces, out var {{outputArgument}})""";
461var parameterTypeString = type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat);
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
Microsoft.CodeAnalysis (11)
Microsoft.CodeAnalysis.CodeStyle (6)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp (3)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (39)
CodeGen\CodeGenDeconstructTests.cs (36)
3701Assert.Equal("var", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString());
3706Assert.Equal("int", model.GetSymbolInfo(x2Type).Symbol.ToDisplayString());
3754Assert.Equal("int", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString());
3803Assert.Equal("D", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString());
3806Assert.Equal("D", x1Alias.Target.ToDisplayString());
3811Assert.Equal("int", model.GetSymbolInfo(x2Type).Symbol.ToDisplayString());
3943Assert.Equal("int", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString());
3948Assert.Equal("var", model.GetSymbolInfo(x2Type).Symbol.ToDisplayString());
3989Assert.Equal("int", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString());
3994Assert.Equal("int", model.GetSymbolInfo(x2Type).Symbol.ToDisplayString());
5036Assert.Equal("string", model.GetSymbolInfo(xType).Symbol.ToDisplayString());
5042Assert.Equal("int", model.GetSymbolInfo(yType).Symbol.ToDisplayString());
5188Assert.Equal("string", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString());
5819Assert.Equal("byte", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString());
5822Assert.Equal("byte", x1Alias.Target.ToDisplayString());
5827Assert.Equal("byte", model.GetSymbolInfo(x3Type).Symbol.ToDisplayString());
5830Assert.Equal("byte", x3Alias.Target.ToDisplayString());
5871Assert.Equal("var", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString());
5877Assert.Equal("var", model.GetSymbolInfo(x3Type).Symbol.ToDisplayString());
6001Assert.Equal("int _", symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6041Assert.Equal("int _", symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6050Assert.Equal("int _", symbolClone.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6094Assert.Equal("List<int> _", symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6144Assert.Equal("double _", symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6150Assert.Equal("int _", symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6257Assert.Equal("int _", symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6307Assert.Equal("long _", model.GetSymbolInfo(discard1).Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6405Assert.Equal("int _", model.GetSymbolInfo(discard2).Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
6997Assert.Equal("int _", model.GetSymbolInfo(discard3).Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
7356Assert.Equal("int", model.GetTypeInfo(x1Ref).Type.ToDisplayString());
7361Assert.Equal("string[]", model.GetTypeInfo(x2Ref).Type.ToDisplayString());
7395Assert.Equal("int", model.GetTypeInfo(x1Ref).Type.ToDisplayString());
7431Assert.Equal("int", model.GetTypeInfo(x1Ref.First()).Type.ToDisplayString());
7436Assert.Equal("string[]", model.GetTypeInfo(x2Ref.First()).Type.ToDisplayString());
7565Assert.Equal("int", model.GetTypeInfo(x1Ref).Type.ToDisplayString());
7569Assert.Equal("string", model.GetTypeInfo(x2Ref).Type.ToDisplayString());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (19)
Microsoft.CodeAnalysis.CSharp.Features (12)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (66)
Semantics\NullableReferenceTypesTests.cs (46)
71785Assert.Equal("object _", discard1.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
71789Assert.Equal("object? _", discard2.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
71793Assert.Equal("C<object> _", discard3.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
71797Assert.Equal("C<object?> _", discard4.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
71801Assert.Equal("C<object> _", discard5.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
71938Assert.Equal("object _", model.GetSymbolInfo(discard2).Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
76978.ToDisplayString(new SymbolDisplayFormat(delegateStyle: SymbolDisplayDelegateStyle.NameAndSignature,
76982.ToDisplayString(new SymbolDisplayFormat(delegateStyle: SymbolDisplayDelegateStyle.NameAndSignature,
76986.ToDisplayString(new SymbolDisplayFormat(delegateStyle: SymbolDisplayDelegateStyle.NameAndSignature,
77051.ToDisplayString(new SymbolDisplayFormat(delegateStyle: SymbolDisplayDelegateStyle.NameAndSignature,
111009Assert.Equal("C<T, U> where T : class! where U : T?", c.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints));
113650Assert.Equal("A<T> where T : class!", a.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNotNullableReferenceTypeModifier)));
113669Assert.Equal("A<T> where T : class", a.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNotNullableReferenceTypeModifier)));
113693Assert.Equal("A<T> where T : class?", a.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNullableReferenceTypeModifier)));
113694Assert.Equal("A<T> where T : class", a.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNotNullableReferenceTypeModifier)));
113715Assert.Equal("A<T> where T : class?", a.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNullableReferenceTypeModifier)));
113716Assert.Equal("A<T> where T : class", a.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNotNullableReferenceTypeModifier)));
113748Assert.Equal("A<T> where T : unmanaged!", a.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNotNullableReferenceTypeModifier)));
113769Assert.Equal("A<T> where T : unmanaged", a.ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNotNullableReferenceTypeModifier)));
145384Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145424Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145464Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145503Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145541Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145574Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145607Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145644Assert.Equal("Extension<object>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145683Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145953Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
145984Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
146017Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158063Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158066Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158099Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158194Assert.Equal("object", ((IMethodSymbol)model.GetSymbolInfo(item).Symbol).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158232Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158235Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158275Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158316Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158351Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158384Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158479Assert.Equal("object", ((IMethodSymbol)model.GetSymbolInfo(item).Symbol).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158485Assert.Equal("object", ((IMethodSymbol)found).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158527Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158571Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
158608Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (149)
Compilation\SemanticModelAPITests.cs (21)
2716Assert.Equal(expectedTypeDisplayString, symbol.ToDisplayString());
2721Assert.Equal(expectedTypeDisplayString, symbol.ToDisplayString());
2730Assert.Equal(expectedTypeDisplayString, symbol.ToDisplayString());
2735Assert.Equal(expectedTypeDisplayString, symbol.ToDisplayString());
2904Assert.Equal("A", symbol.ToDisplayString());
2905Assert.Equal("System.ArgumentException", symbol.Target.ToDisplayString());
2926Assert.Equal("int", symbol.ToDisplayString());
2939Assert.Equal("object", symbol.ToDisplayString());
2945Assert.Equal("object", symbol.ToDisplayString());
2966Assert.Equal("int", symbol.ToDisplayString());
2979Assert.Equal("A", symbol.ToDisplayString());
2985Assert.Equal("A", symbol.ToDisplayString());
3011Assert.Equal("int", symbol.ToDisplayString());
3024Assert.Equal("A.B", symbol.ToDisplayString());
3029Assert.Equal("A.B", symbol.ToDisplayString());
3034Assert.Equal("A", symbol.ToDisplayString());
3040Assert.Equal("A.B", symbol.ToDisplayString());
3052Assert.Equal("A.M()", symbol.ToDisplayString());
3057Assert.Equal("A.M()", symbol.ToDisplayString());
3062Assert.Equal("A", symbol.ToDisplayString());
3068Assert.Equal("A.M()", symbol.ToDisplayString());
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (19)
3277Assert.Equal("C.N(int)", initInfo.Symbol.ToDisplayString());
3290Assert.Equal("C.N()", argInfo.Symbol.ToDisplayString());
3928Assert.Equal("System", alias1.Target.ToDisplayString());
3932Assert.Equal("System.IO", alias2.Target.ToDisplayString());
4695Assert.Equal("A<object>.B<?>", type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4710Assert.Equal("A<?, ?, ?>.B<object>", type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4725Assert.Equal("A<?>.B<?>", type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4800Assert.Equal("(int, int)", type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4823Assert.Equal("(int Alice, int Bob)", type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4846Assert.Equal("(short, int)", type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4869Assert.Equal("(short, string)", type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4892Assert.Equal("(short Alice, string Bob)", type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4915Assert.Equal("(int Alice, int Bob).Bob", element.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4938Assert.Equal("(int Alice, short Bob).Bob", element.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4961Assert.Equal("(short Alice, string Bob).Bob", element.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
4996Assert.Equal("(short Alice, string Bob).Bob", element.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
5042Assert.Equal("(short Alice, string Bob).Bob", element.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
5091Assert.Equal("(short Alice, string Bob).Bob", element.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
5114Assert.Equal("(short, string Bob).Bob", element.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
Compilation\SemanticModelGetSemanticInfoTests.cs (31)
9674Assert.Equal("ValidWithSuffix_And_ValidWithoutSuffix.Description.Description(string)", semanticInfo.Symbol.ToDisplayString());
9679Assert.Equal("ValidWithSuffix_And_ValidWithoutSuffix.Description.Description(string)", semanticInfo.MethodGroup[0].ToDisplayString());
9725Assert.Equal("ValidWithSuffix_And_ValidWithoutSuffix.DescriptionAttribute.DescriptionAttribute(string)", semanticInfo.Symbol.ToDisplayString());
9730Assert.Equal("ValidWithSuffix_And_ValidWithoutSuffix.DescriptionAttribute.DescriptionAttribute(string)", semanticInfo.MethodGroup[0].ToDisplayString());
15083Assert.Equal("int", semanticInfo.Type.ToDisplayString());
15085Assert.Equal("int", semanticInfo.ConvertedType.ToDisplayString());
15089Assert.Equal("string.Length", semanticInfo.Symbol.ToDisplayString());
15121var sortedCandidates = semanticInfo.CandidateSymbols.AsEnumerable().OrderBy(s => s.ToDisplayString(), StringComparer.Ordinal).ToArray();
15122Assert.Equal("string.ToString()", sortedCandidates[0].ToDisplayString());
15124Assert.Equal("string.ToString(System.IFormatProvider)", sortedCandidates[1].ToDisplayString());
15128var sortedMethodGroup = semanticInfo.MethodGroup.AsEnumerable().OrderBy(s => s.ToDisplayString(), StringComparer.Ordinal).ToArray();
15129Assert.Equal("string.ToString()", sortedMethodGroup[0].ToDisplayString());
15130Assert.Equal("string.ToString(System.IFormatProvider)", sortedMethodGroup[1].ToDisplayString());
15151Assert.Equal("string", semanticInfo.Type.ToDisplayString());
15153Assert.Equal("string", semanticInfo.ConvertedType.ToDisplayString());
15157Assert.Equal("string.ToString()", semanticInfo.Symbol.ToDisplayString());
15182Assert.Equal("int", semanticInfo.Type.ToDisplayString());
15184Assert.Equal("int", semanticInfo.ConvertedType.ToDisplayString());
15188Assert.Equal("string.Length", semanticInfo.Symbol.ToDisplayString());
15213Assert.Equal("int", semanticInfo.Type.ToDisplayString());
15215Assert.Equal("?", semanticInfo.ConvertedType.ToDisplayString());
15219Assert.Equal("string.Length", semanticInfo.Symbol.ToDisplayString());
15244Assert.Equal("int", semanticInfo.Type.ToDisplayString());
15246Assert.Equal("int", semanticInfo.ConvertedType.ToDisplayString());
15250Assert.Equal("string.Length", semanticInfo.Symbol.ToDisplayString());
15275Assert.Equal("char", semanticInfo.Type.ToDisplayString());
15277Assert.Equal("char", semanticInfo.ConvertedType.ToDisplayString());
15281Assert.Equal("string.this[int]", semanticInfo.Symbol.ToDisplayString());
15308Assert.Equal("BaselineLog", semanticInfo.Symbol.ToDisplayString());
15337Assert.Equal("dynamic", semanticInfo.Type.ToDisplayString());
15339Assert.Equal("dynamic", semanticInfo.ConvertedType.ToDisplayString());
Symbols\AnonymousTypesSemanticsTests.cs (8)
592Assert.Equal("object.Equals(object)", method.ToDisplayString());
660Assert.Equal("object.ToString()", method.ToDisplayString());
681Assert.Equal("object.GetHashCode()", method.ToDisplayString());
702Assert.Equal("<anonymous type: int f1, string f2>..ctor(int, string)", method.ToDisplayString());
780Assert.Equal("x", info1.Symbol.ToDisplayString());
849Assert.Equal("x", info1.Symbol.ToDisplayString());
854Assert.Equal("y", info2.Symbol.ToDisplayString());
1540Assert.Equal("<anonymous type: int a>.a", info.Symbol.ToDisplayString());
Symbols\RelaxedShiftOperatorTests.cs (6)
105Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString());
149Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString());
193Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString());
237Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString());
281Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString());
325Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString());
Symbols\Source\UsingAliasTests.cs (39)
53Assert.Equal("O", alias1.ToDisplayString());
54Assert.Equal("O=System.Object", alias1.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
60Assert.Equal("System.Object", b2.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
61Assert.Equal("System.Object", info2.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
66Assert.Equal("System.Object", b3.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
67Assert.Equal("System.Object", info3.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
113Assert.Equal("O", alias1.ToDisplayString());
114Assert.Equal("O=System.Object", alias1.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
120Assert.Equal("System.Object", b2.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
121Assert.Equal("System.Object", info2.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
126Assert.Equal("System.Object", b3.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
127Assert.Equal("System.Object", info3.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
166Assert.Equal("System.Object", info1.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
170Assert.Equal("O=System.Object", alias1.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
175Assert.Equal("System.Object", b2.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
176Assert.Equal("System.Object", info2.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
181Assert.Equal("System.Object", b3.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
182Assert.Equal("System.Object", info3.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
224Assert.Equal("System.Object", info1.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
228Assert.Equal("O=System.Object", alias1.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
233Assert.Equal("System.Object", b2.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
234Assert.Equal("System.Object", info2.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
239Assert.Equal("System.Object", b3.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
240Assert.Equal("System.Object", info3.Type.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
276AssertEx.Equal(expected, usingAliasType.ToDisplayString(SymbolDisplayFormat.TestFormat));
315Assert.Equal("System.Object", info2.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
316Assert.Equal("System.Object", info2.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
321Assert.Equal("System.Object", info3.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
322Assert.Equal("System.Object", info3.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
361Assert.Equal("System.Object", info2.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
362Assert.Equal("System.Object", info2.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
367Assert.Equal("System.Object", info3.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
368Assert.Equal("System.Object", info3.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
390Assert.Equal("O", alias.ToDisplayString());
391Assert.Equal("O=System.Object", alias.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
411Assert.Equal("O", alias.ToDisplayString());
412Assert.Equal("O=System.Object", alias.ToDisplayString(format: SymbolDisplayFormat.TestFormat));
489Assert.Equal("O=System.Object", symbols[0].ToDisplayString(format: SymbolDisplayFormat.TestFormat));
510Assert.Equal("O=System.Object", symbols[0].ToDisplayString(format: SymbolDisplayFormat.TestFormat));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (6)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Microsoft.CodeAnalysis.EditorFeatures (3)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (2)
Microsoft.CodeAnalysis.Features (33)
Microsoft.CodeAnalysis.Test.Utilities (4)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.VisualBasic.Features (7)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (65)
FlowAnalysis\TryLockUsingStatementTests.vb (46)
1743Assert.Equal("x", dataFlowAnalysisResults.DataFlowsIn(0).ToDisplayString)
1744Assert.Equal("lock", dataFlowAnalysisResults.DataFlowsIn(1).ToDisplayString)
1749Assert.Equal("x", dataFlowAnalysisResults.ReadInside(0).ToDisplayString)
1750Assert.Equal("lock", dataFlowAnalysisResults.ReadInside(1).ToDisplayString)
1757Assert.Equal("x", dataFlowAnalysisResults.WrittenOutside(0).ToDisplayString)
1758Assert.Equal("lock", dataFlowAnalysisResults.WrittenOutside(1).ToDisplayString)
1792Assert.Equal("x", dataFlowAnalysisResults.DataFlowsIn(0).ToDisplayString)
1797Assert.Equal("x", dataFlowAnalysisResults.ReadInside(0).ToDisplayString)
1800Assert.Equal("lock", dataFlowAnalysisResults.ReadOutside(0).ToDisplayString)
1806Assert.Equal("x", dataFlowAnalysisResults.WrittenOutside(0).ToDisplayString)
1807Assert.Equal("lock", dataFlowAnalysisResults.WrittenOutside(1).ToDisplayString)
1843Assert.Equal("x", dataFlowAnalysisResults.DataFlowsIn(0).ToDisplayString)
1844Assert.Equal("lock", dataFlowAnalysisResults.DataFlowsIn(1).ToDisplayString)
1849Assert.Equal("x", dataFlowAnalysisResults.ReadInside(0).ToDisplayString)
1850Assert.Equal("lock", dataFlowAnalysisResults.ReadInside(1).ToDisplayString)
1857Assert.Equal("x", dataFlowAnalysisResults.WrittenOutside(0).ToDisplayString)
1858Assert.Equal("lock", dataFlowAnalysisResults.WrittenOutside(1).ToDisplayString)
2204Assert.Equal("goo1", dataFlowAnalysisResults.AlwaysAssigned(0).ToDisplayString)
2205Assert.Equal("goo2", dataFlowAnalysisResults.AlwaysAssigned(1).ToDisplayString)
2210Assert.Equal("x", dataFlowAnalysisResults.DataFlowsIn(0).ToDisplayString)
2215Assert.Equal("x", dataFlowAnalysisResults.ReadInside(0).ToDisplayString)
2216Assert.Equal("goo1", dataFlowAnalysisResults.ReadInside(1).ToDisplayString)
2217Assert.Equal("goo2", dataFlowAnalysisResults.ReadInside(2).ToDisplayString)
2222Assert.Equal("goo1", dataFlowAnalysisResults.VariablesDeclared(0).ToDisplayString)
2223Assert.Equal("goo2", dataFlowAnalysisResults.VariablesDeclared(1).ToDisplayString)
2226Assert.Equal("goo1", dataFlowAnalysisResults.WrittenInside(0).ToDisplayString)
2227Assert.Equal("goo2", dataFlowAnalysisResults.WrittenInside(1).ToDisplayString)
2230Assert.Equal("x", dataFlowAnalysisResults.WrittenOutside(0).ToDisplayString)
2274Assert.Equal("x", dataFlowAnalysisResults.DataFlowsIn(0).ToDisplayString)
2279Assert.Equal("x", dataFlowAnalysisResults.ReadInside(0).ToDisplayString)
2288Assert.Equal("x", dataFlowAnalysisResults.WrittenOutside(0).ToDisplayString)
2332Assert.Equal("x", dataFlowAnalysisResults.DataFlowsIn(0).ToDisplayString)
2337Assert.Equal("x", dataFlowAnalysisResults.ReadInside(0).ToDisplayString)
2340Assert.Equal("x", dataFlowAnalysisResults.WrittenOutside(0).ToDisplayString)
2341Assert.Equal("goo1", dataFlowAnalysisResults.WrittenOutside(1).ToDisplayString)
2348Assert.Equal("x", dataFlowAnalysisResults.WrittenOutside(0).ToDisplayString)
2349Assert.Equal("goo1", dataFlowAnalysisResults.WrittenOutside(1).ToDisplayString)
2390Assert.Equal("x", dataFlowAnalysisResults.DataFlowsIn(0).ToDisplayString)
2395Assert.Equal("x", dataFlowAnalysisResults.ReadInside(0).ToDisplayString)
2396Assert.Equal("goo1", dataFlowAnalysisResults.ReadInside(1).ToDisplayString)
2397Assert.Equal("goo2", dataFlowAnalysisResults.ReadInside(2).ToDisplayString)
2402Assert.Equal("goo1", dataFlowAnalysisResults.VariablesDeclared(0).ToDisplayString)
2403Assert.Equal("goo2", dataFlowAnalysisResults.VariablesDeclared(1).ToDisplayString)
2406Assert.Equal("goo1", dataFlowAnalysisResults.WrittenInside(0).ToDisplayString)
2407Assert.Equal("goo2", dataFlowAnalysisResults.WrittenInside(1).ToDisplayString)
2410Assert.Equal("x", dataFlowAnalysisResults.WrittenOutside(0).ToDisplayString)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (20)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (18)
983Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString())
1006Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString())
1009Assert.Equal("Public Property bb As Integer", info.Symbol.ToDisplayString())
1012Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString())
1037Assert.Equal("Public Property a As Integer", info.Symbol.ToDisplayString())
1040Assert.Equal("args As String()", info.Symbol.ToDisplayString())
1043Assert.Equal("Public Property b As String", info.Symbol.ToDisplayString())
1046Assert.Equal("Public Property args As String()", info.Symbol.ToDisplayString())
1049Assert.Equal("Public Property a As Integer", info.Symbol.ToDisplayString())
1073Assert.Equal("Public Sub New()", info.Symbol.ToDisplayString())
1076Assert.Equal("Program", info.Symbol.ToDisplayString())
1100Assert.Equal("Public Sub New()", info.Symbol.ToDisplayString())
1103Assert.Equal("Program", info.Symbol.ToDisplayString())
1134Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString())
1163Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString())
1187Assert.Equal("Public ReadOnly Property aa As String", info.Symbol.ToDisplayString())
1216Assert.Equal("Public ReadOnly Property aa As String", info.Symbol.ToDisplayString())
1272Assert.Equal("Public Sub New(aa As Integer, bb As Integer)", info.Symbol.ToDisplayString())
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
Microsoft.CodeAnalysis.Workspaces (8)
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
Microsoft.DotNet.CodeAnalysis (1)
Microsoft.Extensions.Logging.Generators (1)
Microsoft.Extensions.Options.SourceGeneration (12)
Microsoft.Gen.ComplianceReports (3)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.Logging (13)
Parsing\Parser.LogProperties.cs (7)
166classification.UnionWith(GetDataClassificationAttributes(current, symbols).Select(x => x.ToDisplayString()));
170classification.UnionWith(GetDataClassificationAttributes(property, symbols).Select(x => x.ToDisplayString()));
175classification.UnionWith(dataClassesFromCtor.Select(x => x.ToDisplayString()));
199Type = property.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat),
264Diag(DiagDescriptors.LogPropertiesCycleDetected, paramSymbol.GetLocation(), paramName, namedType.ToDisplayString(), property.Type.ToDisplayString(), lm.Name);
351Diag(DiagDescriptors.InvalidTypeToLogProperties, sym.GetLocation(), symType.ToDisplayString());
Microsoft.Gen.Logging.Unit.Tests (1)
Microsoft.Gen.Metrics (8)
Microsoft.Gen.MetricsReports (8)
Microsoft.Interop.ComInterfaceGenerator (37)
ComInterfaceInfo.cs (16)
78symbol.ToDisplayString(),
100symbol.ToDisplayString(),
101baseSymbol?.ToDisplayString(),
127symbol.ToDisplayString(),
128baseSymbol.ToDisplayString()));
159thisSymbol.ToDisplayString(),
160baseSymbol?.ToDisplayString(),
209interfaceSymbol.ToDisplayString(),
228interfaceSymbol.ToDisplayString(),
243interfaceSymbol.ToDisplayString(),
265interfaceSymbol.ToDisplayString(),
279interfaceSymbol.ToDisplayString(),
299if (attr.AttributeClass?.ToDisplayString() == TypeNames.GeneratedComInterfaceAttribute)
312comIface.ToDisplayString());
333var attrDisplayString = attr.AttributeClass?.ToDisplayString();
354interfaceSymbol.ToDisplayString());
ComMethodInfo.cs (5)
53methods.Add(DiagnosticOr<(ComMethodInfo, IMethodSymbol)>.From(member.CreateDiagnosticInfo(GeneratorDiagnostics.InstancePropertyDeclaredInInterface, member.Name, data.ifaceSymbol.ToDisplayString())));
56methods.Add(DiagnosticOr<(ComMethodInfo, IMethodSymbol)>.From(member.CreateDiagnosticInfo(GeneratorDiagnostics.InstanceEventDeclaredInInterface, member.Name, data.ifaceSymbol.ToDisplayString())));
80return DiagnosticInfo.Create(GeneratorDiagnostics.ReturnConfigurationNotSupported, comMethodDeclaringSyntax.Identifier.GetLocation(), "ref return", method.ToDisplayString());
119return DiagnosticOr<(ComMethodInfo, IMethodSymbol)>.From(DiagnosticInfo.Create(GeneratorDiagnostics.MethodNotDeclaredInAttributedInterface, method.Locations.FirstOrDefault(), method.ToDisplayString()));
135return DiagnosticOr<(ComMethodInfo, IMethodSymbol)>.From(DiagnosticInfo.Create(GeneratorDiagnostics.CannotAnalyzeMethodPattern, method.Locations.FirstOrDefault(), method.ToDisplayString()));
Microsoft.Interop.JavaScript.JSImportGenerator (12)
Microsoft.Interop.LibraryImportGenerator (74)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (53)
653managedTypeReporter.CreateAndReportDiagnostic(ManagedTypeMustBeNonNullRule, entryType.ToDisplayString());
674marshallerTypeReporter.CreateAndReportDiagnostic(MarshallerTypeMustBeNonNullRule, entryType.ToDisplayString());
720diagnosticReporter.CreateAndReportDiagnostic(MarshallerTypeMustBeStaticClassOrStructRule, marshallerType.ToDisplayString());
777marshallerType.ToDisplayString(),
779managedType.ToDisplayString());
797marshallerType.ToDisplayString(),
799managedType.ToDisplayString());
809marshallerType.ToDisplayString(),
811managedType.ToDisplayString());
835marshallerType.ToDisplayString(),
837managedType.ToDisplayString());
855marshallerType.ToDisplayString(),
857managedType.ToDisplayString());
868marshallerType.ToDisplayString(),
870managedType.ToDisplayString());
889diagnosticReporter.CreateAndReportDiagnostic(UnmanagedTypeMustBeUnmanagedRule, toUnmanagedMethod.ToDisplayString());
896diagnosticReporter.CreateAndReportDiagnostic(FirstParameterMustMatchReturnTypeRule, methods.UnmanagedValuesDestination.ToDisplayString(), toUnmanagedMethod.ToDisplayString());
905diagnosticReporter.CreateAndReportDiagnostic(ReturnTypesMustMatchRule, methods.ToUnmanaged.ToDisplayString(), methods.ToUnmanagedWithBuffer.ToDisplayString());
918diagnosticReporter.CreateAndReportDiagnostic(FirstParameterMustMatchReturnTypeRule, toManagedMethod.ToDisplayString(), (methods.ToUnmanaged ?? methods.ToUnmanagedWithBuffer).ToDisplayString());
927diagnosticReporter.CreateAndReportDiagnostic(FirstParametersMustMatchRule, methods.UnmanagedValuesSource.ToDisplayString(), toManagedMethod.ToDisplayString());
936diagnosticReporter.CreateAndReportDiagnostic(FirstParametersMustMatchRule, methods.ToManaged.ToDisplayString(), methods.ToManagedFinally.ToDisplayString());
951diagnosticReporter.CreateAndReportDiagnostic(ElementTypesOfReturnTypesMustMatchRule, methods.ManagedValuesSource.ToDisplayString(), methods.ManagedValuesDestination.ToDisplayString());
969diagnosticReporter.CreateAndReportDiagnostic(ReturnTypeMustBeExpectedTypeRule, unmanagedValuesCollectionMethod.ToDisplayString(), expectedSpanType.Construct(expectedElementType).ToDisplayString());
991marshallerType.ToDisplayString(),
992allocatedBufferType.TypeArguments[0].ToDisplayString());
1015diagnosticReporter.CreateAndReportDiagnostic(ElementMarshallerCannotBeStatefulRule, marshallerType.ToDisplayString(), mode);
1068marshallerType.ToDisplayString(),
1070managedType.ToDisplayString());
1079marshallerType.ToDisplayString(),
1081managedType.ToDisplayString());
1105marshallerType.ToDisplayString(),
1107managedType.ToDisplayString());
1129marshallerType.ToDisplayString(),
1131managedType.ToDisplayString());
1141marshallerType.ToDisplayString(),
1143managedType.ToDisplayString());
1150marshallerType.ToDisplayString());
1174marshallerType.ToDisplayString(),
1176managedType.ToDisplayString());
1189marshallerType.ToDisplayString());
1205diagnosticReporter.CreateAndReportDiagnostic(UnmanagedTypeMustBeUnmanagedRule, methods.ToUnmanaged.ToDisplayString());
1216diagnosticReporter.CreateAndReportDiagnostic(FirstParameterMustMatchReturnTypeRule, fromUnmanagedMethod.ToDisplayString(), methods.ToUnmanaged.ToDisplayString());
1224diagnosticReporter.CreateAndReportDiagnostic(UnmanagedTypeMustBeUnmanagedRule, fromUnmanagedMethod.ToDisplayString());
1239diagnosticReporter.CreateAndReportDiagnostic(ElementTypesOfReturnTypesMustMatchRule, methods.ManagedValuesSource.ToDisplayString(), methods.ManagedValuesDestination.ToDisplayString());
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
Microsoft.Interop.SourceGeneration (35)
CustomMarshallingInfoHelper.cs (12)
32diagnostics.ReportInvalidMarshallingAttributeInfo(attrData, nameof(SR.MarshallerTypeMustBeStaticClassOrStruct), entryPointType.ToDisplayString(), type.ToDisplayString());
50diagnostics.ReportInvalidMarshallingAttributeInfo(attrData, nameof(SR.MarshallerEntryPointTypeMustMatchArity), entryPointType.ToDisplayString(), type.ToDisplayString());
64(type, entryPointType) => diagnostics.ReportInvalidMarshallingAttributeInfo(attrData, nameof(SR.MarshallerEntryPointTypeMustMatchArity), entryPointType.ToDisplayString(), type.ToDisplayString()),
74diagnostics.ReportInvalidMarshallingAttributeInfo(attrData, nameof(SR.MarshallerEntryPointTypeMustMatchArity), entryPointType.ToDisplayString(), type.ToDisplayString());
96(type, entryPointType) => diagnostics.ReportInvalidMarshallingAttributeInfo(attrData, nameof(SR.MarshallerEntryPointTypeMustMatchArity), entryPointType.ToDisplayString(), type.ToDisplayString()),
148diagnostics.ReportInvalidMarshallingAttributeInfo(attrData, nameof(SR.MarshallerTypeMustBeStaticClassOrStruct), entryPointType.ToDisplayString(), type.ToDisplayString());
Microsoft.VisualStudio.LanguageServices (41)
Microsoft.VisualStudio.LanguageServices.CSharp (15)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.VisualBasic (32)
System.Private.CoreLib.Generators (4)
System.Text.Json.SourceGeneration (15)
JsonSourceGenerator.Parser.cs (12)
100ReportDiagnostic(DiagnosticDescriptors.JsonSerializableAttributeOnNonContextType, _contextClassLocation, contextTypeSymbol.ToDisplayString());
157Namespace = contextTypeSymbol.ContainingNamespace is { IsGlobalNamespace: false } ns ? ns.ToDisplayString() : null,
197string typeName = typeSymbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
617ReportDiagnostic(DiagnosticDescriptors.MultipleJsonConstructorAttribute, typeToGenerate.Location, type.ToDisplayString());
621ReportDiagnostic(DiagnosticDescriptors.JsonConstructorInaccessible, typeToGenerate.Location, type.ToDisplayString());
640ReportDiagnostic(DiagnosticDescriptors.TypeNotSupported, typeToGenerate.AttributeLocation ?? typeToGenerate.Location, type.ToDisplayString());
1269switch (attributeType.ToDisplayString())
1280namedArgs[0].Value.Type?.ToDisplayString() == JsonIgnoreConditionFullName)
1568ReportDiagnostic(DiagnosticDescriptors.DerivedJsonConverterAttributesNotSupported, attributeData.GetLocation(), attributeData.AttributeClass!.ToDisplayString());
1583ReportDiagnostic(DiagnosticDescriptors.JsonConverterAttributeInvalidType, attributeData.GetLocation(), converterType?.ToDisplayString() ?? "null", declaringSymbol.ToDisplayString());
1589ReportDiagnostic(DiagnosticDescriptors.JsonStringEnumConverterNotSupportedInAot, attributeData.GetLocation(), declaringSymbol.ToDisplayString());
System.Text.RegularExpressions.Generator (1)