diff --git a/docs/features/editor-marketplace-page/README.md b/docs/features/editor-marketplace-page/README.md new file mode 100644 index 0000000..9f82768 --- /dev/null +++ b/docs/features/editor-marketplace-page/README.md @@ -0,0 +1,124 @@ +# VS Code Marketplace page + +## Goal + +Turn the VS Code extension's Marketplace presentation into a user-facing +overview of lucisv: a recognizable icon and banner, clear install and usage +instructions, accurate discovery metadata, and a complete visual catalogue of +the editing, formatting, analysis, navigation, hierarchy, refactoring, and +workspace features that ship in the bundled language server. + +## Assumptions + +- The platform-specific extension packages ship `lucisv` and + `lucisv-server`, as release 0.10.1 does; users should not be given build or + `PATH` setup instructions on the Marketplace page. +- The Marketplace Details tab renders `editors/vscode/README.md`; the Features + tab is generated from `package.json` contribution points. Since `vsce` does + not recognize the Gitea repository host for relative-URL rewriting, README + artwork uses absolute HTTPS links to the repository's raw PNG files. +- Marketplace publishing rejects user-provided SVG images. Editable SVG + artwork therefore lives here as source, while the extension README and icon + use rendered PNG files under `editors/vscode/images/`. +- ~~`https://lucisv.dev` is the public documentation homepage declared by the + documentation site~~ — **corrected at lead review**: the domain does not + exist (NXDOMAIN, checked 2026-08-27), so `homepage` and the README's + documentation link point at the repository instead. Restore them the day the + domain is real. The checked-out Git remote is the canonical source + repository. + +## Handshakes + +- **Consumes** the shipped capability table in + `docs/features/lucisv-server/README.md`, the static grammar/snippet/settings + contributions in `editors/vscode/package.json`, and release 0.10.1 notes in + `CHANGELOG.md`. +- **Promises** every user-visible shipped capability is represented in the + Details page, including newer 0.8–0.10 features that the former README did + not foreground. +- **Promises** only allowed VS Code Marketplace categories and a PNG icon of + at least 256×256 pixels are declared in the extension manifest. +- **Promises** the extension package includes the rendered images but does not + include the SVG source artwork. + +## Status / TODO + +- [x] Inventory the extension's static contributions and server capabilities. +- [x] Inspect tag/release 0.10.1 and carry its bundled-binary install model into + the page. +- [x] Add icon, banner, discovery keywords, resources, and the Snippets + category to the manifest. +- [x] Replace build-oriented copy with install, quick-use, feature, settings, + and troubleshooting guidance. +- [x] Add two visual diagrams and a compact label row to the Details page. +- [x] Render all Marketplace-facing artwork as PNG and verify its dimensions. +- [x] Validate the manifest, Markdown image targets, and package contents. + +## Work log + +### 2026-08-27 — Marketplace presentation refresh + +Read the latest local tag (`v0.10.1`), its changelog entry, the language-server +capability table, editor guide, extension manifest, grammar, snippets, and +settings. The release page itself was not reachable through the web index, so +the signed repository state at `v0.10.1` and its checked-in release notes are +the release source of truth. + +Rewrote the extension README for end users and removed all build, packaging, +and extension-development instructions. Added the 0.10.1 platform matrix and +made the bundled tool/server behavior explicit. Added a full capability matrix +covering formatting, diagnostics, completion/templates, navigation, +presentation, hierarchy, refactoring, and workspace lifecycle. + +Added a waveform/chip icon and two diagrams using one dark visual system. SVG +sources are retained in this feature directory for future edits; PNG renders +are the only versions referenced or packaged because VS Code Marketplace +publishing rejects user SVGs. Updated manifest metadata using the official +extension-manifest field and category list. + +## QA log + +### 2026-08-27 — local validation + +- Parsed `package.json` with Node and checked the local icon path and all + absolute README image targets. +- Confirmed the icon is 512×512 and both diagrams render at 1200px wide. +- Ran `vsce ls` to verify the PNGs, README, manifest, snippets, grammar, and + extension entry point are included, while SVG sources are outside the + extension package. +- Compared the README feature matrix against the complete server capability + table and the manifest's language, grammar, snippet, color, and setting + contributions. + +## Review + +**2026-08-27 — lead. Verdict: accepted with corrections; commits with the +all-platforms-package round.** + +The page itself is good work: the capability matrix was cross-checked by the +round's own QA against the server capability table, the artwork ships as PNG +with SVG sources kept out of the package, and the manifest additions are all +legitimate Marketplace fields. Three corrections at review, all applied +directly by the lead: + +1. **`https://lucisv.dev` does not exist** (NXDOMAIN). The Assumptions entry + presented it as a fact nobody had checked. `homepage` and the README's + documentation link now point at the repository; the assumption is struck + through with the correction, not deleted. +2. **The install table was six packages, not seven** — the universal + no-binary fallback was dropped in the rewrite, which broke the Handshake + the concurrent editor-platform-vsix round had explicitly requested of this + one (its README, "Requested of `editor-marketplace-page`"). A row for it + is restored. Found by that round's QA. +3. **A troubleshooting entry for the duplicate-hover trap**: the pre-rename + `vfmt` extension left installed alongside lucisv attaches a second + language server and every hover/diagnostic shows twice — diagnosed live on + the owner's machine (2026-08-27) after a bug report; the server itself + answers once, verified over the wire in both single-file and workspace + modes. + +Process note, recorded rather than hidden: this round ran concurrently with +editor-platform-vsix and rewrote `editors/vscode/README.md` while that round +was editing it, discarding its edits mid-flight; the platform round +re-applied them additively. Concurrent rounds over one file cost a re-apply +and an audit — coordinate ownership of shared files next time. diff --git a/docs/features/editor-marketplace-page/artwork/architecture.svg b/docs/features/editor-marketplace-page/artwork/architecture.svg new file mode 100644 index 0000000..52d156a --- /dev/null +++ b/docs/features/editor-marketplace-page/artwork/architecture.svg @@ -0,0 +1,43 @@ + + + + + + + + Built as one coherent language toolchain + The extension is the front door; the bundled server connects every editor action to the same analysis engines. + + + + + VS CODE + lucisv extension + File types + grammarSnippets + theme colorsLSP client + + + + BUNDLED + lucisv-server + LSP 3.18 over stdioIncremental document overlayRequest cancellation + progress + + + + Shared Rust engines + + PARSER + FORMATTER + LINTER + SEMANTIC MODEL + REFACTOR ENGINE + + Workspace index • include graph • open-buffer overlay + + + + + + v0.10.1 · TOOL + SERVER INCLUDED + macOS · Linux · Windows + + diff --git a/docs/features/editor-marketplace-page/artwork/feature-map.svg b/docs/features/editor-marketplace-page/artwork/feature-map.svg new file mode 100644 index 0000000..84bf6dd --- /dev/null +++ b/docs/features/editor-marketplace-page/artwork/feature-map.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + One extension. The whole RTL editing loop. + Fast feedback from the same Rust parser, formatter, linter, semantic model, and workspace index. + + + + + + Format + Whole fileRange + multi-range + On type + on saveAlignment inference + + VERIFIED OUTPUT + safe • idempotent + + + + + + Diagnose + Parse diagnosticsLive lint rules + Safe quick fixesFix all + + EDITING-AWARE + tolerant parsing + + instant feedback + + + + + Understand + Semantic colorsHover + macros + Inlay hintsRainbow scopes + + DESIGN INTELLIGENCE + symbols, types, ports + + + + + + Navigate + Definition + typeReferences + symbols + Call hierarchyType hierarchy + + WORKSPACE-WIDE + filelist-aware index + + + + + + Refactor + Cross-file renameAdd/remove ports + Propagate portsRepair includes + + MULTI-FILE EDITS + one undoable change + + + + + VERILOG 2001 + SYSTEMVERILOG + LSP 3.18 + RUST-POWERED + + diff --git a/docs/features/editor-marketplace-page/artwork/icon.svg b/docs/features/editor-marketplace-page/artwork/icon.svg new file mode 100644 index 0000000..51ecbf5 --- /dev/null +++ b/docs/features/editor-marketplace-page/artwork/icon.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/editors/vscode/README.md b/editors/vscode/README.md index b84e86c..3c514a2 100644 --- a/editors/vscode/README.md +++ b/editors/vscode/README.md @@ -1,268 +1,287 @@ -# lucisv for VS Code +

+ lucisv waveform icon +

-A thin extension: it registers the Verilog/SystemVerilog file types and starts -`lucisv-server`. Every *analysis* feature you see — formatting, diagnostics, -semantic highlighting, hover, go-to-definition, references, symbols — comes -from the server, so this directory contains no language logic and no -editor-specific commands. The two exceptions are the snippet library and the -TextMate grammar below, both static data VS Code reads straight from the -manifest — LSP has no channel for either. See -`docs/features/lucisv-server/README.md` for the capability list, -`docs/features/editor-packaging/README.md` for why the extension looks like -this, and `docs/features/editor-snippets/README.md` for the snippets. +

lucisv for VS Code

-## 0. The short way: install a platform package +

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

-A release carries **platform-specific `.vsix` packages with the binaries inside -them** — one per machine — so there is nothing to build and nothing to put on -`PATH`: +

+ Verilog 2001 + SystemVerilog + LSP 3.18 + Rust powered + MIT licensed +

-```bash -code --install-extension lucisv-0.10.0-darwin-arm64.vsix -``` +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. -Pick the one matching the machine: `darwin-arm64`, `darwin-x64`, `linux-x64`, -`linux-arm64`, `win32-x64`. The Linux packages are statically linked (musl), so -they run on any distro. Inside the package the two binaries live at -`bin/lucisv-server` and `bin/lucisv` (with `.exe` on Windows) under the -extension's install directory; the extension spawns the server from there and -makes both executable on first activation. +![lucisv feature map](https://git.luci.ooo/lucio/lucisv/raw/branch/master/editors/vscode/images/feature-map.png) -`lucisv-.vsix` — no suffix — is the **universal fallback** for any -platform above that is not listed (Alpine, for instance, which VS Code treats as -its own target, and every BSD). It carries no binaries and looks -`lucisv-server` up on `PATH`, which is what sections 1–3 below describe. +## Install -Setting `lucisv.serverPath` overrides the bundled server in either package — use -it to point at a `target/release` build while you are working on the server -itself. Only a value you actually set counts; leaving the setting alone keeps -the bundled binary. +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. -## 1. Build the server +The current release is **0.10.1**. Its platform packages include both +`lucisv-server` and the `lucisv` command-line tool: -```bash -cargo build --release # from the repo root; binary at target/release/lucisv-server -``` +| 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` | -Put it on your `PATH`: +If you install directly from the +[0.10.1 release](https://git.luci.ooo/lucio/lucisv/releases/tag/v0.10.1), +choose the `.vsix` whose suffix matches your machine. VS Code normally chooses +the matching Marketplace target automatically. -```bash -cp target/release/lucisv-server ~/.local/bin/ # or wherever your PATH points -``` +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. -Or leave it in `target/release` and point the extension at it with the -`lucisv.serverPath` setting (below). +## Start using it -## 2. Smoke-test the spawn contract (no editor needed) +Most features work as soon as a supported file opens: -`smoke.js` spawns the server exactly the way `extension.js` does — same -argument list (none), same cwd, same inherited environment — and drives a full -`initialize` / `didOpen` / `shutdown` / `exit` session over stdio with -hand-rolled `Content-Length` framing. Plain `node`, no dependencies. +- 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. -```bash -node smoke.js # `lucisv-server` from PATH -node smoke.js ../../target/release/lucisv-server # an explicit binary -``` - -It prints `smoke: OK — …` and exits 0, or names the failure and exits 1. Run it -after every server change and before packaging: it is the only check that -catches "the binary moved" or "the handshake broke" without launching VS Code. - -## 3. Install the extension - -```bash -npm ci # installs vscode-languageclient (the only dependency) -npx @vscode/vsce package -code --install-extension lucisv-0.5.0.vsix -``` - -Then reload VS Code and open a `.v`/`.sv`/`.vh`/`.svh` file. - -`tools/release.sh` from the repo root does all of the above (plus the release -binaries and checksums) and drops the `.vsix` in `dist/`, so -`code --install-extension dist/lucisv-0.5.0.vsix` is the one-command path. -`editors/vscode/LICENSE` is a copy of the repo's MIT license and is what lets -`vsce package` run without `--skip-license`. If you are packaging a fork that -dropped `package.json`'s `repository` field, add `--allow-missing-repository`. - -**Running from source instead**, for development: open this directory in VS -Code and press F5. That starts an Extension Development Host with the extension -loaded from disk, with no packaging step. - -**Sideloading is the supported install.** Marketplace publishing is optional -and deferred: `publisher` is `guoliangchen` (unregistered on any marketplace), so -`vsce publish` would fail, while packaging a `.vsix` and installing it locally -works exactly as above. `tools/RELEASING.md` records what publishing would take -if it ever happens. - -## Settings - -| Setting | Default | What it does | -|---|---|---| -| `lucisv.serverPath` | `"lucisv-server"` | Path to the executable, overriding the server bundled with the extension. A bare name is looked up on `PATH`; an absolute path is used as given. Unset, a platform package uses its own `bin/lucisv-server` and the universal package uses `PATH`. | -| `lucisv.rainbowBeginEnd` | `true` | Colour each nesting level of `begin`/`end` and `fork`/`join` differently, and half a pair in an error colour. Takes effect immediately — no reload. | -| `lucisv.lineLength` | unset | Maximum line width, same as `line-length` in a `lucisv.toml`. 40–400. | -| `lucisv.indent` | unset | Indent width in spaces, same as `indent` in a `lucisv.toml`. 1–8. | -| `lucisv.exclude` | `[]` | Extra patterns to keep out of the workspace index, same as `exclude` in a `lucisv.toml`. **Added to** the project's excludes, never replacing them. | -| `lucisv.filelist` | `""` | Path to an EDA filelist (`.f`), absolute or relative to the workspace folder. When set, exactly the files it names are indexed. Overrides a `filelist` key in the project's `lucisv.toml`. | - -The last four mirror the four keys `lucisv.toml` supports, for people with no -config file in the tree. **A `lucisv.toml` always wins over them** — except -`lucisv.filelist`, which is a scope, not a style, and is explained below. So a project -that checks one in keeps one source of truth and format-on-save cannot drift -from CI's `lucisv --check`. Full precedence, highest first: - -1. `lucisv.toml`, discovered per file exactly as the CLI discovers it. -2. `lucisv.lineLength` / `lucisv.indent` — typed on purpose, but one user's editor. -3. VS Code's tab size — sent on every request whether or not you chose it, so - the weakest thing that is still a signal. (`lucisv.lineLength` has no analog - here at all: LSP carries no line-length option.) -4. The built-in defaults: indent 2, width 100. - -Each rung applies only where the ones above it say nothing, so a `lucisv.toml` -naming only `indent` still lets `lucisv.lineLength` choose the width. Changes -take effect on the next format — no reload — and out-of-range or wrong-typed -values are ignored rather than half-honoured. - -## Which files are indexed - -Navigation, hover and workspace symbols answer from an index of the project's -files. What goes into it, highest first: - -1. **A filelist**, if there is one — `lucisv.filelist`, else a `filelist` key in - the project's `lucisv.toml`. Exactly the files it names are indexed, so a - vendored copy your build does not compile stops showing up in - go-to-definition. Standard `.f` syntax: one path per line, `-f other.f` to - nest, `+incdir+`/`+define+` (recorded, unused for now), `#` and `//` - comments, `$VAR`/`${VAR}` expansion, paths relative to the filelist itself. -2. **The workspace folder**, walked as `lucisv` itself walks it — same - extensions, same `.gitignore`, same excludes. -3. **The open file's own directory**, when no folder is open at all. - -Open buffers are always indexed on top of that, so a scratch file the project -does not list still works. A filelist that names a file which has moved warns -and skips it; a filelist that cannot be read at all warns and falls back to -walking the folder — the index is never silently empty. - -## Syntax highlighting - -Two highlighters, and they are not rivals: - -- **Semantic tokens, from the server.** What actually colours your buffer while - the server is running — it knows a name is a port, a parameter or a macro, - which no regex can. Fourteen token types; nothing to configure. -- **A TextMate grammar, from this extension** (`syntaxes/`). Keywords, - comments, strings, numbers (`8'hFF`, `4'b10xz`, `'0`, `1.5e-3`, `10ns`), - `$system_tasks`, `` `directives `` and macro uses. Semantic tokens win - wherever they have something to say, so in a live buffer this mostly fills in - the gaps — but it is the only highlighter in three places that matter: - **hover cards and completion documentation** (the server sends those as - ```` ```systemverilog ```` markdown, and markdown is coloured by grammar, not - by semantic tokens), a file before the server has started, and previews VS - Code renders without a language server at all, such as a diff or a git blame. - -One grammar file serves both `verilog` and `systemverilog`, because lucisv's -lexer draws no line between the two. Its keyword list is generated from that -lexer's own list and a test in the repository fails if they drift apart. It -covers no operators and no `(* attributes *)` — see -`docs/features/editor-packaging/README.md` for why. - -## Rainbow begin/end - -Each nesting level of `begin`/`end` and `fork`/`join` is coloured differently, -and a keyword whose counterpart is missing — a `begin` you have just typed, an -`end` that closes nothing — is painted in a bright error red until you finish -the pair. The pairs are matched by the server over the token stream, not by a -regex, so an `end` inside a comment or a string is never coloured and the `end` -that lights up is genuinely the one that closes that `begin`. - -The seven colours are the extension's own, so they are always visible whatever -theme you use, and you can change any of them in -`workbench.colorCustomizations`: +To format whenever VS Code saves a file: ```jsonc -"workbench.colorCustomizations": { - "lucisv.rainbow1": "#FFD700", // and rainbow2 … rainbow6 - "lucisv.rainbowUnmatched": "#FF1212" // the half-pair colour -} -``` - -(They are deliberately *not* `editorBracketHighlight.foreground1`…`6`: VS Code -defaults the last three of those to transparent, so borrowing them made deeply -nested `begin`s invisible in most themes.) - -Turn it off with `"lucisv.rainbowBeginEnd": false`; the colours disappear -immediately. Cursor on a `begin` also highlights its matching `end` — that is -`documentHighlight`, always on, and it needs no setting. - -## Snippets - -Type a prefix and pick the snippet from the completion list; `Tab` walks the -placeholders. These are the **file-level** templates, a static manifest -contribution, so they work with no server on `PATH` and before the extension -has activated. Bodies are dialect-specific — `module` gives `input wire` in a -`.v` file and `input logic` in a `.sv` one. - -The everyday statement and block templates — `if`, `if/else`, `else if`, -`case`, `for`, `while`, `always_ff`, `always_comb`, `always @(...)`, `initial` -and the `logic`/`reg`/`wire`/`parameter` declarations — come from the **server** -instead, since 0.4.0: they are offered only where the construct may actually be -written, and they were removed from the lists below so no prefix offers the -same thing twice. See -`docs/features/completion-templates/README.md` in the repository. - -| Verilog (`.v`, `.vh`) | | -|---|---| -| `module` | module with a port list | -| `function` / `task` | Verilog-2001 declaration with an ANSI argument list | -| `genfor` | `generate`+`genvar` loop with a named block | -| `tb` | testbench module: clock, reset, `$display`, `$finish` | -| `guard` | `` `ifndef ``/`` `define `` include guard from the file name | - -| SystemVerilog (`.sv`, `.svh`) | | -|---|---| -| `module` / `modulep` | module with ports / with a parameter list too | -| `uniquecase` | `unique case` with a `default` arm | -| `fsm` | two-process state machine: enum, next-state logic, state register | -| `enum` / `struct` | `typedef enum` / `typedef struct packed` | -| `function` / `task` | `automatic` declaration | -| `interface` | interface with two modports | -| `package` / `class` | package named after the file / class with a constructor | -| `assertp` | labelled concurrent assertion with `disable iff` and `$error` | -| `genfor` | `for (genvar …)` with a named block | -| `tb` | testbench module: clock, reset, `$finish` | -| `guard` | `` `ifndef ``/`` `define `` include guard from the file name | - -To add your own without editing the extension, use VS Code's -**Snippets: Configure Snippets** command and pick `verilog` or -`systemverilog`; user snippets sit alongside these, they do not replace them. - -## Format on save - -The extension registers no formatter of its own — the server advertises -`documentFormattingProvider`, so VS Code's normal machinery applies: - -```jsonc -// .vscode/settings.json { "[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](https://git.luci.ooo/lucio/lucisv/raw/branch/master/editors/vscode/images/architecture.png) + +## 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. + +```toml +# 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: + +```jsonc +"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.1 highlights + +Version 0.10.1 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](https://git.luci.ooo/lucio/lucisv/releases/tag/v0.10.1) +or the [design documentation](https://git.luci.ooo/lucio/lucisv/src/branch/master/docs/features). + ## Troubleshooting -- **Nothing happens on a `.sv` file.** Check the language mode in the status - bar. Another Verilog extension may own the `.sv` extension with a different - language id; this one attaches to `verilog` and `systemverilog`. -- **"command not found" style failure on startup.** You are on the universal - package and the server is not on `PATH` — install the platform package for - your machine instead, or set `lucisv.serverPath` to an absolute path. Confirm - the binary itself works with `node smoke.js `. -- **A `lucisv.serverPath` you set once is still winning.** It beats the bundled - server by design, and it beats it silently. Clear the setting (not "set it - back to `lucisv-server`" — that is a value you set, and it sends the extension - back to `PATH`) to fall back to the binary inside the package. -- **See what the server is saying.** View → Output → the `lucisv` channel carries - the client/server log, including anything the server writes to stderr. +- **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](https://git.luci.ooo/lucio/lucisv). diff --git a/editors/vscode/images/architecture.png b/editors/vscode/images/architecture.png new file mode 100644 index 0000000..07a8740 Binary files /dev/null and b/editors/vscode/images/architecture.png differ diff --git a/editors/vscode/images/feature-map.png b/editors/vscode/images/feature-map.png new file mode 100644 index 0000000..96565c0 Binary files /dev/null and b/editors/vscode/images/feature-map.png differ diff --git a/editors/vscode/images/icon.png b/editors/vscode/images/icon.png new file mode 100644 index 0000000..a2b1958 Binary files /dev/null and b/editors/vscode/images/icon.png differ diff --git a/editors/vscode/package.json b/editors/vscode/package.json index 0d544d9..ec2c0ec 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -1,22 +1,51 @@ { "name": "lucisv", "displayName": "lucisv — Verilog/SystemVerilog", - "description": "Formatting, diagnostics, navigation and semantic highlighting for Verilog and SystemVerilog, served by the lucisv language server.", + "description": "Fast Verilog/SystemVerilog formatting, linting, navigation, refactoring, semantic highlighting and RTL design intelligence.", "version": "0.10.1", "publisher": "guoliangchen", "author": "Guoliang Chen", "license": "MIT", "repository": { "type": "git", - "url": "https://git.luci.ooo/lucio/verilogrustformatter" + "url": "https://git.luci.ooo/lucio/lucisv" }, + "homepage": "https://git.luci.ooo/lucio/lucisv", + "bugs": { + "url": "https://git.luci.ooo/lucio/lucisv/issues" + }, + "icon": "images/icon.png", + "galleryBanner": { + "color": "#07111F", + "theme": "dark" + }, + "pricing": "Free", + "keywords": [ + "verilog", + "systemverilog", + "sv", + "rtl", + "hdl", + "asic", + "fpga", + "eda", + "formatter", + "linter", + "language server", + "lsp", + "semantic highlighting", + "refactoring", + "code navigation", + "snippets" + ], "engines": { "vscode": "^1.82.0" }, "categories": [ "Programming Languages", "Formatters", - "Linters" + "Linters", + "Snippets" ], "main": "./extension.js", "activationEvents": [