mdsmith for VS Code
The extension is a thin LSP client over the bundled mdsmith binary, which it runs with the lsp subcommand. Diagnostics appear inline as squiggles, and every fixable rule contributes a lightbulb quick fix. A whole-buffer fix action runs on demand or on save, with an optional Refactor Preview before edits land. Cross-file navigation extends to Go to Definition, Find All References, workspace symbol search, and a call hierarchy across includes, catalogs, builds, and Markdown links. The mdsmith Command Palette runs Initialize Config, Fix All Markdown, Install Git Merge Driver, Explain Rule on This File, and Show Resolved Config. The .vsix bundles the mdsmith binary for every supported OS and architecture, so no separate install is needed.
Prerequisites
VS Code 1.85 or later.
No separate mdsmith install — the .vsix bundles a binary
for every supported platform (Linux, macOS, and Windows on x64 and
arm64) and selects yours at startup. It does this by re-using the
@mdsmith/cli npm package's own resolver, so the extension and
npx @mdsmith/cli always agree on which binary runs.
Override only if you want a specific build: set mdsmith.path to an
absolute path (e.g. from
go install github.com/jeduden/mdsmith/cmd/mdsmith@latest,
npm install -g @mdsmith/cli, or the
releases page). The
extension falls back to resolving mdsmith on PATH only if your
platform was not bundled.
Install
code --install-extension mdsmith-<version>.vsix
Settings
| Setting |
Default |
Purpose |
mdsmith.path |
"mdsmith" |
Binary path; default runs the bundled per-platform binary. Set an absolute path to override; falls back to PATH only if your platform was not bundled (e.g. /go/bin/mdsmith) |
mdsmith.config |
"" |
Override -c config path |
mdsmith.run |
"onType" |
When to lint: onType (default), onSave, or off (off stops automatic linting) |
mdsmith.previewFix |
false |
Show the diff (Refactor Preview) before fix-on-save writes; quick fixes apply immediately |
mdsmith.trace.server |
"off" |
LSP trace verbosity |
Fix-on-save uses VS Code's native editor.codeActionsOnSave,
the same way ESLint does:
{ "editor.codeActionsOnSave": { "source.fixAll.mdsmith": "explicit" } }
With mdsmith.previewFix on, each save shows the diff first.
See the
full guide
for prerequisites, code actions, troubleshooting, and the
performance benchmark.
Building from source
The extension uses Bun for both bundling
and tests:
bun install
bun test
bun run build.ts # one-shot bundle to dist/
bun run build.ts --watch # rebuild on change
bunx --bun @vscode/vsce package produces the .vsix.
License
MIT.