feat: add SystemVerilog/Verilog, Tcl, and VHDL language support - #1508
Open
3brahimi wants to merge 3 commits into
Open
feat: add SystemVerilog/Verilog, Tcl, and VHDL language support#15083brahimi wants to merge 3 commits into
3brahimi wants to merge 3 commits into
Conversation
Adds three new language extractors for HDL codebases, each backed by
a vendored tree-sitter WASM grammar:
- SystemVerilog / Verilog (.sv, .svh, .v)
Modules, interfaces, packages, classes, programs, checkers, UDP
declarations as class nodes; functions/tasks; typedef, struct/union,
enum names; net/data/parameter/port declarations as fields; module
instantiation call edges; package import and `include import edges.
Grammar: tree-sitter/tree-sitter-verilog (MIT), ABI 14.
- Tcl (.tcl)
Procedures and namespaces as functions/classes; set variable
assignments; source file.tcl as import edges; all other commands as
call edges.
Grammar: tree-sitter-grammars/tree-sitter-tcl (MIT), ABI 14.
- VHDL (.vhd, .vhdl)
Entities, architectures, packages, components as class nodes;
functions/procedures; records, enumerations, subtypes; signal/
variable/constant declarations; use clause imports; call edges.
Grammar: alemuller/tree-sitter-vhdl (MIT), ABI 14.
The three WASM files are vendored under src/extraction/wasm/ (same
pattern as existing vendored grammars for arkts, nix, terraform, etc.)
and added to VENDORED_WASM_LANGS. Attribution added to the WASM block
comment in grammars.ts. README Supported Languages table updated.
There was a problem hiding this comment.
Pull request overview
Adds new Tree-sitter (WASM) backed language support for HDL-oriented repositories (SystemVerilog/Verilog, VHDL) plus Tcl, wiring them into CodeGraph’s language detection and extractor registry and documenting the new coverage.
Changes:
- Added
verilog,tcl, andvhdlto the supported language IDs and to the extractor registry. - Vendored and registered three new WASM grammars and mapped common file extensions to the new languages.
- Added new per-language extractor configs and updated README “Supported Languages”.
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Adds new language IDs to the LANGUAGES list. |
| src/extraction/languages/vhdl.ts | New VHDL extractor configuration. |
| src/extraction/languages/verilog.ts | New SystemVerilog/Verilog extractor configuration. |
| src/extraction/languages/tcl.ts | New Tcl extractor configuration. |
| src/extraction/languages/index.ts | Registers new extractors in EXTRACTORS. |
| src/extraction/grammars.ts | Registers new WASM grammar files, extension mappings, and display names; adds vendored attribution notes. |
| README.md | Documents the newly supported languages and their extraction coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
3brahimi
commented
Aug 5, 2026
3brahimi
left a comment
Author
There was a problem hiding this comment.
The code is reviewed, fixes has been applied and is ready to merge.
The autofix commit (be6bfa1) correctly diagnosed two real bugs — importTypes: [] made extractImport dead code for 'source' detection (else-if dispatch never reaches it), and variableTypes: ['set'] silently skipped visiting a set statement's children, dropping call edges for command substitutions like set x [foo]. Both are properly fixed by the new visitNode hook. But the patch left the old extractImport method body orphaned after visitNode's closing brace with no wrapping method signature — 17 syntax errors, doesn't compile. Removed the dead lines; visitNode already covers everything they did. Verified: source now creates an import edge, and set result [helper foo] now creates a call edge to helper — both broken before this fix, both work now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three new language extractors for HDL codebases, each backed by a vendored tree-sitter WASM grammar:
SystemVerilog / Verilog (.sv, .svh, .v) Modules, interfaces, packages, classes, programs, checkers, UDP declarations as class nodes; functions/tasks; typedef, struct/union, enum names; net/data/parameter/port declarations as fields; module instantiation call edges; package import and `include import edges. Grammar: tree-sitter/tree-sitter-verilog (MIT), ABI 14.
Tcl (.tcl) Procedures and namespaces as functions/classes; set variable assignments; source file.tcl as import edges; all other commands as call edges. Grammar: tree-sitter-grammars/tree-sitter-tcl (MIT), ABI 14.
VHDL (.vhd, .vhdl) Entities, architectures, packages, components as class nodes; functions/procedures; records, enumerations, subtypes; signal/ variable/constant declarations; use clause imports; call edges. Grammar: alemuller/tree-sitter-vhdl (MIT), ABI 14.
The three WASM files are vendored under src/extraction/wasm/ (same pattern as existing vendored grammars for arkts, nix, terraform, etc.) and added to VENDORED_WASM_LANGS. Attribution added to the WASM block comment in grammars.ts. README Supported Languages table updated.