Skip to content

feat(vscode): resolve the Rslint core per document and run one Lint runtime per core - #18

Merged
fi3ework merged 4 commits into
mainfrom
feat-vscode-lint-runtime-manager
Aug 18, 2026
Merged

feat(vscode): resolve the Rslint core per document and run one Lint runtime per core#18
fi3ework merged 4 commits into
mainfrom
feat-vscode-lint-runtime-manager

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Summary

Sync stacks/lint to upstream rslint's per-document core resolution (CoreResolver + RuntimeManager, rslint #1617; configPath from #1630 was already in).

What changes for a user

  • One Lint runtime per physical @rslint/core inside a workspace folder, resolved from each open document's directory (realpath identity: two same-version copies stay separate, a symlink is the copy it points at). A monorepo folder whose packages carry their own @rslint/core now runs one worker + Go process per copy instead of linting everything with the folder root's.
  • Runtimes are refcounted by open document: the first document to need a core starts it, the last one to close releases it. A detected folder with nothing open holds no process and reports running / idle in the status bar.
  • Bridged folders (root rstack.config.*) are unchanged: one runtime on rstack's core, document directory ignored; the shim is part of the runtime key so a native ↔ bridged flip replaces the runtime.
  • Failures report through the status only (no toast): the folder shows the worst of its runtimes plus any document whose core resolution failed (last-good runtime kept), with the core path in the detail; disabled (missing rstack) ranks above running as in the fmt stack.
  • rstack.rslint.corePath keeps overriding the core hop in both modes and stays a full-restart setting.
  • With @rslint/core >= 0.8.0 (existing floor) the Go server syncs documents incrementally in UTF-16 — the client had nothing to change; the emoji regression test is ported.

Adaptations kept (ADR 0003 / packages/vscode/AGENTS.md): the extension host only walks to the core directory (no @rslint/core loaded, so upstream's installation cache is dropped), the lint worker takes --core per runtime, detection stays the gate, and the lint stack watches node_modules/@rslint/core/package.json while relying on the shell's detection pass for lockfiles.

Tests: upstream's core-resolver (9) and runtime-manager (20) E2E suites replace workspace-coordinator; the monorepo suite gains "root and nested physical core copies run concurrently" (asserting two live runtimes through the exports channel); unit tests cover identity, runtime keys and the status fold. Every intentional deviation from an upstream test is commented in the test.

Docs: ADR 0003 consequences, AGENTS.md adaptation 7 + tracked upstream commits (39536fd6, 892482e0), CONTEXT.md terms Rslint core / Lint runtime.

Verified locally: pnpm lint, pnpm test:unit (206), pnpm run fmt:check, and the full lint E2E slice (VSCODE_CLI=1 pnpm --filter ./packages/vscode test:e2e lint: 166 passing, 3 pending by design).

Related Links

Closes #13

Checklist

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

…untime per core

Sync the lint stack to upstream rslint's per-document core resolution
(`CoreResolver` + `RuntimeManager`, rslint #1617; `configPath` from #1630 was
already in). `WorkspaceRslintCoordinator` — one server per workspace folder —
is replaced by one Lint runtime per physical `@rslint/core` (realpath) inside a
folder, resolved from each open document's directory and refcounted by the
documents using it: the first document to need a core starts its worker + Go
process, the last one to close releases it, and a detected folder with nothing
open reports `running` / idle. A bridged folder (root `rstack.config.*`) is
unchanged: one runtime on rstack's core, document directory ignored, and the
shim is part of the runtime key so a native ↔ bridged flip replaces the runtime.

Adaptations kept from ADR 0003: the extension host only walks to the core
directory (no `@rslint/core` loaded, hence no installation cache), the lint
worker takes `--core` per runtime, and resolution failures report through the
folder status (last-good runtime kept, no toast). Folder status is the worst of
its runtimes plus failed documents, with `disabled` ranked above `running` as
in the fmt stack. `rstack.rslint.corePath` stays a full-restart setting; the
lint stack watches `node_modules/@rslint/core/package.json` and relies on the
shell's detection pass for lockfiles.

Tests: upstream's core-resolver (9) and runtime-manager (20) E2E suites replace
workspace-coordinator; the monorepo suite gains "root and nested physical core
copies run concurrently" (asserting two live runtimes) and the basic suite the
incremental UTF-16 emoji case; unit tests cover identity, runtime keys and the
status fold. Docs: ADR 0003 consequences, AGENTS.md adaptation 7 and tracked
upstream commits, CONTEXT.md terms "Rslint core" / "Lint runtime".

Closes #13

@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: c162cc62c2

ℹ️ 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/index.ts Outdated
With several runtimes in one folder, a crash reported as "the Rslint
language server stopped" did not say which core to look at. The controller
now appends the core directory to crashed / version-mismatch states before
folding them (the resolver's own messages already carry it).

@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: 459e04c9a2

ℹ️ 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/index.ts Outdated
A runtime that fails during start is closed before its document's durable
failure state is stored, which dropped the core-attributed runtime state.
RuntimeManager now hands the resolved core to onDocumentFailure and the
controller attributes the stored status to it.

@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: e291900432

ℹ️ 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/RuntimeManager.ts
On Windows the resolver reports the temp directory's 8.3 alias while
fs.promises.realpath returns the long spelling, so the version-floor test
compared the two as text and failed. Compare them as physical identities.
@fi3ework
fi3ework merged commit a0a9e88 into main Aug 18, 2026
3 checks passed
@fi3ework
fi3ework deleted the feat-vscode-lint-runtime-manager branch August 18, 2026 10:48
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.

lint: sync upstream rslint #1617 (per-document core resolution, RuntimeManager)

1 participant