VS Code's built-in default colour provider (editor.defaultColorDecorators, default auto since 1.78) pattern-matches CSS-style hex in languages where no extension provides document colours - so delay controls like #200 grew RGB swatches. The extension now ships the language-scoped configuration default "never" for [verilog] and [systemverilog]; user-overridable, invisible to every other language. Diagnosis verified on the reporting machine: no colour-provider extension installed, no server capability, no user override. Co-Authored-By: Claude Fable 5 <[email protected]>
308 lines
18 KiB
Markdown
308 lines
18 KiB
Markdown
# Changelog
|
||
|
||
All notable changes to vfmt are recorded here. Versions follow
|
||
[semantic versioning](https://semver.org/); until 1.0 the CLI's exit codes
|
||
(see `README.md`) are the only frozen contract.
|
||
|
||
## 0.4.2 — 2026-08-24
|
||
|
||
`#200` is a **delay, not a colour**. VS Code 1.78+ ships a built-in
|
||
"default colour decorators" provider (`editor.defaultColorDecorators`,
|
||
default `auto`): in a language where no extension provides document
|
||
colours, the editor itself pattern-matches CSS-style hex — so a delay
|
||
control like `#200` or `#1ff` grew an RGB swatch. The extension now sets
|
||
the language-scoped default `"editor.defaultColorDecorators": "never"`
|
||
for `[verilog]` and `[systemverilog]`. It is a *default*, not a lock: a
|
||
user who wants swatches back can override it per language in their own
|
||
settings. Nothing else changed.
|
||
|
||
## 0.4.1 — 2026-08-24
|
||
|
||
Hover cards are **syntax highlighted**. The server has always sent its
|
||
declaration snippets and `` `define`` expansions as fenced
|
||
```` ```systemverilog ```` blocks, but VS Code colours a fenced block with the
|
||
**TextMate grammar** registered for that language id, and the extension
|
||
deliberately shipped none — semantic tokens colour the buffer, and they cannot
|
||
reach markdown. So every hover card, and every completion template's
|
||
documentation panel, rendered as flat grey text. The extension now contributes
|
||
one compact grammar, registered for both `verilog` and `systemverilog`:
|
||
comments, strings, based and real literals (`8'hFF`, `4'b10xz`, `'0`, `1.5e-3`,
|
||
`10ns`), system tasks (`$display`), compiler directives and macro uses
|
||
(`` `define``, `` `WIDTH``), and the keywords — all 181 of them, generated from
|
||
the lexer's own list, with a test that fails the build if the two ever drift
|
||
apart. Operators and `(* attributes *)` are deliberately left out; the reasons
|
||
are in
|
||
[editor-packaging](docs/features/editor-packaging/README.md).
|
||
|
||
The side benefit is a buffer that has colour before the server starts, in a
|
||
file the server is not indexing, and in a diff or a git preview where no
|
||
language server runs at all. Where the server *is* running its semantic tokens
|
||
still win, as they always did: the grammar only fills in what nothing better
|
||
has coloured.
|
||
|
||
## 0.4.0 — 2026-08-24
|
||
|
||
Completion now offers **templates**, not just words. Typing `if` inside an
|
||
`always` block offers `if begin/end` above the bare keyword, and accepting it
|
||
writes `if (cond) begin` / body / `end` at the line's own indentation with the
|
||
condition selected and TAB moving into the body; `if/else`, `else if`, `case`
|
||
and `casez` with a `default` arm, `for`, `while`, `always_ff` (with and without
|
||
an async reset), `always_comb`, `always @(...)`, `initial` and the everyday
|
||
declarations (`logic`, `reg`/`wire`, `localparam`, `parameter`) are all there
|
||
too. Every template is **gated by position** — a statement is only offered
|
||
where a statement may be written, an `always` block only at module-item
|
||
position, a declaration at both — and **by dialect**: a `.sv` file is offered
|
||
`logic` and `always_ff`, a `.v` file `reg`/`wire` and `always @(posedge clk)`,
|
||
so nothing on the list is code the buffer's own compiler would reject. A client
|
||
that does not understand snippets gets the same skeleton with its defaults
|
||
filled in rather than a buffer full of `${1:…}`. Every template's untouched
|
||
expansion is parsed by vfmt's own parser in the test suite, which is what keeps
|
||
the list honest. Details:
|
||
[completion-templates](docs/features/completion-templates/README.md).
|
||
|
||
Because these come from the server, both editors get them, and the VS Code
|
||
extension's own static snippets shed the nine that would otherwise have been
|
||
offered twice (`always_ff`, `always_comb`, `case` and `initial` from the
|
||
SystemVerilog file; `always`, `alwayscomb`, `case`, `for` and `initial` from
|
||
the Verilog one). The file-level templates it is actually good at —
|
||
`module`, `tb`, `fsm`, `interface`, `function`, `task`, `genfor`, `guard` and
|
||
the rest — stay exactly where they were, and still work with no server running.
|
||
Details: [editor-snippets](docs/features/editor-snippets/README.md).
|
||
|
||
## 0.3.1 — 2026-08-24
|
||
|
||
A fix for the `begin`/`end` rainbow, which could make the keywords it was
|
||
supposed to colour **invisible**. The extension painted each nesting level with
|
||
`editorBracketHighlight.foreground1..6`, VS Code's own bracket colours — but
|
||
only the first three of those have a visible default: `foreground4`, `5` and
|
||
`6` default to fully transparent and are left for themes to define, which most
|
||
themes never do. Any `begin`/`end` at nesting depth 3, 4 or 5 was therefore
|
||
painted transparent, and the keyword vanished from the screen. The rainbow now
|
||
uses its own colours, `vfmt.rainbow1` … `vfmt.rainbow6`, contributed by the
|
||
extension with an opaque default for dark, light and both high-contrast themes;
|
||
they appear under Workbench → Appearance → Color Customizations like any other
|
||
theme colour, so a theme or a `workbench.colorCustomizations` entry can still
|
||
override them. Levels 1–3 keep VS Code's familiar bracket hues so nothing
|
||
changes for the depths that already worked.
|
||
|
||
The same round makes the other half of the story visible: `vfmt/scopePairs` now
|
||
also reports **unmatched** block delimiters — a `begin` whose `end` never
|
||
arrived, an `end` that closes nothing — and the extension paints them in a
|
||
bright error red (`vfmt.rainbowUnmatched`) instead of leaving them as ordinary
|
||
uncoloured text. Typing a fresh `begin` now shows red until its `end` exists,
|
||
rather than showing nothing at all. Matched pairs, their nesting depths and the
|
||
missing-`end` warnings are unchanged. Details:
|
||
[editor-scopes](docs/features/editor-scopes/README.md).
|
||
|
||
## 0.3.0 — 2026-08-24
|
||
|
||
The refactoring release. `0.2.0` shipped a formatter, a linter and a language
|
||
server that could *read* a project; this one can change it — rename across
|
||
files, add and remove module ports everywhere they are connected, generate an
|
||
instantiation from the module's own declaration — and can finally complete what
|
||
you are typing.
|
||
|
||
### Project scope: filelists
|
||
|
||
vfmt now accepts a standard EDA **filelist** (`-f` style: one path per line,
|
||
nested `-f`, `+incdir+`/`+define+`, `#` and `//` comments, `$VAR`/`${VAR}`
|
||
expansion, unknown `+args`/`-flags` skipped with a warning). When one is
|
||
configured — `vfmt.filelist` in the editor, or a `filelist` key in `vfmt.toml`
|
||
— it defines *exactly* the set of files the language server indexes, which is
|
||
what a project with a build already says out loud. Without one the scope ladder
|
||
falls back to the workspace-folder walk, and, when no folder was opened at all,
|
||
to the directory the open file sits in. A filelist that cannot be read falls
|
||
back with a warning rather than leaving the editor silently empty. Details:
|
||
[filelist](docs/features/filelist/README.md).
|
||
|
||
### Rename
|
||
|
||
`textDocument/rename` and `prepareRename` across every symbol the semantic
|
||
layer resolves — nets and variables, ports, parameters and localparams,
|
||
genvars, typedefs, enum members, struct fields, functions and tasks, modules,
|
||
instances, packages and class members — and **across files**, so a module rename
|
||
reaches every instantiation and a package member reaches every import site.
|
||
Every edit comes from a resolved reference span; there is no textual
|
||
search-and-replace anywhere in it. The rename refuses rather than guesses: on a
|
||
collision with an existing name in any affected scope, on an invalid
|
||
identifier, and whenever any touched file would no longer parse — whole-edit-
|
||
or-nothing, the same contract the formatter has always had. Occurrences inside
|
||
a `` `define`` body or an `` `ifdef``-excluded arm are reported as a warning and
|
||
left alone, because vfmt does not preprocess. Details:
|
||
[rename](docs/features/refactor-rename/README.md).
|
||
|
||
### Module signature changes
|
||
|
||
Three code actions (and the matching `workspace/executeCommand` entry points,
|
||
for editors without a lightbulb): **add a port** to a module, which updates the
|
||
declaration — ANSI or non-ANSI — and gives every instantiation a named
|
||
connection, bound to a same-named signal when one is in scope; **remove a
|
||
port**, which drops it from the declaration and from every instantiation,
|
||
turning an ordered connection into an explicit empty position and refusing when
|
||
the connected expression has side effects worth preserving; and **propagate
|
||
ports**, which diffs a module against each of its instantiations and adds the
|
||
missing named connections. Every touched file is re-parsed before the edit is
|
||
offered. Details: [ports](docs/features/refactor-ports/README.md).
|
||
|
||
### Module hinting and signature help
|
||
|
||
Typing a module name at item position now completes to the whole
|
||
instantiation, generated from the definition the workspace index found:
|
||
parameter overrides carrying their declared defaults, every port as a named
|
||
connection, the ports with a same-named signal in scope already bound and the
|
||
rest left as snippet tabstops to tab through. A client that does not advertise
|
||
`snippetSupport` gets the same text with every hole filled in and no `${}`
|
||
anywhere, and a plan containing an escaped identifier is always plain text —
|
||
`$`, `}` and `\` are legal inside one and are the snippet grammar's own
|
||
punctuation. Inside a connection or parameter list, `textDocument/signatureHelp`
|
||
names the ports with their directions and types and highlights the one under
|
||
the cursor. Details:
|
||
[module hinting](docs/features/refactor-instantiate/README.md).
|
||
|
||
### Completion
|
||
|
||
The completion list is no longer only about instantiations. One response now
|
||
carries, in this order: the module skeleton where one belongs, the declarations
|
||
the scope chain at the cursor binds (with their real kinds and the line they
|
||
were declared on), what the project declares — packages, package members,
|
||
typedefs, classes, modules and `` `define`` names — every reserved word the
|
||
lexer knows, and finally every identifier used anywhere in the project, the
|
||
word-completion tier editors have trained everyone to expect. A name appears
|
||
once, offered by the best tier that has it. Nothing is offered while the cursor
|
||
is inside a comment or a string, and a name that appears *only* inside one is
|
||
never a candidate: the word list is harvested from the token stream, where
|
||
comments are trivia and a string is a single token. Scope is the filelist
|
||
ladder's, so a file the project does not build contributes nothing. The tables
|
||
are built with the workspace index rather than per keystroke — 860 real-world
|
||
files answer a request in about 300 µs. Details:
|
||
[completion](docs/features/completion-core/README.md).
|
||
|
||
### Editors
|
||
|
||
One new setting, `vfmt.filelist`, forwarded like the rest of `vfmt.*`.
|
||
Everything else in this release arrives through the server, so no editor
|
||
configuration changes.
|
||
|
||
## 0.2.0 — 2026-08-19
|
||
|
||
The first released version. `0.1.0` was the workspace's initial version number
|
||
and was never tagged or published, so these notes describe vfmt as it stands
|
||
rather than a delta against a shipped predecessor.
|
||
|
||
vfmt is a formatter, a linter and a language server for Verilog-2001 and the
|
||
synthesizable SystemVerilog subset — one parser and one style engine behind a
|
||
CLI (`vfmt`) and an LSP binary (`vfmt-server`).
|
||
|
||
### Formatter and the safety net
|
||
|
||
Formatting is Wadler/prettier-style: every breakable construct is a group that
|
||
stays on one line if it fits within the line limit and otherwise breaks
|
||
one element per line, over the full statement, expression, declaration,
|
||
instantiation, generate, function/task and `typedef` grammar. Defaults follow
|
||
Verible — 2-space indent, 100-column lines. Comments are attached as leading
|
||
and trailing trivia and are never dropped. **Every format is verified at
|
||
runtime**: the output is re-lexed and its token stream (comments included)
|
||
compared against the input, then formatted a second time and checked for a
|
||
fixed point; if either check fails the output is discarded and the file is
|
||
left byte-for-byte untouched. `// verilog_format: off` / `// vfmt: off` fences
|
||
return the enclosed items as their exact source bytes, indentation included.
|
||
Deep nesting is a normal parse error with a position rather than a stack
|
||
overflow. Details: [formatter](docs/features/formatter-bug-fixes/README.md),
|
||
[safety net](docs/features/safety-net/README.md),
|
||
[fences](docs/features/format-fences/README.md),
|
||
[comment attachment](docs/features/comments-round/README.md) and
|
||
[round 2](docs/features/comments-round-2/README.md),
|
||
[case tables](docs/features/case-tables/README.md),
|
||
[spans](docs/features/spans/README.md),
|
||
[recursion limit](docs/features/recursion-limit/README.md).
|
||
|
||
### Command line
|
||
|
||
`vfmt <paths>` formats files and directories in place. `--check` and `--diff`
|
||
are the CI modes (exit 1 if anything would change, nothing written); `-` reads
|
||
stdin, with `--stdin-filename` naming the buffer. Directory walks honor
|
||
`.gitignore` (a documented subset) and repeatable `--exclude` patterns, and run
|
||
on all cores — `--threads N` pins the worker count without changing a single
|
||
output byte, since results are collected in input order. Settings live in a
|
||
`vfmt.toml` / `.vfmt.toml` discovered upward from each input, ruff-style, with
|
||
CLI flags taking precedence per setting; an unknown key or a bad value is a
|
||
hard error naming the file and line. The exit-code contract (0 / 1 / 2) is
|
||
frozen and documented. A panic on one file cannot take down the run. Details:
|
||
[CLI](docs/features/cli-polish/README.md),
|
||
[config discovery](docs/features/config-discovery/README.md),
|
||
[parallel walk](docs/features/parallel-files/README.md).
|
||
|
||
### Linter
|
||
|
||
`vfmt check` is a ruff-shaped linter over the same files, the same walk and the
|
||
same config discovery as the formatter: a rule registry, `--select` / `--ignore`,
|
||
`--output-format json`, and fixes classified safe or unsafe with `--fix`
|
||
applying only the safe ones. Eight syntactic rules ship — `no-tabs`,
|
||
`no-trailing-whitespace`, `case-missing-default`, `always-ff-non-blocking`,
|
||
`always-comb-blocking`, `explicit-parameter-storage-type`, `module-filename`
|
||
and `unused-waiver`. Inline waivers use Verible's spelling
|
||
(`// vfmt: waive <rule>`, `waive-start` / `waive-stop`, with `verilog_lint:`
|
||
accepted as an alias), so code already annotated for Verible lints unedited.
|
||
`check` runs on the error-tolerant parser, so a file the formatter refuses is
|
||
still linted for what can be read. Violations inside a format fence are
|
||
reported but never auto-fixed, by the same shared computation the formatter
|
||
uses. Details: [linter](docs/features/linter-core/README.md),
|
||
[shared fence filter](docs/features/shared-fence-filter/README.md),
|
||
[error recovery](docs/features/error-recovery/README.md).
|
||
|
||
### Language server
|
||
|
||
`vfmt-server` speaks LSP over stdio from a single binary and serves every
|
||
editor the same answers: `textDocument/formatting` (honoring the file's own
|
||
`vfmt.toml`, which wins over the editor's tab size), parse **errors** and lint
|
||
**warnings** in one diagnostic publish per change, `codeAction` quick fixes
|
||
plus `source.fixAll.vfmt` for fix-on-save, `semanticTokens/full`, hover
|
||
(declaration snippets and `` `define`` expansion, in-file and across the
|
||
workspace), go-to-definition, in-file references, and document and workspace
|
||
symbols. Underneath it are a single-file semantic model (scopes, symbols,
|
||
references) and a workspace index that resolves names arriving through package
|
||
imports and module instantiations across files. Not yet advertised, and said so
|
||
out loud: range formatting, cross-file references, completion, rename and
|
||
signature help. Details: [server](docs/features/vfmt-server/README.md),
|
||
[lint wiring](docs/features/server-lint/README.md),
|
||
[semantic model](docs/features/vlog-semantic/README.md),
|
||
[workspace index](docs/features/workspace-index/README.md),
|
||
[define table](docs/features/define-table/README.md),
|
||
[name spans](docs/features/name-spans/README.md),
|
||
[shared core](docs/features/vfmt-core-lift/README.md).
|
||
|
||
### Editors
|
||
|
||
A thin VS Code extension in `editors/vscode/` registers the file types
|
||
(`.v`/`.vh` → `verilog`, `.sv`/`.svh` → `systemverilog`) and starts the server;
|
||
it has one setting, `vfmt.serverPath`, and no language logic of its own —
|
||
everything a user sees comes from the server. Install it by building the
|
||
`.vsix` and sideloading it (`tools/release.sh`, then
|
||
`code --install-extension`); publishing to a marketplace is optional and
|
||
deferred. `editors/nvim/README.md` documents the equivalent Neovim 0.11+,
|
||
`nvim-lspconfig`, Vim 9 `vim-lsp` and coc.nvim configuration — no plugin
|
||
needed. `editors/vscode/smoke.js` is a zero-dependency check that spawns the
|
||
server exactly as the extension does and drives a full LSP session, so a
|
||
failure can be pinned on the binary or on the editor config without guessing.
|
||
Details: [editor packaging](docs/features/editor-packaging/README.md).
|
||
|
||
### Real-world corpus
|
||
|
||
vfmt is measured against an 820-file corpus of open-source RTL
|
||
(picorv32, ibex, common_cells, OpenTitan) rather than against its own fixtures
|
||
alone. At this release **476 of 820 files (58.0%) parse and format cleanly,
|
||
with zero verification errors and zero crashes** — every file vfmt cannot
|
||
handle is a documented parse error, never a corrupted output. The remaining
|
||
gap is unsupported syntax, ranked by measured impact in `README.md`'s roadmap:
|
||
classes/constraints (the largest block, and mostly DV rather than RTL), `bind`,
|
||
dynamic arrays and queues, identifier-typed declarations, then concurrent
|
||
assertions and DPI. Macro invocations at module-item and statement position and
|
||
compiler directives inside port, parameter, enum, override and connection lists
|
||
were the two blockers closed during this cycle; no corpus file is blocked on a
|
||
compiler directive any more. Details:
|
||
[corpus check](docs/features/corpus-check/README.md),
|
||
[corpus bugs](docs/features/corpus-bugs/README.md),
|
||
[macro items](docs/features/macro-items/README.md),
|
||
[directives in lists](docs/features/directives-in-lists/README.md) and
|
||
[in instances](docs/features/directives-in-instances/README.md).
|