public static string ToDisplayString( ITypeSymbol symbol, CodeAnalysis.NullableAnnotation nullableAnnotation, SymbolDisplayFormat?format = null) { return(ToDisplayParts(symbol, nullableAnnotation, format).ToDisplayString()); }
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters /// <summary> /// Displays a symbol in the C# style, based on a <see cref="SymbolDisplayFormat"/>. /// Based on the context, qualify type and member names as little as possible without /// introducing ambiguities. /// </summary> /// <param name="symbol">The symbol to be displayed.</param> /// <param name="semanticModel">Semantic information about the context in which the symbol is being displayed.</param> /// <param name="position">A position within the <see cref="SyntaxTree"/> or <paramref name="semanticModel"/>.</param> /// <param name="format">The formatting options to apply. If null is passed, <see cref="SymbolDisplayFormat.CSharpErrorMessageFormat"/> will be used.</param> /// <returns>A formatted string that can be displayed to the user.</returns> /// <remarks> /// The return value is not expected to be syntactically valid C#. /// </remarks> public static string ToMinimalDisplayString( ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat?format = null) { return(ToMinimalDisplayParts(symbol, semanticModel, position, format).ToDisplayString()); }
public static string ToMinimalDisplayString( ITypeSymbol symbol, CodeAnalysis.NullableAnnotation nullableAnnotation, SemanticModel semanticModel, int position, SymbolDisplayFormat?format = null) { return(ToMinimalDisplayParts(symbol, nullableAnnotation, semanticModel, position, format).ToDisplayString()); }
public static string ToFullDisplayString( this ISymbol symbol, SymbolDisplayFormat?format = null ) { var ds = symbol.ToDisplayString(format); return(ds); }
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters /// <summary> /// Convert a symbol to an array of string parts, each of which has a kind. Useful for /// colorizing the display string. /// </summary> /// <param name="symbol">The symbol to be displayed.</param> /// <param name="semanticModel">Semantic information about the context in which the symbol is being displayed.</param> /// <param name="position">A position within the <see cref="SyntaxTree"/> or <paramref name="semanticModel"/>.</param> /// <param name="format">The formatting options to apply. If null is passed, <see cref="SymbolDisplayFormat.CSharpErrorMessageFormat"/> will be used.</param> /// <returns>A list of display parts.</returns> /// <remarks> /// Parts are not localized until they are converted to strings. /// </remarks> public static ImmutableArray <SymbolDisplayPart> ToMinimalDisplayParts( ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat?format = null) { format ??= SymbolDisplayFormat.MinimallyQualifiedFormat; return(ToDisplayParts(symbol, semanticModel, position, format, minimal: true)); }
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters /// <summary> /// Convert a symbol to an array of string parts, each of which has a kind. Useful for /// colorizing the display string. /// </summary> /// <param name="symbol">The symbol to be displayed.</param> /// <param name="format">The formatting options to apply. If null is passed, <see cref="SymbolDisplayFormat.CSharpErrorMessageFormat"/> will be used.</param> /// <returns>A list of display parts.</returns> /// <remarks> /// Parts are not localized until they are converted to strings. /// </remarks> public static ImmutableArray <SymbolDisplayPart> ToDisplayParts( ISymbol symbol, SymbolDisplayFormat?format = null) { // null indicates the default format format = format ?? SymbolDisplayFormat.CSharpErrorMessageFormat; return(ToDisplayParts( symbol, semanticModelOpt: null, positionOpt: -1, format: format, minimal: false)); }
public static string ToGlobalDisplayString( this ISymbol symbol, SymbolDisplayFormat?format = null ) { var ds = symbol.ToDisplayString(format ?? SymbolDisplayFormat.FullyQualifiedFormat); return(ds); }
public static ImmutableArray <SymbolDisplayPart> ToMinimalDisplayParts( ITypeSymbol symbol, CodeAnalysis.NullableAnnotation nullableAnnotation, SemanticModel semanticModel, int position, SymbolDisplayFormat?format = null) { format ??= SymbolDisplayFormat.MinimallyQualifiedFormat; return(ToDisplayParts(symbol.WithNullableAnnotation(nullableAnnotation), semanticModel, position, format, minimal: true)); }
public static ImmutableArray <SymbolDisplayPart> ToDisplayParts( ITypeSymbol symbol, CodeAnalysis.NullableAnnotation nullableAnnotation, SymbolDisplayFormat?format = null) { // null indicates the default format format ??= SymbolDisplayFormat.CSharpErrorMessageFormat; return(ToDisplayParts( symbol.WithNullableAnnotation(nullableAnnotation), semanticModelOpt: null, positionOpt: -1, format: format, minimal: false)); }
/// <summary> /// Displays a symbol in the C# style, based on a <see cref="SymbolDisplayFormat"/>. /// </summary> /// <param name="symbol">The symbol to be displayed.</param> /// <param name="format">The formatting options to apply. If null is passed, <see cref="SymbolDisplayFormat.CSharpErrorMessageFormat"/> will be used.</param> /// <returns>A formatted string that can be displayed to the user.</returns> /// <remarks> /// The return value is not expected to be syntactically valid C#. /// </remarks> public static string ToDisplayString( ISymbol symbol, SymbolDisplayFormat?format = null) { return(ToDisplayParts(symbol, format).ToDisplayString()); }
ImmutableArray <SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat?format) { return(SymbolDisplay.ToMinimalDisplayParts(this, Symbol.GetCSharpSemanticModel(semanticModel), position, format)); }
string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat?format) { return(SymbolDisplay.ToMinimalDisplayString(this, Symbol.GetCSharpSemanticModel(semanticModel), position, format)); }
ImmutableArray <SymbolDisplayPart> ISymbol.ToDisplayParts(SymbolDisplayFormat?format) { return(SymbolDisplay.ToDisplayParts(this, format)); }
string ISymbol.ToDisplayString(SymbolDisplayFormat?format) { return(SymbolDisplay.ToDisplayString(this, format)); }