Skip to main content
Extension methods for retrieving and processing XML documentation comments from Roslyn symbols.

Features

  • Retrieve XML documentation from symbols
  • Automatic inheritdoc expansion
  • Support for cref and path attributes
  • Type parameter reference rewriting
  • Circular reference prevention

Basic Usage

Inheritdoc Expansion

The library automatically resolves inheritdoc elements:

Supported Scenarios

Automatic Synthesis

For symbols without documentation that are eligible for inheritance:

GetDocumentationComment

Full signature with all options:

GetSummaryText / GetRemarksText

Convenience methods that extract and normalize specific documentation sections:
  • Returns null if no documentation or section not found
  • Whitespace is normalized (multiple spaces collapsed to single space)
  • XML tags are stripped, leaving plain text

Examples

Generate API Documentation

Copy Documentation to Generated Code

Check for Missing Documentation

Type Parameter Rewriting

When inheriting documentation from generic types, type parameter references are automatically rewritten:

Performance Considerations

  • Use expandInheritdoc: false when you don’t need inheritance resolution
  • Cache GetDocumentationComment results when processing many symbols
  • The method handles circular inheritdoc references without infinite loops