# dotnet/roslynator architecture

> Architecture diagram of the GitHub repository dotnet/roslynator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dotnet/roslynator
- Repository: https://github.com/dotnet/roslynator

## Overview

Roslynator is a Roslyn-based C# analysis toolkit: analyzers report diagnostics, while IDE integrations expose refactorings and compiler-diagnostic fixes; analyzer packages are distributed separately. The repository also contains a CLI and reusable Roslyn client/workspace services. The principal workflow is source analysis in an editor, diagnostic/refactoring discovery, then a code fix or refactoring applied to the document. Some branches are represented by their exact enclosing source directories because individual implementations were not sampled; relationships without direct evidence are omitted.

Main entry points: [`src/Analyzers/CSharp/Analysis`](https://github.com/dotnet/roslynator/tree/main/src/Analyzers/CSharp/Analysis) (C# analyzers), [`src/CSharp.Workspaces/CSharp/CSharpSyntaxFactsService.cs`](https://github.com/dotnet/roslynator/blob/main/src/CSharp.Workspaces/CSharp/CSharpSyntaxFactsService.cs) (C# syntax service), [`src/Workspaces.Core/ISyntaxFactsService.cs`](https://github.com/dotnet/roslynator/blob/main/src/Workspaces.Core/ISyntaxFactsService.cs) (Syntax facts contract), [`src/Analyzers/CSharp/Analysis/AddParagraphToDocumentationCommentAnalyzer.cs`](https://github.com/dotnet/roslynator/blob/main/src/Analyzers/CSharp/Analysis/AddParagraphToDocumentationCommentAnalyzer.cs) (Documentation analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Code analysis"]
  node_analyzers["C&#35; analyzers"]
  node_sampleanalyzer["Documentation analyzer"]
  node_analyzerfix["Analyzer code fixes<br/>[CodeFixes]"]
  node_samplefix["Documentation fix"]
  node_formatanalyzers["Formatting analyzers"]
end

subgraph group_ide["Editor features"]
  node_compilerfixes["Compiler diagnostic fixes"]
  node_refactorings["C&#35; refactorings"]
  node_eventextract["Extract event handler"]
  node_vs["Visual Studio integration"]
  node_vscode["VS Code integration<br/>[extension.ts]"]
end

subgraph group_cli["Command line"]
  node_cli["CLI entry point<br/>[Program.cs]"]
  node_commands["CLI commands"]
end

subgraph group_libraries["Client libraries"]
  node_syntaxinterface["Syntax facts contract"]
  node_csharpsyntax["C&#35; syntax service"]
  node_vbsyntax["VB syntax service"]
  node_metrics["Code metrics"]
  node_csharpmetrics["C&#35; metrics"]
  node_spelling["Spelling services<br/>[SpellingService.cs]"]
  node_csharpspell["C&#35; spelling"]
  node_core["Roslyn core helpers"]
end

node_developer(("Developer"))
node_editor["IDE / editor"]
node_source["C&#35; source"]

node_developer -->|"edits in"| node_editor
node_editor -->|"provides"| node_source
node_source -.->|"analyzed by"| node_analyzers
node_analyzers -->|"includes"| node_sampleanalyzer
node_sampleanalyzer -->|"diagnostic fixed by"| node_samplefix
node_analyzers -.->|"diagnostics offered to"| node_analyzerfix
node_source -.->|"refactored in"| node_refactorings
node_refactorings -->|"includes"| node_eventextract
node_editor -->|"offers fixes"| node_compilerfixes
node_editor -->|"integrates through"| node_vs
node_editor -->|"integrates through"| node_vscode
node_developer -->|"runs"| node_cli
node_cli -->|"dispatches"| node_commands
node_syntaxinterface -->|"implemented by"| node_csharpsyntax
node_syntaxinterface -->|"implemented by"| node_vbsyntax
node_metrics -->|"implemented by"| node_csharpmetrics
node_csharpmetrics -->|"uses syntax facts"| node_csharpsyntax
node_spelling -->|"extended by"| node_csharpspell
node_csharpspell -->|"uses syntax facts"| node_csharpsyntax

click node_analyzers "https://github.com/dotnet/roslynator/tree/main/src/Analyzers/CSharp/Analysis"
click node_sampleanalyzer "https://github.com/dotnet/roslynator/blob/main/src/Analyzers/CSharp/Analysis/AddParagraphToDocumentationCommentAnalyzer.cs"
click node_analyzerfix "https://github.com/dotnet/roslynator/tree/main/src/Analyzers.CodeFixes/CSharp/CodeFixes"
click node_samplefix "https://github.com/dotnet/roslynator/blob/main/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs"
click node_formatanalyzers "https://github.com/dotnet/roslynator/tree/main/src/Formatting.Analyzers"
click node_compilerfixes "https://github.com/dotnet/roslynator/tree/main/src/CodeFixes/CSharp/CodeFixes"
click node_refactorings "https://github.com/dotnet/roslynator/tree/main/src/Refactorings/CSharp/Refactorings"
click node_eventextract "https://github.com/dotnet/roslynator/blob/main/src/Refactorings/CSharp/Refactorings/ExtractEventHandlerMethodRefactoring.cs"
click node_vs "https://github.com/dotnet/roslynator/tree/main/src/VisualStudio"
click node_vscode "https://github.com/dotnet/roslynator/blob/main/src/VisualStudioCode/package/src/extension.ts"
click node_cli "https://github.com/dotnet/roslynator/blob/main/src/CommandLine/Program.cs"
click node_commands "https://github.com/dotnet/roslynator/tree/main/src/CommandLine/Commands"
click node_syntaxinterface "https://github.com/dotnet/roslynator/blob/main/src/Workspaces.Core/ISyntaxFactsService.cs"
click node_csharpsyntax "https://github.com/dotnet/roslynator/blob/main/src/CSharp.Workspaces/CSharp/CSharpSyntaxFactsService.cs"
click node_vbsyntax "https://github.com/dotnet/roslynator/blob/main/src/VisualBasic.Workspaces/VisualBasic/VisualBasicSyntaxFactsService.cs"
click node_metrics "https://github.com/dotnet/roslynator/blob/main/src/Workspaces.Core/CodeMetrics/CodeMetricsService.cs"
click node_csharpmetrics "https://github.com/dotnet/roslynator/blob/main/src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpCodeMetricsService.cs"
click node_spelling "https://github.com/dotnet/roslynator/blob/main/src/Workspaces.Core/Spelling/SpellingService.cs"
click node_csharpspell "https://github.com/dotnet/roslynator/blob/main/src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.cs"
click node_core "https://github.com/dotnet/roslynator/tree/main/src/Core"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_analyzers,node_sampleanalyzer,node_analyzerfix,node_samplefix,node_formatanalyzers toneBlue
class node_compilerfixes,node_refactorings,node_eventextract,node_vs,node_vscode toneAmber
class node_cli,node_commands toneMint
class node_syntaxinterface,node_csharpsyntax,node_vbsyntax,node_metrics,node_csharpmetrics,node_spelling,node_csharpspell,node_core toneRose
class node_developer,node_editor,node_source toneIndigo
```

## Components

### Code analysis

- [C# analyzers](https://github.com/dotnet/roslynator/tree/main/src/Analyzers/CSharp/Analysis): `src/Analyzers/CSharp/Analysis`
- [Documentation analyzer](https://github.com/dotnet/roslynator/blob/main/src/Analyzers/CSharp/Analysis/AddParagraphToDocumentationCommentAnalyzer.cs): `src/Analyzers/CSharp/Analysis/AddParagraphToDocumentationCommentAnalyzer.cs`
- [Analyzer code fixes](https://github.com/dotnet/roslynator/tree/main/src/Analyzers.CodeFixes/CSharp/CodeFixes): `src/Analyzers.CodeFixes/CSharp/CodeFixes`
- [Documentation fix](https://github.com/dotnet/roslynator/blob/main/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs): `src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs`
- [Formatting analyzers](https://github.com/dotnet/roslynator/tree/main/src/Formatting.Analyzers): `src/Formatting.Analyzers`

### Editor features

- [Compiler diagnostic fixes](https://github.com/dotnet/roslynator/tree/main/src/CodeFixes/CSharp/CodeFixes): `src/CodeFixes/CSharp/CodeFixes`
- [C# refactorings](https://github.com/dotnet/roslynator/tree/main/src/Refactorings/CSharp/Refactorings): `src/Refactorings/CSharp/Refactorings`
- [Extract event handler](https://github.com/dotnet/roslynator/blob/main/src/Refactorings/CSharp/Refactorings/ExtractEventHandlerMethodRefactoring.cs): `src/Refactorings/CSharp/Refactorings/ExtractEventHandlerMethodRefactoring.cs`
- [Visual Studio integration](https://github.com/dotnet/roslynator/tree/main/src/VisualStudio): `src/VisualStudio`
- [VS Code integration](https://github.com/dotnet/roslynator/blob/main/src/VisualStudioCode/package/src/extension.ts): `src/VisualStudioCode/package/src/extension.ts`

### Command line

- [CLI entry point](https://github.com/dotnet/roslynator/blob/main/src/CommandLine/Program.cs): `src/CommandLine/Program.cs`
- [CLI commands](https://github.com/dotnet/roslynator/tree/main/src/CommandLine/Commands): `src/CommandLine/Commands`

### Client libraries

- [Syntax facts contract](https://github.com/dotnet/roslynator/blob/main/src/Workspaces.Core/ISyntaxFactsService.cs): `src/Workspaces.Core/ISyntaxFactsService.cs`
- [C# syntax service](https://github.com/dotnet/roslynator/blob/main/src/CSharp.Workspaces/CSharp/CSharpSyntaxFactsService.cs): `src/CSharp.Workspaces/CSharp/CSharpSyntaxFactsService.cs`
- [VB syntax service](https://github.com/dotnet/roslynator/blob/main/src/VisualBasic.Workspaces/VisualBasic/VisualBasicSyntaxFactsService.cs): `src/VisualBasic.Workspaces/VisualBasic/VisualBasicSyntaxFactsService.cs`
- [Code metrics](https://github.com/dotnet/roslynator/blob/main/src/Workspaces.Core/CodeMetrics/CodeMetricsService.cs): `src/Workspaces.Core/CodeMetrics/CodeMetricsService.cs`
- [C# metrics](https://github.com/dotnet/roslynator/blob/main/src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpCodeMetricsService.cs): `src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpCodeMetricsService.cs`
- [Spelling services](https://github.com/dotnet/roslynator/blob/main/src/Workspaces.Core/Spelling/SpellingService.cs): `src/Workspaces.Core/Spelling/SpellingService.cs`
- [C# spelling](https://github.com/dotnet/roslynator/blob/main/src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.cs): `src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.cs`
- [Roslyn core helpers](https://github.com/dotnet/roslynator/tree/main/src/Core): `src/Core`

### Other components

- **Developer**
- **IDE / editor**
- **C# source**

## Connections

- Developer → IDE / editor: edits in (evidence: `README.md`)
- IDE / editor → C# source: provides (evidence: `README.md`)
- C# source → C# analyzers: analyzed by
- C# analyzers → Documentation analyzer: includes (evidence: `src/Analyzers/CSharp/Analysis/AddParagraphToDocumentationCommentAnalyzer.cs`)
- Documentation analyzer → Documentation fix: diagnostic fixed by (evidence: `src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs`)
- C# analyzers → Analyzer code fixes: diagnostics offered to (evidence: `src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs`)
- C# source → C# refactorings: refactored in
- C# refactorings → Extract event handler: includes (evidence: `src/Refactorings/CSharp/Refactorings/ExtractEventHandlerMethodRefactoring.cs`)
- IDE / editor → Compiler diagnostic fixes: offers fixes (evidence: `README.md`)
- IDE / editor → Visual Studio integration: integrates through (evidence: `README.md`)
- IDE / editor → VS Code integration: integrates through (evidence: `README.md`)
- Developer → CLI entry point: runs (evidence: `README.md`)
- CLI entry point → CLI commands: dispatches (evidence: `src/CommandLine/Program.cs`)
- Syntax facts contract → C# syntax service: implemented by (evidence: `src/CSharp.Workspaces/CSharp/CSharpSyntaxFactsService.cs`)
- Syntax facts contract → VB syntax service: implemented by (evidence: `src/VisualBasic.Workspaces/VisualBasic/VisualBasicSyntaxFactsService.cs`)
- Code metrics → C# metrics: implemented by (evidence: `src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpCodeMetricsService.cs`)
- C# metrics → C# syntax service: uses syntax facts (evidence: `src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpCodeMetricsService.cs`)
- Spelling services → C# spelling: extended by (evidence: `src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.cs`)
- C# spelling → C# syntax service: uses syntax facts (evidence: `src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.cs`)
