Skip to content

feat(vscode): lint through an editor-shipped worker and bridge define.lint() - #14

Merged
fi3ework merged 4 commits into
mainfrom
feat-vscode-lint-worker-bridge
Aug 18, 2026
Merged

feat(vscode): lint through an editor-shipped worker and bridge define.lint()#14
fi3ework merged 4 commits into
mainfrom
feat-vscode-lint-worker-bridge

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Summary

Rslint's language server is two halves — the Go rslint --lsp process, and a JS host that evaluates configs and runs plugin rules on the Go server's reverse requests. Until now that host lived in the extension host (VS Code Node runtime, meaningless cwd), which is also why define.lint() in rstack.config.* could not be bridged without a generated shim.

This PR ships a lint worker: a vscode-free Node script, one per workspace folder, run on the User Node runtime (same preflight, floor and rstack.nodeExecutable escape hatch as the test worker and rs fmt --lsp) with its cwd at the folder root. The worker spawns the Go server from the resolved @rslint/core, proxies LSP over stdio, and answers rslint/loadConfigs / activateConfigs / commitConfigs / abortConfigs / pluginLint itself. The extension host keeps only the language client.

  • Bridged folder (no rslint.config.* anywhere in the folder, rstack.config.* at its root): the worker is pinned to rstack's own shipped shim (<rstack>/dist/rslintConfig.js) through the protocol-2 configPath of rslint/configRefresh. Diagnostics match rs lint in a terminal; the E2E suite asserts exactly that, and that define.lint runs outside the extension host and off the VS Code Node runtime. No generated shim, no Rstack config semantics in the editor.
  • Native folder: unchanged behaviour, now evaluated in the worker.
  • Ownership is per folder, native wins; a subdirectory rstack.config.* lights nothing (root only, as rs lint reads its cwd).
  • Resolution mirrors rs lint: rstack from the folder root → @rslint/core from rstack's directory → the binary via that core's resolveRslintBinary(). rstack.rslint.corePath (the setting the standalone Rslint extension moved to) overrides the core hop; binPath / customBinPath are removed and surfaced as dropped in the settings migration; rslint.corePath migrates.
  • Config changes refresh (the worker re-stamps protocolVersion and configPath); a native ↔ bridged flip restarts the folder's runtime.
  • Floors (latest release only): @rslint/core >= 0.8.0, rstack >= 0.6.1 toolchain-wide.
  • Lint gains the Node floor (^22.18.0 || >=23.6.0) it never had; this closes the lint entry on ADR 0001's debt list.

Docs: new docs/adr/0003-lint-through-editor-worker.md; ADR 0001 amended; CONTEXT.md (Ownership, Lint worker, Bridged/Native folder); packages/vscode/AGENTS.md adaptation #7 and gotchas; READMEs. The per-document runtime model from the standalone extension's latest refactor is deliberately out of scope (#13).

Related Links

Test plan

  • pnpm lint (rs lint --type-check): 0 errors, 0 type errors, 0 warnings
  • pnpm test:unit: 24 files / 217 tests passed
  • VSCODE_CLI=1 pnpm test:e2e lint vscode smoke: smoke OK; vscode exit 0; all 10 lint suites exit 0 (9 ported + new Rstack lint bridge)

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

…e move

- Remove docs/tickets/lint-worker-bridge.md: the ADR carries the decision, the
  ticket was working material.
- Restore the note explaining why rslint.json stays in the lint watch list.
- Drop dead surface left by the move into the worker (unused package name,
  exported factory type, default cwd) and fold the dropped-legacy-key
  constants in the settings migration.
- Fix the rstack floor rationale in versionCheck.ts and the worker cwd in
  CONTEXT.md (folder root, not config root).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73fa62741a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vscode/src/stacks/lint/resolution.ts
Comment thread packages/vscode/src/migration.ts
@fi3ework
fi3ework merged commit d5e51e5 into main Aug 18, 2026
3 checks passed
@fi3ework
fi3ework deleted the feat-vscode-lint-worker-bridge branch August 18, 2026 06:59
fi3ework added a commit that referenced this pull request Aug 18, 2026
* chore(vscode): remove the legacy settings migration

Drop `migration.ts`, its tests, the `rstack.migrateSettings` command (manifest entry, palette registration and status-bar hover action) and the activation-time prompt with its `rstack.migration.dismissed` state.

Pre-1.0 the extension owes no compatibility to earlier states, and the migration only served users of the two retired standalone extensions; keeping it meant every settings change carried a mapping-table update plus tests for a one-off flow, and the table already had to model dropped features (`rslint.binPath` / `customBinPath`, #14). The README keeps a one-paragraph note telling standalone-extension users to re-enter their settings under `rstack.*` and re-bind keybindings; AGENTS.md's namespace adaptation and pre-1.0 rule are reworded so no migration is implied.

Closes #15

* docs(adr): stop describing rstest.nodeExecutable as migrated

ADR 0001 and 0002 said the standalone Rstest extension's `rstest.nodeExecutable` "migrates to" `rstack.nodeExecutable`; the migration was removed in #15, so the parentheticals now state only that the legacy key had the same role.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant