lucisv waveform icon

lucisv for VS Code

Fast, coherent Verilog and SystemVerilog tooling—from the first keystroke to a workspace-wide refactor.

Verilog 2001 SystemVerilog LSP 3.18 Rust powered MIT licensed

lucisv brings formatting, live diagnostics, syntax and semantic highlighting, code navigation, design hierarchy, snippets, completion, and safe refactoring to `.v`, `.vh`, `.sv`, and `.svh` files. The extension and its bundled language server are two halves of one toolchain, backed by the same Rust parser, formatter, linter, semantic model, and workspace index. ![lucisv feature map](https://git.luci.ooo/lucio/lucisv/raw/branch/master/editors/vscode/images/feature-map.png) ## Install Install **lucisv — Verilog/SystemVerilog** from the VS Code Extensions view, then open a Verilog or SystemVerilog file. There is no separate server or CLI setup. The current release is **0.56.0**. Its platform packages include both `lucisv-server` and the `lucisv` command-line tool: | Package target | Machines | |---|---| | `darwin-arm64` | Apple Silicon macOS | | `darwin-x64` | Intel macOS | | `linux-x64` | x64 Linux, statically linked | | `linux-arm64` | Arm64 Linux, statically linked | | `win32-x64` | x64 Windows | | `all` | All five of the above in one package, chosen when it starts | | *(no suffix)* | Universal fallback for any other platform — carries no binaries and runs `lucisv-server` from `PATH` | If you install directly from the [0.10.2 release](https://git.luci.ooo/lucio/lucisv/releases/tag/v0.10.2), choose the `.vsix` whose suffix matches your machine. VS Code normally chooses the matching Marketplace target automatically. Take the `all` package when the machine is not known in advance — a mixed fleet, one file on an internal mirror, or Alpine, which VS Code never offers a Linux package to even though the statically linked Linux binaries run there. It costs a larger download (about 13 MB against 3 MB) and nothing else. Inside a platform package the binaries sit at `bin/lucisv-server` and `bin/lucisv`; inside the `all` package they sit one level deeper, under `bin/-/`. Either way the extension finds them and makes them executable on first activation. ## Start using it Most features work as soon as a supported file opens: - Open the **lucisv** Activity Bar icon for an instance-oriented design tree. Every level starts collapsed; its fixed search field fuzzy-matches module and instance names in memory, and click or the instance context menu navigates. - Right-click the module you actually work on and choose **Star as DUT**. The pane splits into three collapsible sections — the DUT with its children, the DUT's parents (an upward tree through everything that instantiates it, which is usually the testbench), and every other module — including whatever the bench held beside the DUT, which that last section re-roots rather than hide. A second DUT adds two more sections. **Unstar DUT** from the same menu, or **Clear DUTs** from the pane's title bar, puts the plain tree back. - Hover a symbol, press `F12`, find references, search workspace symbols, or open the call/type hierarchy using VS Code's standard commands. - Type a module name at module-item scope to insert a complete instance. Inside its port list, signature help and inlay hints keep ordered connections clear. - Use the lightbulb for safe lint fixes and port refactors. Rename is workspace-aware and verifies its target before opening the rename box. - Type `if (`, `case (`, `begin`, `fork`, `generate`, or `module` at the end of a line to get structural ghost text. Press `Tab` to accept it; use `Alt+]` to cycle when several shapes fit. - Run **Format Document** or **Format Selection** through the standard VS Code commands. To format whenever VS Code saves a file: ```jsonc { "[verilog]": { "editor.formatOnSave": true }, "[systemverilog]": { "editor.formatOnSave": true } } ``` Leave `lucisv.formatOnSave` off in VS Code. That setting is the language server's protocol-level fallback for editors without native format-on-save; enabling both paths formats twice. ## Everything included ### Formatting and editing | Feature | What you get | |---|---| | Document formatting | Width-aware, deterministic formatting with inferred alignment for ports, connections, and parameter tables | | Range and multi-range formatting | Formats selected constructs while leaving the rest of the file byte-for-byte unchanged | | On-type formatting | Reindents after a newline and formats a completed statement after `;` when `editor.formatOnType` is enabled | | Format on save | Works through VS Code's native format-on-save flow; a separate LSP save hook is available for other editors | | Safe output | Token equivalence, comment preservation, convergence checks, and all-or-nothing fallback protect source code | | Format fences | `// verilog_format: off` / `on` preserves deliberately hand-formatted regions | | Inline templates | Context-sensitive ghost text completes blocks, cases, processes, generate regions, and modules | | Smart completion | Context-aware statement/declaration templates plus complete module-instantiation snippets from the workspace index | | Static snippets | Dialect-specific file-level templates for modules, interfaces, packages, classes, functions, tasks, FSMs, assertions, testbenches, guards, and generate loops | | Signature help | Names active ports or parameters in named and ordered instantiations | | Linked editing | Keeps opening and closing labels synchronized for modules, classes, functions, tasks, blocks, forks, and other named scopes | | Expand selection | Grows from token → statement → scope → item → file along syntax boundaries | ### Diagnostics and fixes | Feature | What you get | |---|---| | Live parse diagnostics | Error-tolerant parsing keeps useful feedback flowing while code is half typed | | Live lint diagnostics | The same lint registry as `lucisv check`, delivered through push or modern pull diagnostics | | Severity per rule | Every rule is `error`, `warning` or `style`, and the squiggle is painted red, yellow or blue to match | | Per-rule toggles | One setting per rule and one per severity class, all under `lucisv.lint.*`; changing any of them re-checks every open file immediately | | Safe quick fixes | One lightbulb action per safe lint fix, plus **Fix all lucisv auto-fixable problems** | | Waivers | `lucisv:` and Verible-compatible `verilog_lint:` line/range waivers are understood | | Scope feedback | An unmatched `begin`/`end` or `fork`/`join` is colored as an error until its pair exists | | Workspace diagnostics | Pull-capable clients can request diagnostics across open workspace buffers | ### Navigation and code understanding | Feature | What you get | |---|---| | Hover | Declaration kind and source snippet, macro bodies, and one-step macro argument expansion | | Go to definition | Local and cross-file symbols, macros, modules, packages, exported members, ports, and resolved `` `include`` targets | | Go to type definition | Values, handles, instances, interfaces, and aliases navigate to the declared type | | Find references | Local symbols stay local; indexed design units, package members, and ports resolve across files | | Document highlights | Highlights symbol occurrences or the matching opener/closer under the cursor | | Document and workspace symbols | Hierarchical outline plus indexed symbol search across the design | | Include links | Resolvable `` `include`` paths become clickable using local and filelist `+incdir+` search rules | | Folding | Modules, classes, blocks, regions, and multiline comments fold on syntax-aware boundaries | | Inlay hints | Adds port and parameter names to ordered instantiations without guessing at ambiguous sites | | Code lenses | Shows the workspace-wide instantiation count above every module/interface; click to jump to a site | | Call hierarchy | Incoming calls answer “who instantiates this?”; outgoing calls answer “what does this instantiate?” | | Design hierarchy sidebar | Alphabetical instance paths from every top-level module, collapsed until you open them, in-memory fuzzy module/instance search, exact instance/definition jumps, path copy, bookmark highlighting, and split-right opening | | DUT sections | Star a module as DUT and the pane splits into its own subtree, an upward tree of everything that instantiates it, and every module in neither — two sections per DUT plus one. Stars are remembered per workspace; `lucisv.hierarchy.duts` is the checked-in list a team shares | | Type hierarchy | Walks class `extends` relationships to supertypes and workspace subtypes | ### Highlighting and presentation | Feature | What you get | |---|---| | Semantic highlighting | Classifies declarations and uses by role; viewport and delta responses keep large files responsive | | TextMate highlighting | Covers keywords, comments, strings, literals, system tasks, directives, and macros before the server starts and inside previews/hover cards | | Rainbow scopes | Six theme-aware colors distinguish nested `begin`/`end` and `fork`/`join` pairs; unmatched scopes use a seventh error color | | Matching scopes | Putting the cursor on an opener highlights the exact matching closer | ### Refactoring | Feature | What you get | |---|---| | Rename | Verified local or cross-file symbol renames using the same resolution as navigation | | Add port | Adds a port to a module/interface and updates affected instantiations | | Remove port | Removes a declaration and matching connections across the workspace | | Propagate ports | Carries a port through module boundaries with one multi-file edit | | File/folder rename support | Rewrites every resolved `` `include`` affected by a move and warns instead of guessing when no safe spelling exists | | Undo-friendly edits | Workspace refactors are delivered as labelled edits so the editor can apply or reject them as one operation | ### Workspace intelligence | Feature | What you get | |---|---| | Project indexing | Indexes a configured EDA filelist when you have one; otherwise the folders your open files live in, widening as you work (`lucisv.index.scope`) — or every workspace folder with `"workspace"` | | Filelist support | Nested `-f`, `+incdir+`, `+define+`, comments, environment variables, and relative paths are understood | | Matching file discovery | Workspace walks honor `.gitignore`, supported file extensions, and `lucisv.toml`/editor excludes | | Open-buffer overlay | Unsaved files and edits immediately override disk content in navigation and analysis | | Incremental sync | Keystrokes send only changed ranges, not the full buffer | | File and folder watching | Create, change, rename, delete, and multi-root folder updates automatically refresh the index | | Index progress | Rescans show an **Indexing Verilog workspace** bar counting `n/total` through the files, with a per-file log in the output channel and a closing count of indexed, cached, and skipped files | | Responsive requests | Cancellation drops stale queued work; semantic token deltas and range responses minimize repeated data | | Live configuration | Project and editor configuration changes take effect without restarting the server | ![lucisv extension architecture](https://git.luci.ooo/lucio/lucisv/raw/branch/master/editors/vscode/images/architecture.png) ## Large workspaces Shipped in **0.11.0**. The [changelog](https://git.luci.ooo/lucio/lucisv/src/branch/master/editors/vscode/CHANGELOG.md) tracks the details under **Unreleased**. A workarea with tens of thousands of files used to pay for a full scan on every save. That is replaced by a chain of narrower answers: - **The scan follows your open files.** `lucisv.index.scope` defaults to `folder`: the index covers the folders your open buffers live in and everything under them, and opening a file elsewhere widens it. `scopeDepth` starts the climb one or more folders higher, so a file in `rtl/` can also index `include/` beside it. - **Generated netlists stay out of the scan.** `lucisv.index.maxFileSize` caps a walked file at 1 MiB by default — bigger is almost always machine output that costs minutes and answers nothing. A file you actually open is always indexed in full, whatever its size. - **The progress bar counts.** The **Indexing Verilog workspace** bar names the file it is on with a real `n/total` and a real percentage instead of an indeterminate spinner. - **The output channel says what happened.** With `lucisv.index.logFiles` on, every file is named as it is indexed, restored from cache, or skipped by the size cap, and the bar's closing message counts all three — `860 files indexed, 858 from cache, 2 skipped`. That is what answers "why is this symbol missing" and "why was that scan slow" without a debugger. - **A save costs one file.** Saving a file the index already holds replaces just that file's contribution, with no progress bar and no rescan — measured at ~45× faster than the whole rebuild it replaces (860-file workspace, debug build — release is faster still). Instantiation counts, call hierarchy and subtype lists became table lookups in the same change, so a code lens over a whole file is a fraction of a millisecond. - **The index survives a reopen.** `lucisv.index.persist` (on by default) writes what indexing each file found to a per-workspace store, keyed by that file's exact contents. Reopening the workspace — or reopening it after a crash halfway through the first scan — resumes from those records instead of parsing everything again; a stale or damaged record costs a re-parse and can never change an answer. `lucisv.index.cachePath` moves the store somewhere you choose, for example to share one between checkouts of the same tree. - **A 100 MB netlist opens instantly.** Above `lucisv.largeFile.threshold` (4 MiB) an opened file is line-counted and nothing else: never parsed, never analyzed, never indexed. What you keep is syntax coloring of the screenful you are looking at, painted a window at a time, plus go-to-definition and find-references within that one file by text scan. Everything else — diagnostics, formatting, symbols, folding, rename, hover, completion — answers nothing for such a file, and formatting says so rather than failing quietly. (VS Code never hands an extension a file over 50 MB at all, so in VS Code this path serves everything from the threshold up to that limit; the 100 MB case belongs to editors without that rule.) The honest trade: with the folder scope, cross-file answers are **scope relative**. A symbol in a folder the scope has not reached yet does not exist as far as the server is concerned, so go-to-definition, workspace symbol search, find references, the hierarchies and workspace rename all answer within the scope you have opened your way into. Point `lucisv.filelist` at your EDA filelist and the whole project is in scope from the first keystroke; set `"lucisv.index.scope": "workspace"` and the whole-workspace walk every release up to 0.10.2 did is back, unchanged. ## Snippet library Type a prefix and choose the snippet; `Tab` walks its placeholders. Static snippets work before the language server starts, while statement/block templates come from the server so they only appear where the construct is valid. | Verilog prefixes | Template | |---|---| | `module` | Module with ANSI ports | | `function`, `task` | Verilog-2001 declarations | | `genfor` | Generate loop with `genvar` and a named block | | `tb` | Testbench with clock, reset, display, and finish | | `guard` | Include guard derived from the file name | | SystemVerilog prefixes | Template | |---|---| | `module`, `modulep` | Module, optionally with parameters | | `uniquecase` | `unique case` with a default arm | | `fsm` | Two-process enum-based state machine | | `enum`, `struct` | Packed type declarations | | `function`, `task` | Automatic declarations | | `interface` | Interface with two modports | | `package`, `class` | File-named package or class with constructor | | `assertp` | Labelled concurrent assertion | | `genfor`, `tb`, `guard` | Generate loop, testbench, or include guard | Server-side templates add `if`, `if/else`, `else if`, `case`, `for`, `while`, `always_ff`, `always_comb`, `always @(...)`, `initial`, and common `logic`/`reg`/`wire`/`parameter` declarations at valid cursor positions. ## Settings | Setting | Default | Purpose | |---|---:|---| | `lucisv.rainbowBeginEnd` | `true` | Color nested block pairs and unmatched keywords; updates immediately | | `lucisv.inlineTemplates` | `true` | Show context-aware structural ghost text; requires `editor.inlineSuggest.enabled` | | `lucisv.inlineInstantiation` | `true` | Ghost the full instantiation (parameters and ports) once a module's name is typed exactly and followed by a space; requires `editor.inlineSuggest.enabled` | | `lucisv.lineLength` | unset | Maximum formatter width, 40–400; built-in default is 100 | | `lucisv.indent` | unset | Indent width, 1–8; falls back to the editor tab size, then 2 | | `lucisv.exclude` | `[]` | Extra index exclusions added to the project's own patterns | | `lucisv.filelist` | `""` | EDA `.f` filelist to index instead of walking the folder | | `lucisv.hierarchy.duts` | `[]` | Modules the Hierarchy pane treats as DUTs, by name — the checked-in list a team shares. Each one adds two sections ahead of "Other modules"; a DUT from this setting is shown locked and can only be removed here | | `lucisv.index.scope` | `folder` | Index the folders your open files live in, or every workspace folder with `workspace`; answers stay scope-relative until the scope reaches a folder | | `lucisv.index.scopeDepth` | `0` | How many folders above an open file the `folder` scope starts from; `1` lets a file in `rtl/` index `include/` beside it | | `lucisv.index.maxFileSize` | `1 MiB` | Largest walked file the index reads, in bytes; `0` removes the cap, and a file you open is always indexed in full | | `lucisv.index.logFiles` | `true` | Name every indexed, cached, and cap-skipped file in the lucisv output channel | | `lucisv.index.persist` | `true` | Remember what indexing each file found, so a reopen resumes instead of rescanning | | `lucisv.index.cachePath` | `""` | Where that store lives; empty means the extension's own per-workspace storage folder | | `lucisv.largeFile.threshold` | `4 MiB` | Size in bytes above which an opened file gets viewport-only highlighting and nothing else — no parsing, diagnostics, formatting, or indexing; `0` analyzes everything | | `lucisv.lint.severity.error` | `true` | Run the rules for code that would very likely not compile; off silences the whole class | | `lucisv.lint.severity.warning` | `true` | Run the rules for code that compiles and very likely does not mean what it says | | `lucisv.lint.severity.style` | `true` | Run the rules for code that is correct and reads badly | | `lucisv.lint.rules.` | `default` | One dropdown per rule — `default`, `on` or `off`. `default` is what the rule ships as, which the setting's own description names | | `lucisv.lint.select` | `[]` | Power-user spelling of `lucisv check --select`: run exactly these rules, replacing the default set. A severity word (`error`, `warning`, `style`) stands for its whole class | | `lucisv.lint.ignore` | `[]` | Power-user spelling of `--ignore`, and the off switch of last resort; takes a severity word too | | `lucisv.lint.options` | `{}` | Per-rule options, as `{ "": { "