How terostechnology/vscode-teroshdl works
VSCode Plugin Frontend
• Extension user interface that interacts with the user.
• Integration with webviews (e.g., dependencies viewer, documenter, schematic viewer, state machine viewer).
• That the plugin sends commands to and receives data from the backend modules.
Core Backend Modules (located under the “src” directory)
• Colibri Library: This module covers many sub-components such as commands, configuration management, documenters, formatters, linters, parsers, reporters, project manager, and others.
• TerosHDL Features: Under “src/teroshdl”, features like language provider, tree views, completions, configuration checkers, and integration with external tools (like ctags and LSP support) are implemented.
• Each of these can be shown as separate layered components that handle specific functionalities (e.g., formatting, linting, dependency/project management, parsing, and tool integration).
Auto Package and Code Generation
• The “auto_package” directory contains YAML and template files used for dynamic generation of configurations or project files.
External Tools Integration
• External simulation and synthesis tools (Raptor, Vivado, ModelSim, GHDL, Verilator, Icarus, etc.) that the toolbox supports.
• As external services or integrations where the backend modules (e.g., project manager and tool handlers) call these command-line tools.
Language Servers and Server-Side Tools
• In the “server” directory, the project includes a VHDL language server (“vhdl_ls”) provided in different builds (Windows, Linux, etc.). Indicate this as a dedicated service that supports “go to definition”, hover, and other language-related features.
• Connection from the VSCode plugin and/or the colibri backend to this language server to provide language features.
Configuration and Resource Management
• The “configs” directory contains system configuration files for File Types (Verilog, VHDL, SystemVerilog, TCL, etc.).
• That these components configure the behavior of different modules and are loaded at runtime by the core backend or the plugin.
Testing and Documentation
• Though separate, the “tests” directory (and “tests_impr”) shows that thorough testing is done for functionalities like parsing, formatting, project management, document generation, and tool integration.
Architectural Patterns and Design Principles:
• Modular Design: Each subdirectory and module (colibri, terosHDL features, server tools, auto_package) represents a loosely coupled component that communicates via well-defined interfaces.
• Separation of Concerns: The frontend VSCode extension interacts with the various backends (formatters, linters, documenters, language servers, auto generation) rather than implementing complex logic within the UI layer.
• Extensibility: The system uses configuration files and templates (YAML, .nj templates) that permit new tools or formats to be easily added.
• Use clearly labeled nodes for each major module (Frontend, Colibri core, TerosHDL features, Auto Package, External Tools, Server/Language Server, Configs/Resources).
– Between the VSCode plugin and the backend services (for example, how user actions trigger commands that go to the formatter, linter, and documenter).
– From backend modules to external HDL tools and simulators.
• Use annotations or callouts to indicate specific technologies:
– Note that the project uses Node.js (npm, jest tests), has integrated GitHub actions for CI/CD, and contains configurations and assets typical of VSCode extensions.