# venomnbb/hdl-blockseal architecture

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

- Interactive diagram: https://gitdiagram.com/venomnbb/hdl-blockseal
- Repository: https://github.com/venomnbb/hdl-blockseal

## Overview

HDL BlockSeal is a local VS Code extension that completes HDL block syntax on Enter. The main workflow filters the document by language and settings, matches an opening line to a language-specific rule, checks for an existing closer, then edits the document with an indented cursor line and closing keyword. The source excerpt is partial, so the graph shows only supported runtime relationships; Verilog and SystemVerilog share the rule selection path.

Main entry points: [`extension.js`](https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js) (Enter handler), [`package.json`](https://github.com/venomnbb/hdl-blockseal/blob/main/package.json) (Enable settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_activation["Editor activation"]
  node_vscode["VS Code editor"]
  node_handler["Enter handler<br/>[extension.js]"]
end

subgraph group_matching["Language matching"]
  node_language["Language detection<br/>[extension.js]"]
  node_settings["Enable settings<br/>[package.json]"]
  node_rules["Verilog / SV rules<br/>[extension.js]"]
  node_vhdlrules["VHDL rules<br/>[extension.js]"]
  node_duplicates["Duplicate check<br/>[extension.js]"]
end

subgraph group_editing["Document editing"]
  node_indent["Indentation helpers<br/>[extension.js]"]
  node_document["HDL document"]
  node_edit["Editor edit<br/>[extension.js]"]
end

node_user(("HDL author"))

node_user -->|"presses Enter"| node_vscode
node_vscode -->|"dispatches change"| node_handler
node_handler -->|"identifies language"| node_language
node_handler -->|"reads settings"| node_settings
node_handler -->|"selects rules"| node_rules
node_handler -->|"selects rules"| node_vhdlrules
node_handler -->|"checks closer"| node_duplicates
node_duplicates -->|"scans lines"| node_document
node_handler -->|"gets indentation"| node_indent
node_handler -->|"reads trigger line"| node_document
node_handler -->|"requests edit"| node_edit
node_edit -->|"inserts lines"| node_document
node_vscode -->|"provides change event"| node_document

click node_handler "https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js"
click node_language "https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js"
click node_settings "https://github.com/venomnbb/hdl-blockseal/blob/main/package.json"
click node_rules "https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js"
click node_vhdlrules "https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js"
click node_duplicates "https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js"
click node_indent "https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js"
click node_edit "https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js"

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_vscode,node_handler toneBlue
class node_language,node_settings,node_rules,node_vhdlrules,node_duplicates toneAmber
class node_indent,node_document,node_edit toneMint
class node_user toneIndigo
```

## Components

### Editor activation

- **VS Code editor**
- [Enter handler](https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js): `extension.js`

### Language matching

- [Language detection](https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js): `extension.js`
- [Enable settings](https://github.com/venomnbb/hdl-blockseal/blob/main/package.json): `package.json`
- [Verilog / SV rules](https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js): `extension.js`
- [VHDL rules](https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js): `extension.js`
- [Duplicate check](https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js): `extension.js`

### Document editing

- [Indentation helpers](https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js): `extension.js`
- **HDL document**
- [Editor edit](https://github.com/venomnbb/hdl-blockseal/blob/main/extension.js): `extension.js`

### Other components

- **HDL author**

## Connections

- HDL author → VS Code editor: presses Enter
- VS Code editor → Enter handler: dispatches change
- Enter handler → Language detection: identifies language
- Enter handler → Enable settings: reads settings
- Enter handler → Verilog / SV rules: selects rules
- Enter handler → VHDL rules: selects rules
- Enter handler → Duplicate check: checks closer
- Duplicate check → HDL document: scans lines
- Enter handler → Indentation helpers: gets indentation
- Enter handler → HDL document: reads trigger line
- Enter handler → Editor edit: requests edit
- Editor edit → HDL document: inserts lines
- VS Code editor → HDL document: provides change event
