Write the code.SSDoc writes the docs. コードは、あなたが。ドキュメントは、SSDoc が。

SSDoc is a Visual Studio extension that writes XML documentation comments for C#. One command fills in the summary, parameters and return value in plain English, the way StyleCop expects, typically in about a millisecond. Anything you already wrote stays as you wrote it.SSDoc は、C# の XML ドキュメントコメントを書く Visual Studio 拡張機能です。コマンドひとつで、概要・引数・戻り値を自然な英語で、StyleCop の作法どおりに書き込みます。かかる時間は、多くの場合約1ミリ秒です。あなたがすでに書いた文は、そのまま残ります。

  • Free for personal and commercial use (not open source)個人・商用とも無料(オープンソースではありません)
  • Visual Studio 2022 (17.14 or later) and Visual Studio 2026Visual Studio 2022(17.14 以降)と Visual Studio 2026
  • Community, Professional and Enterprise on x64 and Arm64Community・Professional・Enterprise、x64 と Arm64
C#OrderRepository.cs
Interactive demo操作できるデモ
1namespace Contoso.Orders;
2
3/// <summary>
4/// Provides data access for orders.
5/// </summary>
6/// <typeparam name="TOrder">The type of the order.</typeparam>
7public sealed class OrderRepository<TOrder> : IDisposable
8 where TOrder : class
9{
10 private readonly DbContext _context;
11 private readonly Dictionary<int, TOrder> _cache = new();
12
13 public OrderRepository(DbContext context) => _context = context;
14
15 public int RetryCount { get; private set; }
16
17 public bool IsReadOnly { get; set; }
18
19 public event EventHandler<OrderEventArgs> OrderAdded;
20
21 public async Task<TOrder> GetByIdAsync(int id, CancellationToken cancellationToken)
22 => await _context.Set<TOrder>().FindAsync([id], cancellationToken);
23
24 public bool TryGetOrder(int id, out TOrder order)
25 => _cache.TryGetValue(id, out order);
26
27 public void Dispose() => _context.Dispose();
28}
SSDoc: Documented OrderRepository. (1 ms) Ln 7, Col 21

Click any declaration to run Add XML Documentation.宣言をクリックすると、Add XML Documentation が実行されます。 Every comment in this demo is unedited output from SSDoc 2.0.このデモのコメントは、すべて SSDoc 2.0 の出力そのままです。

One command, right where you are.いつもの場所で、コマンドひとつ。

No setup, no project changes, no build. SSDoc works on the file in front of you.事前の設定も、プロジェクトの変更も、ビルドもいりません。いま開いているファイルに、そのまま書き込みます。

  1. 1

    Put the caret on a declaration宣言にキャレットを置く

    On the declaration itself, on the blank line above it, or inside a comment that needs updating.宣言の行でも、その直前の空行でも、直したいコメントの中でも構いません。

  2. 2

    Run Add XML DocumentationAdd XML Documentation を実行

    From the editor’s context menu or the Tools menu, or with a shortcut you assign.エディタの右クリックメニューかツールメニューから。ショートカットも割り当てられます。

  3. 3

    Keep typingそのまま続きを書く

    The comment arrives as a single edit. The status bar says what changed, and one Ctrl+Z takes it back.コメントは1回の編集で入ります。何をしたかはステータスバーに表示され、Ctrl+Z を1回押せば元に戻せます。

What it writes, and what it leaves alone.書くもの、触れないもの。

Every comment on this page is unedited output from SSDoc 2.0. Some panels combine several runs.このページのコメントは、すべて SSDoc 2.0 の出力に手を加えずに載せています。いくつかの例は、複数回の実行結果を組み合わせたものです。

Keeps what you wrote.書いた説明は、消さない。

SSDoc fills in what is empty or missing and leaves the rest of your text alone. Rename a parameter and its description follows the new name. <remarks>, <example> and <exception> are kept word for word, after the standard elements.空の要素と足りない要素だけを埋め、書いた文には手を加えません。引数の名前を変えても、説明は新しい名前に引き継がれます。<remarks>・<example>・<exception> は、書いた内容のまま、標準の要素の後ろに残ります。

/// <summary>/// Moves the order to the archive. Archived orders are read-only./// </summary>/// <param name="order">The order to archive.</param>/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>/// <returns>A task that represents the asynchronous operation. The task result contains <see langword="true"/> if the specified order was archived successfully; otherwise, <see langword="false"/>.</returns>/// <remarks>Runs inside the current transaction.</remarks>public Task<bool> ArchiveAsync(Order order, CancellationToken cancellationToken) => null;
  • Filled in or added補完・追加した行
  • Parameter renamed, description kept名前の変更に追従(説明はそのまま)

When the number of parameters is unchanged, descriptions are matched by position.引数の数が変わらない場合は、位置で対応づけて説明を引き継ぎます。

Reads like a person wrote it.人が書いたような英語で。

Built-in dictionaries hold about 600 verbs with their inflections, 270 abbreviations and acronyms, 120 type-name patterns and the wording of well-known .NET members. Async methods, Try and Is methods, event handlers and exceptions get the phrasing .NET developers already know.動詞約600語とその活用形、略語・頭字語約270語、型名のパターン約120種、よく知られた .NET メンバーの言い回しを内蔵しています。非同期メソッド、Try・Is で始まるメソッド、イベントハンドラー、例外クラスも、.NET の開発者が見慣れた言い回しで書きます。

class OrderRepository
Provides data access for orders.
class InvalidStateException : Exception
The exception that is thrown when an invalid state error occurs.
interface IOrderRepository
Defines the contract for an order repository.
Task<User> GetByIdAsync(int id, CancellationToken ct)
Gets the user by identifier asynchronously.
bool IsNullOrEmpty(string value)
Determines whether the specified value is null or empty.
bool TryParse(string text, out int value)
Tries to parse the specified text.
int RetryCount { get; private set; }
Gets the number of retries.
event EventHandler ItemAdded
Occurs when the item is added.
void saveButton_Click(object sender, EventArgs e)
Handles the Click event of the saveButton control.
string ToHtmlString(Uri baseUri)
Converts this instance to an HTML string.

Every declaration, up to C# 14.C# 14 まで、すべての宣言に。

Types and members alike, including primary constructors, records, extension blocks and user-defined compound assignment operators.型にもメンバーにも。プライマリコンストラクター、レコード、extension ブロック、ユーザー定義の複合代入演算子にも対応します。

Types型

  • class
  • struct
  • record
  • record struct
  • interface
  • enum
  • delegate
  • extensionC# 14
  • primary constructorプライマリコンストラクター

Membersメンバー

  • methodメソッド
  • constructorコンストラクター
  • static constructor静的コンストラクター
  • finalizerファイナライザー
  • operator
  • operator +=C# 14
  • conversion変換演算子
  • propertyプロパティ
  • indexerインデクサー
  • event
  • fieldフィールド
  • const
  • enum member列挙値

C# 14 items are documented on Visual Studio 2026, whose compiler understands that syntax.C# 14 の項目は、その構文を扱える Visual Studio 2026 で使えます。

public static class EnumerableExtensions{    /// <summary>    /// Provides extension members for <see cref="IEnumerable{T}"/>.    /// </summary>    /// <typeparam name="T">The type of the elements of the source.</typeparam>    /// <param name="source">The source.</param>    extension<T>(IEnumerable<T> source)    {        /// <summary>        /// Gets a value indicating whether this instance is empty.        /// </summary>        public bool IsEmpty => !source.Any();    }}

StyleCop conventions, built in.StyleCop の作法を、最初から。

Constructors, finalizers and properties open with the exact phrases StyleCop’s documentation rules look for. Overrides and explicit interface implementations get <inheritdoc/>.コンストラクター、ファイナライザー、プロパティは、StyleCop のドキュメント規則が求める書き出しで始まります。オーバーライドとインターフェイスの明示的な実装には <inheritdoc/> を付けます。

SA1642Constructorコンストラクターpublic Money(decimal amount, string currency)/// Initializes a new instance of the <see cref="Money"/> struct.
SA1642Private constructorprivate コンストラクターprivate OrderCache()/// Prevents a default instance of the <see cref="OrderCache"/> class from being created.
SA1642Static constructor静的コンストラクターstatic OrderCache()/// Initializes static members of the <see cref="OrderCache"/> class.
SA1643Finalizerファイナライザー~NativeBuffer()/// Finalizes an instance of the <see cref="NativeBuffer"/> class.
SA1623Boolean propertybool のプロパティpublic bool IsReadOnly { get; set; }/// Gets or sets a value indicating whether this instance is read-only.
SA1623Write-only property書き込み専用のプロパティpublic string Note { set { } }/// Sets the note.

Sees what the compiler sees.コンパイラと同じものを見る。

SSDoc reads your project’s preprocessor symbols. In a multi-targeting project it follows the target you pick in the editor’s navigation bar, so only code that target compiles gets documented.プロジェクトのプリプロセッサシンボルを読み取ります。マルチターゲットのプロジェクトでは、エディタのナビゲーションバーで選んだターゲットに合わせ、そのターゲットでコンパイルされるコードにだけコメントを付けます。

#if NET8_0_OR_GREATER/// <summary>/// Loads the order asynchronously./// </summary>/// <param name="orderId">The order identifier.</param>/// <returns>A task that represents the asynchronous operation. The task result contains the order.</returns>public ValueTask<Order> LoadOrderAsync(int orderId) => default;#elsepublic Task<Order> LoadOrderAsync(int orderId) => null;#endif

The dimmed branch is excluded for the selected target.薄く表示した側は、選んだターゲットではコンパイルされません。

Knows what to leave alone.触れるべきでないものには、触れない。

If a comment isn’t well-formed XML, SSDoc changes nothing and tells you why in the status bar. Comments that use <inheritdoc/>, <include/> or /** */ stay as they are, and a second run on an up-to-date comment changes nothing.XML として正しくないコメントは変更せず、理由をステータスバーに表示します。<inheritdoc/>・<include/>・/** */ のコメントもそのまま。最新のコメントにもう一度実行しても、何も変わりません。

  • A comment with a missing end tag終了タグが欠けたコメントSSDoc: The documentation of GetCustomerName is not well-formed XML (for example a missing end tag); nothing was changed. (0 ms)
  • A member that uses <inheritdoc/><inheritdoc/> を使うメンバーSSDoc: GetHashCode uses <inheritdoc/> or <include/>; nothing was changed. (0 ms)
  • An old /** */ comment/** */ 形式のコメントSSDoc: /** */ comments are not modified. (0 ms)
  • Code excluded by #if#if で除外されたコードSSDoc: The caret is in code excluded by #if. (0 ms)
  • Running it a second time2回目の実行SSDoc: The documentation of RetryCount is up to date. (0 ms)

About a millisecond.約1ミリ秒。

SSDoc never asks Roslyn for a semantic model and never applies changes through the workspace. The work stays small, so the comment is there the moment you run the command.Roslyn に意味解析を求めず、変更もワークスペースを通さずに書き込みます。処理が小さいので、実行した瞬間にコメントが入ります。

  1. 1

    Wrap the editor snapshotスナップショットをそのまま使う

    The text in the editor becomes Roslyn source text as is, without a copy.エディタの内容をコピーせず、そのまま Roslyn のソーステキストとして使います。

  2. 2

    Reparse what changed変わった所だけ解析し直す

    The file’s previous syntax tree is updated incrementally.そのファイルの前回の構文木を、差分で更新します。

  3. 3

    Generate from syntax構文から生成する

    The declaration is read from the syntax tree, and the words come from in-memory dictionaries.宣言は構文木から読み取り、言葉はメモリ上の辞書から選びます。

  4. 4

    Write one edit1回の編集で書き込む

    A single buffer edit on the UI thread, undone with one Ctrl+Z.UI スレッドでバッファを1回だけ編集します。Ctrl+Z を1回押せば元に戻せます。

1.03 msSSDoc, a command after an edit (median)SSDoc:編集後のコマンド(中央値)
140 msSSDoc, the first command on a file (one full parse)SSDoc:そのファイルで最初のコマンド(全文の解析1回)
1,803 msA semantic model alone, as SSDoc 1.x required (cold)意味解析のみ(SSDoc 1.x で必要だった処理、初回)

Measured outside Visual Studio on a 10,800-line C# file, Release build. Generating the comment itself takes about 0.08 ms.Visual Studio の外で、10,800行の C# ファイルを Release ビルドで計測。コメントの生成そのものは約0.08ミリ秒です。

Loads only when you need it.必要になるまで読み込まない。

SSDoc stays unloaded until a C# editor becomes active. Then it loads in the background and warms up its engine before you first run the command.SSDoc は、C# のエディタが開かれるまで読み込まれません。開かれるとバックグラウンドで読み込まれ、最初にコマンドを使う前にエンジンの準備を済ませます。

Three options. Sensible defaults.設定は3つ。初期値のままで使えます。

They live in Tools › Options › SSDoc › General. Switch them here to see what changes.[ツール]›[オプション]›[SSDoc]›[General]にあります。ここで切り替えると、出力の違いを確かめられます。

Options SSDoc › General
Generation
Use <inheritdoc/> for overrides
Add <value> to properties
Existing documentation
Keep existing documentation
Use <inheritdoc/> for overridesOverrides and explicit interface implementations get <inheritdoc/> instead of generated text.
public class Customer{    private readonly IOrderRepository _orders;     /// <summary>    /// Gets or sets the display name.    /// </summary>    public string DisplayName { get; set; }     /// <summary>    /// Moves the order to the archive. Archived orders are read-only.    /// </summary>    /// <param name="order">The order to archive.</param>    /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>    /// <returns>A task that represents the asynchronous operation. The task result contains <see langword="true"/> if the specified order was archived successfully; otherwise, <see langword="false"/>.</returns>    /// <remarks>Runs inside the current transaction.</remarks>    public Task<bool> ArchiveAsync(Order order, CancellationToken cancellationToken)        => _orders.ArchiveAsync(order, cancellationToken);     /// <inheritdoc/>    public override string ToString() => DisplayName;}

ArchiveAsync already had a summary and remarks written by hand.ArchiveAsync には、手で書いた概要と remarks が付いていました。

Install SSDoc.SSDoc を入れる。

It takes a minute, and it’s free.1分で終わります。無料です。

  1. 1In Visual Studio, open Extensions › Manage Extensions.Visual Studio で[拡張機能]›[拡張機能の管理]を開きます。
  2. 2Search for SSDoc and select Install.SSDoc を検索して、[インストール]を選びます。
  3. 3Restart Visual Studio, open a C# file and run Add XML Documentation.Visual Studio を再起動し、C# のファイルで Add XML Documentation を実行します。

Prefer a keyboard shortcut? Assign one to SSDoc.Services.AddDocumentation in Tools › Options › Environment › Keyboard.キーボードで使いたいときは、[ツール]›[オプション]›[環境]›[キーボード]で SSDoc.Services.AddDocumentation にショートカットを割り当てます。

Visual Studio対応バージョン
2022 (17.14 or later), 20262022(17.14 以降)、2026
Editionsエディション
Community, Professional, Enterprise
ProcessorsCPU
x64, Arm64
Price価格
Free for personal and commercial use無料(個人・商用とも)
Licenseライセンス
Proprietary freeware, not open source. Read the license terms独自の無償ライセンス(オープンソースではありません)。使用許諾を読む