# rome/tools architecture

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

- Interactive diagram: https://gitdiagram.com/rome/tools
- Repository: https://github.com/rome/tools

## Overview

Rome is a multi-language developer tool for formatting, linting, bundling, and IDE-oriented code processing; the README emphasizes full-fidelity parsing and a shared processing experience. The graph highlights the CLI and language-server entry points, workspace processing, language parsing, formatting, and analysis, plus diagnostic reporting. The sampled code supports only a few concrete call relationships; other capability links are documented by the README or left unconnected rather than inferred from crate names.

Main entry points: [`crates/rome_service/src/workspace/server.rs`](https://github.com/rome/tools/blob/main/crates/rome_service/src/workspace/server.rs) (Workspace Server), [`crates/rome_lsp/src/server.rs`](https://github.com/rome/tools/blob/main/crates/rome_lsp/src/server.rs) (Language Server), [`crates/rome_service/src/workspace.rs`](https://github.com/rome/tools/blob/main/crates/rome_service/src/workspace.rs) (Workspace API), [`crates/rome_js_parser/src/syntax/module.rs`](https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/syntax/module.rs) (Module Parsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_cli["CLI<br/>[main.rs]"]
  node_vscode["VS Code<br/>[main.ts]"]
  node_lsp["Language Server<br/>[server.rs]"]
  node_session["LSP Session<br/>[session.rs]"]
end

subgraph group_workspace["Workspace Services"]
  node_workspace["Workspace API<br/>[workspace.rs]"]
  node_workspace_server["Workspace Server<br/>[server.rs]"]
  node_workspace_client["Workspace Client<br/>[client.rs]"]
  node_file_handlers["File Handlers<br/>[mod.rs]"]
  node_bundler["Bundler"]
end

subgraph group_languages["Language Processing"]
  node_js_parser["JS Parser<br/>[parser.rs]"]
  node_parser_state["Parser State<br/>[state.rs]"]
  node_module_parser["Module Parsing<br/>[module.rs]"]
  node_statement_parser["Statement Parsing<br/>[stmt.rs]"]
  node_program_parser["Program Parsing<br/>[program.rs]"]
  node_js_formatter["JS Formatter<br/>[format.rs]"]
  node_js_analyze["JS Analysis<br/>[analyzers.rs]"]
  node_analyze_core["Analysis Framework<br/>[query.rs]"]
end

subgraph group_support["Shared Support"]
  node_diagnostics["Diagnostics<br/>[diagnostic.rs]"]
  node_fs["File System<br/>[fs.rs]"]
end

node_developer(("Developer"))

node_developer -.->|"invokes"| node_cli
node_developer -.->|"uses"| node_vscode
node_vscode -->|"starts"| node_lsp
node_lsp -->|"creates"| node_session
node_lsp -->|"selects server"| node_workspace
node_workspace -->|"delegates to"| node_workspace_server
node_workspace -->|"exposes client"| node_workspace_client
node_workspace_server -->|"uses capabilities"| node_file_handlers
node_workspace_server -.->|"calls parser"| node_js_parser
node_workspace_server -.->|"formats files"| node_js_formatter
node_workspace_server -.->|"analyzes files"| node_js_analyze
node_program_parser -->|"parses modules"| node_module_parser
node_program_parser -->|"parses statements"| node_statement_parser
node_module_parser -->|"uses statements"| node_statement_parser
node_statement_parser -->|"parses exports"| node_module_parser
node_js_analyze -.->|"uses framework"| node_analyze_core
node_developer -.->|"uses bundling"| node_bundler

click node_cli "https://github.com/rome/tools/blob/main/crates/rome_cli/src/main.rs"
click node_vscode "https://github.com/rome/tools/blob/main/editors/vscode/src/main.ts"
click node_lsp "https://github.com/rome/tools/blob/main/crates/rome_lsp/src/server.rs"
click node_session "https://github.com/rome/tools/blob/main/crates/rome_lsp/src/session.rs"
click node_workspace "https://github.com/rome/tools/blob/main/crates/rome_service/src/workspace.rs"
click node_workspace_server "https://github.com/rome/tools/blob/main/crates/rome_service/src/workspace/server.rs"
click node_workspace_client "https://github.com/rome/tools/blob/main/crates/rome_service/src/workspace/client.rs"
click node_file_handlers "https://github.com/rome/tools/blob/main/crates/rome_service/src/file_handlers/mod.rs"
click node_js_parser "https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/parser.rs"
click node_parser_state "https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/state.rs"
click node_module_parser "https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/syntax/module.rs"
click node_statement_parser "https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/syntax/stmt.rs"
click node_program_parser "https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/syntax/program.rs"
click node_js_formatter "https://github.com/rome/tools/blob/main/crates/rome_js_formatter/src/format.rs"
click node_js_analyze "https://github.com/rome/tools/blob/main/crates/rome_js_analyze/src/analyzers.rs"
click node_analyze_core "https://github.com/rome/tools/blob/main/crates/rome_analyze/src/query.rs"
click node_diagnostics "https://github.com/rome/tools/blob/main/crates/rome_diagnostics/src/diagnostic.rs"
click node_fs "https://github.com/rome/tools/blob/main/crates/rome_fs/src/fs.rs"

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_cli,node_vscode,node_lsp,node_session toneBlue
class node_workspace,node_workspace_server,node_workspace_client,node_file_handlers,node_bundler toneAmber
class node_js_parser,node_parser_state,node_module_parser,node_statement_parser,node_program_parser,node_js_formatter,node_js_analyze,node_analyze_core toneMint
class node_diagnostics,node_fs toneRose
class node_developer toneIndigo
```

## Components

### User Interfaces

- [CLI](https://github.com/rome/tools/blob/main/crates/rome_cli/src/main.rs): `crates/rome_cli/src/main.rs`
- [VS Code](https://github.com/rome/tools/blob/main/editors/vscode/src/main.ts): `editors/vscode/src/main.ts`
- [Language Server](https://github.com/rome/tools/blob/main/crates/rome_lsp/src/server.rs): `crates/rome_lsp/src/server.rs`
- [LSP Session](https://github.com/rome/tools/blob/main/crates/rome_lsp/src/session.rs): `crates/rome_lsp/src/session.rs`

### Workspace Services

- [Workspace API](https://github.com/rome/tools/blob/main/crates/rome_service/src/workspace.rs): `crates/rome_service/src/workspace.rs`
- [Workspace Server](https://github.com/rome/tools/blob/main/crates/rome_service/src/workspace/server.rs): `crates/rome_service/src/workspace/server.rs`
- [Workspace Client](https://github.com/rome/tools/blob/main/crates/rome_service/src/workspace/client.rs): `crates/rome_service/src/workspace/client.rs`
- [File Handlers](https://github.com/rome/tools/blob/main/crates/rome_service/src/file_handlers/mod.rs): `crates/rome_service/src/file_handlers/mod.rs`
- **Bundler**

### Language Processing

- [JS Parser](https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/parser.rs): `crates/rome_js_parser/src/parser.rs`
- [Parser State](https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/state.rs): `crates/rome_js_parser/src/state.rs`
- [Module Parsing](https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/syntax/module.rs): `crates/rome_js_parser/src/syntax/module.rs`
- [Statement Parsing](https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/syntax/stmt.rs): `crates/rome_js_parser/src/syntax/stmt.rs`
- [Program Parsing](https://github.com/rome/tools/blob/main/crates/rome_js_parser/src/syntax/program.rs): `crates/rome_js_parser/src/syntax/program.rs`
- [JS Formatter](https://github.com/rome/tools/blob/main/crates/rome_js_formatter/src/format.rs): `crates/rome_js_formatter/src/format.rs`
- [JS Analysis](https://github.com/rome/tools/blob/main/crates/rome_js_analyze/src/analyzers.rs): `crates/rome_js_analyze/src/analyzers.rs`
- [Analysis Framework](https://github.com/rome/tools/blob/main/crates/rome_analyze/src/query.rs): `crates/rome_analyze/src/query.rs`

### Shared Support

- [Diagnostics](https://github.com/rome/tools/blob/main/crates/rome_diagnostics/src/diagnostic.rs): `crates/rome_diagnostics/src/diagnostic.rs`
- [File System](https://github.com/rome/tools/blob/main/crates/rome_fs/src/fs.rs): `crates/rome_fs/src/fs.rs`

### Other components

- **Developer**

## Connections

- Developer → CLI: invokes
- Developer → VS Code: uses
- VS Code → Language Server: starts (evidence: `editors/vscode/src/main.ts`)
- Language Server → LSP Session: creates (evidence: `crates/rome_lsp/src/server.rs`)
- Language Server → Workspace API: selects server (evidence: `crates/rome_lsp/src/server.rs`)
- Workspace API → Workspace Server: delegates to (evidence: `crates/rome_service/src/workspace.rs`)
- Workspace API → Workspace Client: exposes client (evidence: `crates/rome_service/src/workspace.rs`)
- Workspace Server → File Handlers: uses capabilities (evidence: `crates/rome_service/src/workspace/server.rs`)
- Workspace Server → JS Parser: calls parser
- Workspace Server → JS Formatter: formats files
- Workspace Server → JS Analysis: analyzes files
- Program Parsing → Module Parsing: parses modules (evidence: `crates/rome_js_parser/src/syntax/program.rs`)
- Program Parsing → Statement Parsing: parses statements (evidence: `crates/rome_js_parser/src/syntax/program.rs`)
- Module Parsing → Statement Parsing: uses statements (evidence: `crates/rome_js_parser/src/syntax/module.rs`)
- Statement Parsing → Module Parsing: parses exports (evidence: `crates/rome_js_parser/src/syntax/stmt.rs`)
- JS Analysis → Analysis Framework: uses framework
- Developer → Bundler: uses bundling (evidence: `README.md`)
