# ycm-core/youcompleteme architecture

> Architecture diagram of the GitHub repository ycm-core/youcompleteme, 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/ycm-core/youcompleteme
- Repository: https://github.com/ycm-core/youcompleteme

## Overview

YouCompleteMe is a Vim code-completion and IDE-feature engine, with a Python client communicating with the ycmd server. A typical workflow starts with editing a buffer: YCM prepares buffer context, sends completion or parse requests, and presents results in Vim. Separate feature branches provide diagnostics, navigation, signature help, semantic highlighting, inlay hints, and hierarchy views. The source index supports several client-side call relationships, but the Vim-to-Python wiring and most feature request flows were not sampled, so those links are omitted rather than inferred.

Main entry points: [`python/ycm/youcompleteme.py`](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/youcompleteme.py) (YCM coordinator), [`python/ycm/client/base_request.py`](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/base_request.py) (HTTP request base), [`python/ycm/buffer.py`](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/buffer.py) (Buffer state), [`python/ycm/semantic_highlighting.py`](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/semantic_highlighting.py) (Semantic highlighting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vim["Vim Integration"]
  node_vim_entry["Vim plugin<br/>[youcompleteme.vim]"]
  node_vim_autoload["Vim autoload<br/>[youcompleteme.vim]"]
end

subgraph group_client["Client Core"]
  node_orchestrator["YCM coordinator<br/>[youcompleteme.py]"]
  node_vim_api["Vim API<br/>[vimsupport.py]"]
  node_buffer["Buffer state<br/>[buffer.py]"]
  node_base["Client utilities<br/>[base.py]"]
  node_paths["Path utilities<br/>[paths.py]"]
end

subgraph group_features["Editor Features"]
  node_completion["Completion handling"]
  node_diagnostics["Diagnostic display"]
  node_hierarchy["Hierarchy views<br/>[hierarchy_tree.py]"]
  node_inlay["Inlay hints<br/>[inlay_hints.py]"]
  node_omni["Omni completion<br/>[omni_completer.py]"]
  node_scrolling["Scroll ranges<br/>[scrolling_range.py]"]
  node_semantic["Semantic highlighting"]
  node_signature["Signature help<br/>[signature_help.py]"]
  node_syntax["Syntax parsing<br/>[syntax_parse.py]"]
  node_text_props["Text properties<br/>[text_properties.py]"]
end

subgraph group_transport["Server Requests"]
  node_event["Event notifications"]
  node_request["HTTP request base<br/>[base_request.py]"]
  node_command["Command requests<br/>[command_request.py]"]
  node_resolve["Completion resolve"]
  node_debug["Debug info requests"]
end

node_vim_user(("Vim user"))
node_ycmd["ycmd server"]

node_vim_user -.->|"uses"| node_vim_entry
node_completion -->|"inherits"| node_request
node_command -->|"inherits"| node_request
node_event -->|"inherits"| node_request
node_resolve -->|"inherits"| node_request
node_debug -->|"inherits"| node_request
node_buffer -->|"creates"| node_event
node_buffer -->|"delegates to"| node_diagnostics
node_buffer -->|"uses"| node_semantic
node_buffer -->|"uses"| node_inlay
node_diagnostics -->|"uses"| node_text_props
node_omni -->|"uses"| node_request
node_semantic -->|"uses"| node_text_props
node_semantic -->|"uses"| node_scrolling
node_inlay -->|"uses"| node_scrolling
node_orchestrator -->|"uses"| node_buffer
node_orchestrator -->|"uses"| node_completion
node_orchestrator -->|"uses"| node_command
node_orchestrator -->|"uses"| node_signature
node_orchestrator -->|"uses"| node_syntax
node_orchestrator -->|"uses"| node_paths
node_request -->|"sends HTTP"| node_ycmd
node_orchestrator -->|"uses"| node_vim_api
node_base -->|"uses"| node_paths
node_base -->|"uses"| node_vim_api

click node_vim_entry "https://github.com/ycm-core/youcompleteme/blob/master/plugin/youcompleteme.vim"
click node_vim_autoload "https://github.com/ycm-core/youcompleteme/blob/master/autoload/youcompleteme.vim"
click node_orchestrator "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/youcompleteme.py"
click node_vim_api "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/vimsupport.py"
click node_buffer "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/buffer.py"
click node_base "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/base.py"
click node_paths "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/paths.py"
click node_completion "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/completion_request.py"
click node_diagnostics "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/diagnostic_interface.py"
click node_hierarchy "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/hierarchy_tree.py"
click node_inlay "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/inlay_hints.py"
click node_omni "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/omni_completer.py"
click node_scrolling "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/scrolling_range.py"
click node_semantic "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/semantic_highlighting.py"
click node_signature "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/signature_help.py"
click node_syntax "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/syntax_parse.py"
click node_text_props "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/text_properties.py"
click node_event "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/event_notification.py"
click node_request "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/base_request.py"
click node_command "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/command_request.py"
click node_resolve "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/resolve_completion_request.py"
click node_debug "https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/debug_info_request.py"
click node_ycmd "https://github.com/ycm-core/youcompleteme/tree/master/third_party/ycmd"

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_vim_entry,node_vim_autoload,node_vim_user toneBlue
class node_orchestrator,node_vim_api,node_buffer,node_base,node_paths toneAmber
class node_completion,node_diagnostics,node_hierarchy,node_inlay,node_omni,node_scrolling,node_semantic,node_signature,node_syntax,node_text_props,node_ycmd toneMint
class node_event,node_request,node_command,node_resolve,node_debug toneRose
```

## Components

### Vim Integration

- [Vim plugin](https://github.com/ycm-core/youcompleteme/blob/master/plugin/youcompleteme.vim): `plugin/youcompleteme.vim`
- [Vim autoload](https://github.com/ycm-core/youcompleteme/blob/master/autoload/youcompleteme.vim): `autoload/youcompleteme.vim`

### Client Core

- [YCM coordinator](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/youcompleteme.py): `python/ycm/youcompleteme.py`
- [Vim API](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/vimsupport.py): `python/ycm/vimsupport.py`
- [Buffer state](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/buffer.py): `python/ycm/buffer.py`
- [Client utilities](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/base.py): `python/ycm/base.py`
- [Path utilities](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/paths.py): `python/ycm/paths.py`

### Editor Features

- [Completion handling](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/completion_request.py): `python/ycm/client/completion_request.py`
- [Diagnostic display](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/diagnostic_interface.py): `python/ycm/diagnostic_interface.py`
- [Hierarchy views](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/hierarchy_tree.py): `python/ycm/hierarchy_tree.py`
- [Inlay hints](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/inlay_hints.py): `python/ycm/inlay_hints.py`
- [Omni completion](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/omni_completer.py): `python/ycm/omni_completer.py`
- [Scroll ranges](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/scrolling_range.py): `python/ycm/scrolling_range.py`
- [Semantic highlighting](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/semantic_highlighting.py): `python/ycm/semantic_highlighting.py`
- [Signature help](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/signature_help.py): `python/ycm/signature_help.py`
- [Syntax parsing](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/syntax_parse.py): `python/ycm/syntax_parse.py`
- [Text properties](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/text_properties.py): `python/ycm/text_properties.py`

### Server Requests

- [Event notifications](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/event_notification.py): `python/ycm/client/event_notification.py`
- [HTTP request base](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/base_request.py): `python/ycm/client/base_request.py`
- [Command requests](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/command_request.py): `python/ycm/client/command_request.py`
- [Completion resolve](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/resolve_completion_request.py): `python/ycm/client/resolve_completion_request.py`
- [Debug info requests](https://github.com/ycm-core/youcompleteme/blob/master/python/ycm/client/debug_info_request.py): `python/ycm/client/debug_info_request.py`

### Other components

- **Vim user**
- [ycmd server](https://github.com/ycm-core/youcompleteme/tree/master/third_party/ycmd): `third_party/ycmd`

## Connections

- Vim user → Vim plugin: uses (evidence: `README.md`)
- Completion handling → HTTP request base: inherits (evidence: `python/ycm/client/completion_request.py`)
- Command requests → HTTP request base: inherits (evidence: `python/ycm/client/command_request.py`)
- Event notifications → HTTP request base: inherits (evidence: `python/ycm/client/event_notification.py`)
- Completion resolve → HTTP request base: inherits (evidence: `python/ycm/client/resolve_completion_request.py`)
- Debug info requests → HTTP request base: inherits (evidence: `python/ycm/client/debug_info_request.py`)
- Buffer state → Event notifications: creates (evidence: `python/ycm/buffer.py`)
- Buffer state → Diagnostic display: delegates to (evidence: `python/ycm/buffer.py`)
- Buffer state → Semantic highlighting: uses (evidence: `python/ycm/buffer.py`)
- Buffer state → Inlay hints: uses (evidence: `python/ycm/buffer.py`)
- Diagnostic display → Text properties: uses (evidence: `python/ycm/diagnostic_interface.py`)
- Omni completion → HTTP request base: uses (evidence: `python/ycm/omni_completer.py`)
- Semantic highlighting → Text properties: uses (evidence: `python/ycm/semantic_highlighting.py`)
- Semantic highlighting → Scroll ranges: uses (evidence: `python/ycm/semantic_highlighting.py`)
- Inlay hints → Scroll ranges: uses (evidence: `python/ycm/inlay_hints.py`)
- YCM coordinator → Buffer state: uses (evidence: `python/ycm/youcompleteme.py`)
- YCM coordinator → Completion handling: uses (evidence: `python/ycm/youcompleteme.py`)
- YCM coordinator → Command requests: uses (evidence: `python/ycm/youcompleteme.py`)
- YCM coordinator → Signature help: uses (evidence: `python/ycm/youcompleteme.py`)
- YCM coordinator → Syntax parsing: uses (evidence: `python/ycm/youcompleteme.py`)
- YCM coordinator → Path utilities: uses (evidence: `python/ycm/youcompleteme.py`)
- HTTP request base → ycmd server: sends HTTP (evidence: `python/ycm/client/base_request.py`)
- YCM coordinator → Vim API: uses (evidence: `python/ycm/youcompleteme.py`)
- Client utilities → Path utilities: uses (evidence: `python/ycm/base.py`)
- Client utilities → Vim API: uses (evidence: `python/ycm/base.py`)
