# saeeedhany/ase architecture

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

- Interactive diagram: https://gitdiagram.com/saeeedhany/ase
- Repository: https://github.com/saeeedhany/ase

## Overview

ASE is a GUI text editor with a headless C core and a Qt shell. The main workflow is opening or creating a buffer, editing it in the viewport, and saving it; the GUI also exposes search, project tools, Vim mode, language services, and customization. The core supplies text, undo, configuration, plugins, recovery, and session services, while syntax highlighting is a separate module. Several feature links below rely on README documentation or source-index references because their implementations were not sampled.

Main entry points: [`gui/src/main.cpp`](https://github.com/saeeedhany/ase/blob/main/gui/src/main.cpp) (Application window), [`gui/src/editor_viewport.cpp`](https://github.com/saeeedhany/ase/blob/main/gui/src/editor_viewport.cpp) (Editor viewport), [`core/src/lsp_client.c`](https://github.com/saeeedhany/ase/blob/main/core/src/lsp_client.c) (LSP client), [`core/src/buffer.c`](https://github.com/saeeedhany/ase/blob/main/core/src/buffer.c) (Text buffer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gui["Qt editor shell"]
  node_app["Application window<br/>[main.cpp]"]
  node_viewport["Editor viewport"]
  node_commandline["Command line<br/>[command_line.h]"]
  node_projectsearch["Project search<br/>[project_search.cpp]"]
end

subgraph group_editing["Editing engine"]
  node_buffer["Text buffer<br/>[buffer.c]"]
  node_undo["Undo history<br/>[undo.c]"]
end

subgraph group_language["Language features"]
  node_syntaxworker["Syntax worker<br/>[syntax_worker.cpp]"]
  node_syntax["Syntax highlighting<br/>[syntax.c]"]
  node_lspgui["LSP integration"]
  node_lsp["LSP client<br/>[lsp_client.c]"]
  node_json["JSON support<br/>[json.c]"]
  node_process["Process service<br/>[process.c]"]
end

subgraph group_custom["Customization"]
  node_config["Configuration<br/>[config.c]"]
  node_theme["Theme service<br/>[theme.c]"]
  node_plugins["Plugin host<br/>[plugin_host.c]"]
  node_keybindings["Keybindings<br/>[keybindings.cpp]"]
end

subgraph group_state["Project and state"]
  node_vcs["Git gutter<br/>[vcs.c]"]
  node_recovery["Crash recovery<br/>[recovery.c]"]
  node_session["Session restore<br/>[session.c]"]
end

node_user(("Editor user"))
node_server["Language server"]
node_filesystem[("Local files")]

node_user -->|"uses"| node_app
node_app -->|"opens or creates"| node_buffer
node_app -->|"creates"| node_viewport
node_viewport -->|"edits"| node_buffer
node_viewport -->|"supports undo"| node_undo
node_viewport -->|"invokes commands"| node_commandline
node_viewport -->|"offers project search"| node_projectsearch
node_viewport -.->|"requests parsing"| node_syntaxworker
node_syntaxworker -->|"parses text"| node_syntax
node_viewport -->|"uses language features"| node_lspgui
node_lspgui -.->|"requests LSP services"| node_lsp
node_lsp -->|"spawns server"| node_process
node_lsp -->|"encodes messages"| node_json
node_lsp -->|"exchanges JSON-RPC"| node_server
node_app -.->|"loads settings"| node_config
node_app -->|"applies palettes"| node_theme
node_app -->|"configures shortcuts"| node_keybindings
node_commandline -->|"runs commands"| node_plugins
node_viewport -->|"shows git changes"| node_vcs
node_app -->|"restores session"| node_session
node_app -->|"offers recovery"| node_recovery
node_buffer -->|"loads and saves"| node_filesystem
node_session -->|"stores session"| node_filesystem
node_recovery -.->|"stores snapshots"| node_filesystem

click node_app "https://github.com/saeeedhany/ase/blob/main/gui/src/main.cpp"
click node_viewport "https://github.com/saeeedhany/ase/blob/main/gui/src/editor_viewport.cpp"
click node_commandline "https://github.com/saeeedhany/ase/blob/main/gui/src/command_line.h"
click node_projectsearch "https://github.com/saeeedhany/ase/blob/main/gui/src/project_search.cpp"
click node_buffer "https://github.com/saeeedhany/ase/blob/main/core/src/buffer.c"
click node_undo "https://github.com/saeeedhany/ase/blob/main/core/src/undo.c"
click node_syntaxworker "https://github.com/saeeedhany/ase/blob/main/gui/src/syntax_worker.cpp"
click node_syntax "https://github.com/saeeedhany/ase/blob/main/modules/syntax/src/syntax.c"
click node_lspgui "https://github.com/saeeedhany/ase/blob/main/gui/src/editor_viewport_lsp.cpp"
click node_lsp "https://github.com/saeeedhany/ase/blob/main/core/src/lsp_client.c"
click node_json "https://github.com/saeeedhany/ase/blob/main/core/src/json.c"
click node_process "https://github.com/saeeedhany/ase/blob/main/core/src/process.c"
click node_config "https://github.com/saeeedhany/ase/blob/main/core/src/config.c"
click node_theme "https://github.com/saeeedhany/ase/blob/main/core/src/theme.c"
click node_plugins "https://github.com/saeeedhany/ase/blob/main/core/src/plugin_host.c"
click node_keybindings "https://github.com/saeeedhany/ase/blob/main/gui/src/keybindings.cpp"
click node_vcs "https://github.com/saeeedhany/ase/blob/main/core/src/vcs.c"
click node_recovery "https://github.com/saeeedhany/ase/blob/main/core/src/recovery.c"
click node_session "https://github.com/saeeedhany/ase/blob/main/core/src/session.c"

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_app,node_viewport,node_commandline,node_projectsearch,node_user toneBlue
class node_buffer,node_undo,node_filesystem toneAmber
class node_syntaxworker,node_syntax,node_lspgui,node_lsp,node_json,node_process,node_server toneMint
class node_config,node_theme,node_plugins,node_keybindings toneRose
class node_vcs,node_recovery,node_session toneIndigo
```

## Components

### Qt editor shell

- [Application window](https://github.com/saeeedhany/ase/blob/main/gui/src/main.cpp): `gui/src/main.cpp`
- [Editor viewport](https://github.com/saeeedhany/ase/blob/main/gui/src/editor_viewport.cpp): `gui/src/editor_viewport.cpp`
- [Command line](https://github.com/saeeedhany/ase/blob/main/gui/src/command_line.h): `gui/src/command_line.h`
- [Project search](https://github.com/saeeedhany/ase/blob/main/gui/src/project_search.cpp): `gui/src/project_search.cpp`

### Editing engine

- [Text buffer](https://github.com/saeeedhany/ase/blob/main/core/src/buffer.c): `core/src/buffer.c`
- [Undo history](https://github.com/saeeedhany/ase/blob/main/core/src/undo.c): `core/src/undo.c`

### Language features

- [Syntax worker](https://github.com/saeeedhany/ase/blob/main/gui/src/syntax_worker.cpp): `gui/src/syntax_worker.cpp`
- [Syntax highlighting](https://github.com/saeeedhany/ase/blob/main/modules/syntax/src/syntax.c): `modules/syntax/src/syntax.c`
- [LSP integration](https://github.com/saeeedhany/ase/blob/main/gui/src/editor_viewport_lsp.cpp): `gui/src/editor_viewport_lsp.cpp`
- [LSP client](https://github.com/saeeedhany/ase/blob/main/core/src/lsp_client.c): `core/src/lsp_client.c`
- [JSON support](https://github.com/saeeedhany/ase/blob/main/core/src/json.c): `core/src/json.c`
- [Process service](https://github.com/saeeedhany/ase/blob/main/core/src/process.c): `core/src/process.c`

### Customization

- [Configuration](https://github.com/saeeedhany/ase/blob/main/core/src/config.c): `core/src/config.c`
- [Theme service](https://github.com/saeeedhany/ase/blob/main/core/src/theme.c): `core/src/theme.c`
- [Plugin host](https://github.com/saeeedhany/ase/blob/main/core/src/plugin_host.c): `core/src/plugin_host.c`
- [Keybindings](https://github.com/saeeedhany/ase/blob/main/gui/src/keybindings.cpp): `gui/src/keybindings.cpp`

### Project and state

- [Git gutter](https://github.com/saeeedhany/ase/blob/main/core/src/vcs.c): `core/src/vcs.c`
- [Crash recovery](https://github.com/saeeedhany/ase/blob/main/core/src/recovery.c): `core/src/recovery.c`
- [Session restore](https://github.com/saeeedhany/ase/blob/main/core/src/session.c): `core/src/session.c`

### Other components

- **Editor user**
- **Language server**
- **Local files**

## Connections

- Editor user → Application window: uses (evidence: `README.md`)
- Application window → Text buffer: opens or creates (evidence: `gui/src/main.cpp`)
- Application window → Editor viewport: creates (evidence: `gui/src/main.cpp`)
- Editor viewport → Text buffer: edits
- Editor viewport → Undo history: supports undo (evidence: `README.md`)
- Editor viewport → Command line: invokes commands (evidence: `README.md`)
- Editor viewport → Project search: offers project search (evidence: `README.md`)
- Editor viewport → Syntax worker: requests parsing
- Syntax worker → Syntax highlighting: parses text
- Editor viewport → LSP integration: uses language features
- LSP integration → LSP client: requests LSP services
- LSP client → Process service: spawns server (evidence: `core/src/lsp_client.c`)
- LSP client → JSON support: encodes messages
- LSP client → Language server: exchanges JSON-RPC (evidence: `README.md`)
- Application window → Configuration: loads settings
- Application window → Theme service: applies palettes (evidence: `README.md`)
- Application window → Keybindings: configures shortcuts (evidence: `gui/src/main.cpp`)
- Command line → Plugin host: runs commands (evidence: `README.md`)
- Editor viewport → Git gutter: shows git changes (evidence: `README.md`)
- Application window → Session restore: restores session (evidence: `gui/src/main.cpp`)
- Application window → Crash recovery: offers recovery (evidence: `gui/src/main.cpp`)
- Text buffer → Local files: loads and saves
- Session restore → Local files: stores session
- Crash recovery → Local files: stores snapshots
