Files
lucisv/editors/vscode
lucioandClaude Fable 5 e4b1f55c12
ci / checks (push) Failing after 8s
ci / corpus (push) Failing after 5s
Persistent index cache: a half-indexed workarea resumes where it stopped
Owner-requested round. Every parsed file's FileFacts record is written
through to an index-cache store (append per file, atomic compaction at
scan end — a crash loses at most the file in flight), keyed by a
content hash that is the whole key: no mtime fast path, by measured
argument (6 ms of a 181 ms warm scan, and unsound against save-time
write-through). On reopen, hits skip parsing and the resume is
visible — cached: vs indexing: log lines, the bar counting through
hits, and an end message saying how many came from cache. Warm rescan
322 to 179 ms release, 1.5 s to 0.76 s debug; 910 KB store for the
860-file corpus. Location: lucisv.index.cachePath > the extension's
context.storageUri via initializationOptions (the one extension.js
change) > the OS cache dir keyed by workspace identity > nowhere;
lucisv.index.persist (default on) gates both directions immediately.

The cache is a performance artifact, never a correctness input, and
after the fix round that promise is total against everything but
intentional forgery — which the threat model now formally excludes
(same-user disk; a keyed MAC would be theater): a per-record checksum
drops every corrupt-but-parseable line (poisoned and reforged shapes
both pinned so the checksum is never mistaken for a MAC), first-writer
initialization is a create_new claim with structural 100/100 survival,
and a torn multi-byte tail costs exactly the torn record (0 of 583
offsets lose more). Old-format stores discard wholesale. Load==fresh
fingerprint equality swept over the corpus.

45 tests added across the main and fix rounds (dev 33+2, QA 9+3, one
QA test-construction bug self-caught), 2 ignored probes.

docs/features/index-persistence/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-27 16:33:52 -07:00
..

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

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.10.2. 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, 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/<platform>-<arch>/. 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:

  • 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:

{
  "[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
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?”
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, otherwise the workspace folder, otherwise the open file's directory
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 Large rescans show an Indexing Verilog workspace progress bar and final file count
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

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.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.formatOnSave false Protocol save hook for editors without native format-on-save; keep off in VS Code
lucisv.serverPath bundled Explicit server override for advanced use; an unchanged setting uses the bundled server

A nearby lucisv.toml is the project source of truth and wins over editor style settings. Each file discovers configuration upward, so one workspace may contain projects with different formatting rules.

# lucisv.toml — every key is optional
line-length = 100
indent = 2
exclude = ["generated", "*_gen.sv"]
filelist = "rtl/files.f"

The configuration ladder is:

  1. The nearest lucisv.toml / .lucisv.toml discovered for the file.
  2. lucisv.lineLength and lucisv.indent editor settings.
  3. VS Code's tab size, for indentation only.
  4. Built-in defaults: 100 columns and 2 spaces.

lucisv.filelist is an explicit editor override for index scope. Open buffers are always layered over the chosen scope, even when a scratch file is not in the filelist.

Customize rainbow colors

Every nesting color is a proper VS Code theme color:

"workbench.colorCustomizations": {
  "lucisv.rainbow1": "#FFD700",
  "lucisv.rainbow2": "#DA70D6",
  "lucisv.rainbow3": "#179FFF",
  "lucisv.rainbow4": "#87D96B",
  "lucisv.rainbow5": "#FF8C69",
  "lucisv.rainbow6": "#4FD6D6",
  "lucisv.rainbowUnmatched": "#FF1212"
}

Release 0.10.2 highlights

Version 0.10.2 is the one-step installation release:

  • Five native platform packages embed both the language server and CLI, and an all package carries every platform's pair in one file.
  • Linux x64 and Arm64 packages are statically linked and work across distros.
  • Explicit lucisv.serverPath overrides still work, while clearing the value returns to the bundled server.
  • Release assets are focused on the installable .vsix packages and their checksums.

See the full release notes or the design documentation.

Troubleshooting

  • A .sv file has no lucisv features: check the language mode in VS Code's status bar. Another Verilog extension may have claimed the extension under a different language id; lucisv activates for verilog and systemverilog.
  • Inline templates do not appear: make sure both lucisv.inlineTemplates and editor.inlineSuggest.enabled are on.
  • The wrong server starts: clear a previously set lucisv.serverPath. Any explicit value intentionally wins over the bundled server.
  • Every hover and diagnostic appears twice: the pre-rename vfmt extension is still installed alongside lucisv and both attach a language server to the same files. Uninstall vfmt (lucisv is its successor) and reload the window.
  • Navigation finds the wrong project copy: point lucisv.filelist or the filelist key in lucisv.toml at the exact EDA filelist your build uses.
  • Need server logs: open View → Output and choose lucisv.

lucisv is MIT licensed. Source, issues, and design documentation live in the project repository.