private void AddExceptions(ISymbol symbol)
            {
                var exceptionTypes = symbol.GetDocumentationComment().ExceptionTypes;

                if (exceptionTypes.Any())
                {
                    var parts = new List <SymbolDisplayPart>();
                    parts.Add(new SymbolDisplayPart(kind: SymbolDisplayPartKind.Text, symbol: null, text: $"\r\n{WorkspacesResources.Exceptions}"));
                    foreach (var exceptionString in exceptionTypes)
                    {
                        parts.AddRange(LineBreak());
                        parts.AddRange(Space(count: 2));
                        parts.AddRange(AbstractDocumentationCommentFormattingService.CrefToSymbolDisplayParts(exceptionString, _position, _semanticModel));
                    }

                    AddToGroup(SymbolDescriptionGroups.Exceptions, parts);
                }
            }
コード例 #2
0
            private void AddExceptions(ISymbol symbol)
            {
                var exceptionTypes = symbol.GetDocumentationComment(GetCompilation(), expandIncludes: true, expandInheritdoc: true).ExceptionTypes;

                if (exceptionTypes.Any())
                {
                    var parts = new List <SymbolDisplayPart>();
                    parts.AddLineBreak();
                    parts.AddText(WorkspacesResources.Exceptions_colon);
                    foreach (var exceptionString in exceptionTypes)
                    {
                        parts.AddRange(LineBreak());
                        parts.AddRange(Space(count: 2));
                        parts.AddRange(AbstractDocumentationCommentFormattingService.CrefToSymbolDisplayParts(exceptionString, _position, _semanticModel));
                    }

                    AddToGroup(SymbolDescriptionGroups.Exceptions, parts);
                }
            }