# creativenull/vim-lspclient architecture

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

- Interactive diagram: https://gitdiagram.com/creativenull/vim-lspclient
- Repository: https://github.com/creativenull/vim-lspclient

## Overview

##### Component Relationships

**Plugin Interface Layer**
- ↓
**Core Layer ←→ LSP Server**
- ↓
**Features Layer**
- ↓
**Vim Integration Layer**

##### Detailed Component Breakdown

For each major feature category, show the specific implementations:

Language Features:
- Code Lens
- Document Highlights
- Document Symbols
- Formatting
- Goto (Declaration/Definition/Implementation)
- Hover
- Diagnostics
- References

Workspace Features:
- Configuration
- Execute Command
- Workspace Folders
- Workspace Symbols
- Apply Edit

Window Features:
- Messages
- Work Done Progress

##### Technical Details

Annotations for:
- Required Vim version (8.2.4758+)
- Required Vim features (+channel, +job, +timers, +popupwin)
- LSP Protocol version support (v3.17)

##### Implementation Notes

- vim9script implementation
- Built-in Vim LSP channel mode usage
- Dynamic registration capabilities
- Document lifecycle management

- Portability (built-in Vim features usage)
- Efficiency (information display)
- Aesthetics (UI components)
- Performance considerations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Plugin Interface"
        EP["Entry Point"]
        MA["Main Autoload"]
    end
    
    subgraph "Core Layer"
        CM["Client Management"]:::core
        PH["Protocol Handler"]:::core
        DM["Document Manager"]:::core
        TD["Type Definitions"]:::core
        CAP["Capabilities Manager"]:::core
    end
    
    subgraph "Features Layer"
        subgraph "Language Features"
            CL["Code Lens"]:::feature
            DH["Document Highlights"]:::feature
            DS["Document Symbols"]:::feature
            FMT["Formatting"]:::feature
            GOTO["Goto Features"]:::feature
            HVR["Hover"]:::feature
            DIAG["Diagnostics"]:::feature
            REF["References"]:::feature
        end
        
        subgraph "Workspace Features"
            CONF["Configuration"]:::feature
            EXEC["Execute Command"]:::feature
            WF["Workspace Folders"]:::feature
            WS["Workspace Symbols"]:::feature
            AE["Apply Edit"]:::feature
        end
        
        subgraph "Window Features"
            MSG["Messages"]:::feature
            WDP["Work Done Progress"]:::feature
        end
    end
    
    subgraph "Vim Integration"
        HC["Health Checking"]:::vim
        POP["UI Popup"]:::vim
        SIGN["UI Signs"]:::vim
        TP["Text Properties"]:::vim
        COL["Color Management"]:::vim
    end
    
    subgraph "Utilities"
        FS["File System"]:::util
        LOG["Logger"]:::util
        RT["Router"]:::util
        CFG["Config"]:::util
    end
    
    LSP[("LSP Server")]:::external
    
    %% Relationships
    EP --> MA
    MA --> CM
    CM <--> LSP
    CM --> PH
    PH --> DM
    PH --> TD
    PH --> CAP
    
    CM --> CL & DH & DS & FMT & GOTO & HVR & DIAG & REF
    CM --> CONF & EXEC & WF & WS & AE
    CM --> MSG & WDP
    
    CL & DH & DS & FMT & GOTO & HVR & DIAG & REF --> POP
    MSG & WDP --> POP
    
    DIAG --> SIGN
    HVR --> TP
    
    %% Click events
    click EP "https://github.com/creativenull/vim-lspclient/blob/main/plugin/lspclient.vim"
    click MA "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient.vim"
    click CM "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/core/client.vim"
    click PH "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/core/protocol.vim"
    click DM "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/core/document.vim"
    click TD "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/core/types.vim"
    click CAP "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/core/capabilities.vim"
    click CL "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/language/code_lens.vim"
    click DH "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/language/document_highlight.vim"
    click DS "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/language/document_symbols.vim"
    click FMT "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/language/formatting.vim"
    click GOTO "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/language/common/goto.vim"
    click HVR "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/language/hover.vim"
    click DIAG "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/language/publish_diagnostics.vim"
    click REF "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/language/references.vim"
    click CONF "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/workspace/configuration.vim"
    click EXEC "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/workspace/execute_command.vim"
    click WF "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/workspace/workspace_folders.vim"
    click WS "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/workspace/workspace_symbols.vim"
    click AE "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/workspace/apply_edit.vim"
    click MSG "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/window/message.vim"
    click WDP "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/features/window/work_done.vim"
    click HC "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/vim/checkhealth.vim"
    click POP "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/vim/popup.vim"
    click SIGN "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/vim/sign.vim"
    click TP "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/vim/textprop.vim"
    click COL "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/vim/colors.vim"
    click FS "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/fs.vim"
    click LOG "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/logger.vim"
    click RT "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/router.vim"
    click CFG "https://github.com/creativenull/vim-lspclient/blob/main/autoload/lspclient/config.vim"
    
    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef feature fill:#4CAF50,stroke:#2E7D32,color:white
    classDef vim fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef external fill:#FF9800,stroke:#EF6C00,color:white
    classDef util fill:#9E9E9E,stroke:#616161,color:white
    
    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Feature Components]:::feature
        L3[Vim Integration]:::vim
        L4[External Services]:::external
        L5[Utilities]:::util
    end
```
