Repository navigation
fix(vscode): decide lint ownership per document - #90
Merged
Merged
Conversation
A workspace folder's lint mode was decided once for the whole folder: any `rslint.config.*` anywhere in it made every document native, so a root `rstack.config.*` with `define.lint()` stopped linting as soon as one subdirectory added its own config, and the files outside that subdirectory silently lost all diagnostics while the status bar still said `running`. Rslint locks the config choice per process, not per folder, and since the per-core runtime split one folder can already host several runtimes. Ownership now follows each document's ancestor chain: the nearest `rslint.config.*` between the document and the folder root wins, otherwise a root `rstack.config.*` bridges the document, otherwise the nearest config above the folder, otherwise the document is not served — matching the `rslint` CLI, which lints no file outside every config boundary. Sibling and descendant configs never count. `StackDetection.mode` is gone; `RuntimeManager` asks `documentMode(document)` instead of `folderMode(folder)`. ADR 0006 supersedes ADR 0003's "ownership is per folder, native wins"; the new `document-ownership` E2E suite covers two runtimes of both modes in one folder and a nested config created while both are serving. Closes #85
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb5e0b91c1
ℹ️ 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".
`decideDocumentMode` treated the folder's native configs, the root Rstack config and the config above the folder as three inputs with three stops. They are all directories on the document's ancestor chain, so the walk now visits each directory once and the nearest config wins, with a native config beating the Rstack config in the same directory. `folderRoot` and `ancestorConfigPath` disappear from the signals; the caller merges the ancestor config into `nativeConfigPaths`. ADR 0006 now states that ADR 0003's "folder" was the workspace folder, a narrower unit than the rule it meant to express.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A workspace folder's lint mode was decided once for the whole folder: any
rslint.config.*anywhere in it made every document native, so a rootrstack.config.*withdefine.lint()stopped linting as soon as one subdirectory added its own config. Files outside that subdirectory were handed to the native Go server, fell outside every config boundary, and silently got zero diagnostics while the status bar still saidrunning.The constraint behind the old rule is per process (Rslint locks its config choice for a server's lifetime), not per folder, and since the per-core runtime split one folder already hosts several runtimes keyed on
folder + core + shim. This PR moves ownership to the document's ancestor chain:rslint.config.*between the document and the folder root → nativerstack.config.*→ bridged (unchanged resolution: rstack →@rslint/core, shim pinned)rslint.config.*above the folder (fix(vscode): detect rslint configs above the workspace folder #89 rule) → nativerslintCLI, which lints no file outside every config boundarySibling and descendant configs never count. A root
rslint.config.*beside a rootrstack.config.*still makes every document native.Changes:
resolution.ts:decideDocumentMode(pure, unit-tested) replacesdecideRslintMode;StackDetection.moderemoved, detection only collects signalsRuntimeManager:folderMode(folder)→documentMode(document);CoreResolver, worker,Rslint.ts, router untouched (comment-only edit inCoreResolver.ts)CONTEXT.md,packages/vscode/AGENTS.md, README updatedsuite-document-ownership: root document reports the Rstack rule, nested document the native rule, two runtimes in one folder; creating a second nestedrslint.config.tswhile both are open migrates only the documents under it and the bridged runtime staysrunningthroughoutKnown divergence, recorded in the ADR:
rs lintrun at the folder root lints nested files with the root config; the editor lints them with the nearestrslint.config.*. The editor cannot match both CLIs; the nearest config matches the one a user would run in that directory.Verified:
pnpm lint && pnpm test:unitgreen;VSCODE_CLI=1 pnpm test:e2e lintand the vscode slice exit 0.Related Links
Closes #85
Checklist