# feel-ix-343/markdown-oxide architecture

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

- Interactive diagram: https://gitdiagram.com/feel-ix-343/markdown-oxide
- Repository: https://github.com/feel-ix-343/markdown-oxide

## Overview

##### Main Components

a) Core Components:
- Language Server (Rust-based)
- VSCode Extension
- File System Interface
- Configuration Management

b) Sub-components:
- Completion Providers
- Parser System
- Vault Management
- Diagnostic System

**Client Layer (VSCode Extension)**
**↕️**
**Middle Layer (Language Server Protocol)**
**↕️**
**Bottom Layer (Core Rust Implementation)**

##### Specific Component Details

A. VSCode Extension Layer:
- Extension.ts client component
- Server.ts component
- Demonstrate the LSP communication channel

B. Language Server Core:
- Parser System (handling Markdown parsing)
- Vault Management (metadata.rs, parsing.rs)
- Feature Providers:
- Code Actions
- Code Lens
- Completion System
- Diagnostics
- Go to Definition
- Hover
- References
- Rename
- Symbol

C. Completion System (Detail View):
- Completers:
- Callout
- Footnote
- Link
- Tag
- Unindexed Block
- Matcher utility

##### Key Relationships to Highlight

- How the VSCode extension communicates with the Language Server
- Relationship between the vault management system and the file system
- Demonstrate how the completion system integrates with the main language server
- Configuration flow from .moxide.toml to the system

##### Implementation Details

- The Rust-based core implementation
- The TypeScript-based VSCode extension
- The LSP protocol as the communication layer
- File system watchers and handlers
- Configuration management system

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        VSC[VSCode Extension Client]:::client
        ServerTS[Language Server TypeScript]:::client
    end

    subgraph LSP[Language Server Protocol]
        Comm[LSP Communication Channel]:::lsp
    end

    subgraph Core[Core Rust Implementation]
        MainServer[Language Server Core]:::server
        Config[Configuration Management]:::server
        VaultMgr[Vault Management]:::server
        Parser[Parser System]:::server
        UI[UI Components]:::server
        Commands[Command System]:::server
        Daily[Daily Notes]:::server

        subgraph Features[Feature Providers]
            CodeAct[Code Actions]:::feature
            CodeLens[Code Lens]:::feature
            Diag[Diagnostics]:::feature
            GotoDef[Go to Definition]:::feature
            Hover[Hover]:::feature
            Refs[References]:::feature
            Rename[Rename]:::feature
            Symbol[Symbol]:::feature
        end

        subgraph Completion[Completion System]
            CompCore[Completion Core]:::completion
            CalloutComp[Callout Completer]:::completion
            FootnoteComp[Footnote Completer]:::completion
            LinkComp[Link Completer]:::completion
            TagComp[Tag Completer]:::completion
            UnindexedComp[Unindexed Block Completer]:::completion
        end

        Metadata[Metadata Management]:::server
    end

    FileSystem[(File System)]:::fs
    Config-.->.moxide.toml

    VSC --> Comm
    ServerTS --> Comm
    Comm --> MainServer
    MainServer --> Config
    MainServer --> VaultMgr
    MainServer --> Parser
    MainServer --> UI
    MainServer --> Commands
    MainServer --> Daily
    VaultMgr --> FileSystem
    VaultMgr --> Metadata
    Parser --> FileSystem

    MainServer --> Features
    MainServer --> Completion

    classDef client fill:#4a9eff,stroke:#333,stroke-width:2px
    classDef server fill:#50C878,stroke:#333,stroke-width:2px
    classDef feature fill:#FF6B6B,stroke:#333,stroke-width:2px
    classDef completion fill:#FFD700,stroke:#333,stroke-width:2px
    classDef fs fill:#FFA500,stroke:#333,stroke-width:2px
    classDef lsp fill:#DDA0DD,stroke:#333,stroke-width:2px

    click VSC "https://github.com/Feel-ix-343/markdown-oxide/blob/main/vscode-extension/client/src/extension.ts"
    click ServerTS "https://github.com/Feel-ix-343/markdown-oxide/blob/main/vscode-extension/server/src/server.ts"
    click MainServer "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/main.rs"
    click Config "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/config.rs"
    click VaultMgr "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/vault/mod.rs"
    click Parser "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/vault/parsing.rs"
    click UI "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/ui.rs"
    click Commands "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/commands.rs"
    click Daily "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/daily.rs"
    click CodeAct "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/codeactions.rs"
    click CodeLens "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/codelens.rs"
    click Diag "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/diagnostics.rs"
    click GotoDef "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/gotodef.rs"
    click Hover "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/hover.rs"
    click Refs "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/references.rs"
    click Rename "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/rename.rs"
    click Symbol "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/symbol.rs"
    click CompCore "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/completion/mod.rs"
    click CalloutComp "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/completion/callout_completer.rs"
    click FootnoteComp "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/completion/footnote_completer.rs"
    click LinkComp "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/completion/link_completer.rs"
    click TagComp "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/completion/tag_completer.rs"
    click UnindexedComp "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/completion/unindexed_block_completer.rs"
    click Metadata "https://github.com/Feel-ix-343/markdown-oxide/blob/main/src/vault/metadata.rs"
```
