# crutchcorn/ee-templating-language architecture

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

- Interactive diagram: https://gitdiagram.com/crutchcorn/ee-templating-language
- Repository: https://github.com/crutchcorn/ee-templating-language

## Overview

##### Main Components Identification
The project is a Language Server Protocol (LSP) based VSCode extension with three main packages:
- VSCode Extension Package
- Language Server
- Custom Compiler

##### Connection and Data Flow

**VSCode Extension**
- ↕ (LSP Protocol)
**Language Server**
- ↕ (Compilation Requests)
**Compiler Pipeline**

##### Important Details

a) File Processing Flow:
**.ee Files → VSCode Extension → Language Server → Compiler → JSON Output**

b) Compiler Pipeline Detail:
**Source → Root Lexer → Root Tokens → Root Parser → Output Transformer → Final Output**

##### Technical Details to Note
- The project uses pnpm workspaces
- TypeScript is used throughout
- VSCode extension API integration
- Language Server Protocol implementation

This architecture represents a typical language tooling project with IDE integration, making it important to show both the development-time components (like the debug configurations) and the runtime components (like the language server and compiler pipeline).

## Diagram (Mermaid)

```mermaid
flowchart TB
    title[VSCode Language Extension Architecture with Custom Compiler]
    
    subgraph IDE
        VSCode[VSCode Editor]
        SourceFiles[".ee Source Files"]:::input
        click SourceFiles "https://github.com/crutchcorn/ee-templating-language/tree/main/sample/"
    end

    subgraph Extension["VSCode Extension Package"]
        ExtMain["Extension Entry Point"]:::extension
        click ExtMain "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/vscode/src/extension.ts"
        SyntaxHL["Syntax Highlighting"]:::config
        click SyntaxHL "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/vscode/syntaxes/ee.tmLanguage.json"
        ExtConfig["Extension Configuration"]:::config
        click Extension "https://github.com/crutchcorn/ee-templating-language/tree/main/packages/vscode/"
    end

    subgraph LSP["Language Server"]
        ServerEntry["Server Entry Point"]:::server
        click ServerEntry "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/language-server/src/index.ts"
        LangPlugin["Language Plugin"]:::server
        click LangPlugin "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/language-server/src/languagePlugin.ts"
        ServerBin["Server Binary"]:::server
        click ServerBin "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/language-server/bin/ee-language-server.js"
    end

    subgraph Compiler["Compiler Pipeline"]
        Lexer["Root Lexer"]:::compiler
        click Lexer "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/compiler/src/root-lexer.ts"
        Parser["Root Parser"]:::compiler
        click Parser "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/compiler/src/root-parser.ts"
        Tokens["Root Tokens"]:::compiler
        click Tokens "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/compiler/src/root-tokens.ts"
        Transform["Output Transformer"]:::compiler
        click Transform "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/compiler/src/output-transformer.ts"
        CompilerEntry["Compiler Entry Point"]:::compiler
        click CompilerEntry "https://github.com/crutchcorn/ee-templating-language/blob/main/packages/compiler/src/index.ts"
    end

    subgraph Config["Development Configuration"]
        TSConfig["TypeScript Config"]:::config
        click TSConfig "https://github.com/crutchcorn/ee-templating-language/blob/main/tsconfig.base.json"
        WorkspaceConfig["Workspace Config"]:::config
        click WorkspaceConfig "https://github.com/crutchcorn/ee-templating-language/blob/main/pnpm-workspace.yaml"
    end

    %% Connections
    VSCode --> SourceFiles
    SourceFiles --> ExtMain
    ExtMain <--> ServerEntry
    ServerEntry --> LangPlugin
    LangPlugin --> CompilerEntry
    CompilerEntry --> Lexer
    Lexer --> Tokens
    Tokens --> Parser
    Parser --> Transform
    Transform --> Output["JSON Output"]:::output

    %% Styles
    classDef extension fill:#2196F3,stroke:#1565C0,color:white
    classDef server fill:#4CAF50,stroke:#388E3C,color:white
    classDef compiler fill:#FF9800,stroke:#F57C00,color:white
    classDef config fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef input fill:#673AB7,stroke:#512DA8,color:white
    classDef output fill:#795548,stroke:#5D4037,color:white

    %% Legend
    subgraph Legend
        L1["→ Data Flow"]
        L2["⟲ Development Loop"]
        L3["🔌 Extension Points"]
        L4["📝 Source Files"]
        L5["🔧 Configuration"]
    end
```
