本文整理汇总了C#中INamedTypeSymbol.ToMinimalDisplayString方法的典型用法代码示例。如果您正苦于以下问题:C# INamedTypeSymbol.ToMinimalDisplayString方法的具体用法?C# INamedTypeSymbol.ToMinimalDisplayString怎么用?C# INamedTypeSymbol.ToMinimalDisplayString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INamedTypeSymbol
的用法示例。
在下文中一共展示了INamedTypeSymbol.ToMinimalDisplayString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: override
protected override (string displayText, string insertionText) GetDisplayAndInsertionText(
INamedTypeSymbol symbol, SyntaxContext context)
{
var displayAndInsertionText = symbol.ToMinimalDisplayString(context.SemanticModel, context.Position, _symbolFormatWithGenerics);
return (displayAndInsertionText, displayAndInsertionText);
}
示例2: GetDisplayAndInsertionText
protected override ValueTuple<string, string> GetDisplayAndInsertionText(INamedTypeSymbol symbol, AbstractSyntaxContext context)
{
var displayAndInsertionText = symbol.ToMinimalDisplayString(context.SemanticModel, context.Position, _symbolFormatWithGenerics);
return ValueTuple.Create(displayAndInsertionText, displayAndInsertionText);
}
示例3: BuildMapperDescription
protected virtual string BuildMapperDescription(MethodDeclarationSyntax methodDeclaration, SemanticModel model, INamedTypeSymbol source, INamedTypeSymbol target)
{
return $"Map {source.ToMinimalDisplayString(model, methodDeclaration.SpanStart)} to {target.ToMinimalDisplayString(model, methodDeclaration.SpanStart)}";
}
示例4: ReportIssue
private static void ReportIssue(INamedTypeSymbol interfaceType, INamedTypeSymbol expressionType, Location issueLocation,
SyntaxNodeAnalysisContext context)
{
var interfaceTypeName = interfaceType.ToMinimalDisplayString(context.SemanticModel, issueLocation.SourceSpan.Start);
var expressionTypeName = expressionType.ToMinimalDisplayString(context.SemanticModel, issueLocation.SourceSpan.Start);
var messageReasoning = expressionType.IsInterface()
? $"implements both \"{expressionTypeName}\" and \"{interfaceTypeName}\""
: $"extends \"{expressionTypeName}\" and implements \"{interfaceTypeName}\"";
context.ReportDiagnostic(Diagnostic.Create(Rule, issueLocation, string.Format(MessageReviewFormat, messageReasoning)));
}