private void AddDescriptionForMethod(IMethodSymbol method) { // TODO : show duplicated member case // TODO : a way to check whether it is a member call off dynamic type? var awaitable = method.IsAwaitable(_semanticModel, _position); var extension = method.IsExtensionMethod || method.MethodKind == MethodKind.ReducedExtension; if (awaitable && extension) { AddAwaitableExtensionPrefix(); } else if (awaitable) { AddAwaitablePrefix(); } else if (extension) { AddExtensionPrefix(); } AddToGroup(SymbolDescriptionGroups.MainDescription, ToMinimalDisplayParts(method, s_memberSignatureDisplayFormat)); if (awaitable) { AddAwaitableUsageText(method, _semanticModel, _position); } }
protected IList <SymbolDisplayPart> GetAwaitableUsage(IMethodSymbol method, SemanticModel semanticModel, int position) { if (method.IsAwaitable(semanticModel, position)) { return(method.ToAwaitableParts(SyntaxFacts.GetText(SyntaxKind.AwaitKeyword), "x", semanticModel, position)); } return(SpecializedCollections.EmptyList <SymbolDisplayPart>()); }
protected IList<SymbolDisplayPart> GetAwaitableUsage(IMethodSymbol method, SemanticModel semanticModel, int position) { if (method.IsAwaitable(semanticModel, position)) { return method.ToAwaitableParts(SyntaxFacts.GetText(SyntaxKind.AwaitKeyword), "x", semanticModel, position); } return SpecializedCollections.EmptyList<SymbolDisplayPart>(); }