Skip to content

Commit bf4ddfb

Browse files
authored
fix(vscode): remove the legacy settings migration (#17)
* 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.
1 parent 06f0417 commit bf4ddfb

15 files changed

Lines changed: 16 additions & 1091 deletions

CONTEXT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Glossary of terms used across rstack-editor. Code, docs, commit messages and rev
55
## Core
66

77
- **Stack** — one tool integration (lint, test, fmt) hosted by the extension shell. A stack registers against the shell and reports status through it; stacks never own UI chrome.
8-
- **Shell** — the always-activating extension core: detection, status bar, output channels, settings migration, stack lifecycle.
8+
- **Shell** — the always-activating extension core: detection, status bar, output channels, stack lifecycle.
99
- **Detection** — the per-workspace-folder scan deciding which stacks a folder lights up. Detection signals are config files and installed tool binaries, never user settings.
1010
- **Gate** — the per-stack activation condition: detected, workspace trusted, and the enable settings on.
1111

docs/adr/0001-node-runtime-selection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This decision was written for one path, the rstest worker, and named two others
4343

4444
## Consequences
4545

46-
- An explicit `rstack.nodeExecutable` (shared with the fmt server since ADR 0002; the standalone Rstest extension's `rstest.nodeExecutable` migrates to it) is always honoured, but it is probed too: falling short of the floor produces a status, not a refusal. The escape hatch stays an escape hatch; it stops being silent.
46+
- An explicit `rstack.nodeExecutable` (shared with the fmt server since ADR 0002; the standalone Rstest extension's `rstest.nodeExecutable` had this role — it is not migrated, #15) is always honoured, but it is probed too: falling short of the floor produces a status, not a refusal. The escape hatch stays an escape hatch; it stops being silent.
4747
- A below-floor configured executable is reported through the same status as "no runtime found at all", so the two messages must state their _consequence_ explicitly — one says tests will not run, the other says the extension is running with it anyway.
4848
- The interactive-shell probe is the recovery path and does not exist on Windows (no `-i -c` equivalent reliably evaluates a user's profile across cmd and PowerShell). A Windows user whose PATH `node` is below the floor gets the failure status with no second candidate.
4949
- `NODE_OPTIONS` can carry `--no-strip-types`, which defeats the floor on any version. Deliberately not detected: the same setting breaks `rs test` in the terminal, so the editor failing identically is correct, and special-casing one flag would be permanent trivia bought for one diagnostic.

docs/adr/0002-fmt-lsp-on-user-node-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ One rule across both stacks now: the workspace folder root is the config root. A
1616

1717
## Why the User Node runtime
1818

19-
The server loads the project's `rstack.config.*` through `@rstackjs/load-config` with `loader: 'native'` — the exact path ADR 0001 analysed to set the worker floor, with no jiti fallback and no `process.features.typescript` consultation. So fmt is not a new case: it is the second caller of the same decision, and it takes the floor, the candidate order (PATH `node`, then the user's interactive shell) and the failure reporting out of the one shared module, `shared/nodeResolution.ts`. The escape hatch is shared too — `rstack.nodeExecutable`, resource-scoped, honoured whenever it is set and probed anyway, advisory-only. A user pinning a Node for one tool means it for the toolchain, so there is one setting rather than one per stack (the standalone Rstest extension's `rstest.nodeExecutable` migrates to it).
19+
The server loads the project's `rstack.config.*` through `@rstackjs/load-config` with `loader: 'native'` — the exact path ADR 0001 analysed to set the worker floor, with no jiti fallback and no `process.features.typescript` consultation. So fmt is not a new case: it is the second caller of the same decision, and it takes the floor, the candidate order (PATH `node`, then the user's interactive shell) and the failure reporting out of the one shared module, `shared/nodeResolution.ts`. The escape hatch is shared too — `rstack.nodeExecutable`, resource-scoped, honoured whenever it is set and probed anyway, advisory-only. A user pinning a Node for one tool means it for the toolchain, so there is one setting rather than one per stack (the standalone Rstest extension's `rstest.nodeExecutable` had this role — it is not migrated, #15).
2020

2121
Falling back to the VS Code Node runtime stays rejected — ADR 0001's load-bearing "no", unchanged. It is worth naming that the old fmt path did exactly that: `process.execPath` with `ELECTRON_RUN_AS_NODE=1`, loading the user's config on Electron's Node, with no floor and no preflight. Moving the server onto a User Node runtime is what takes fmt off that ADR's debt list.
2222

packages/vscode/AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AGENTS.md — `rstack.rstack` VS Code extension
22

3-
One extension replacing the standalone `rstack.rslint` and `rstack.rstest` extensions: a thin shell (activation, detection, status bar, settings migration) hosting one stack per tool under `src/stacks/`.
3+
One extension replacing the standalone `rstack.rslint` and `rstack.rstest` extensions: a thin shell (activation, detection, status bar) hosting one stack per tool under `src/stacks/`.
44

55
## The copies are intentional
66

@@ -10,7 +10,7 @@ One extension replacing the standalone `rstack.rslint` and `rstack.rstest` exten
1010
## The seven adaptations
1111

1212
1. **Shell activation** — stacks never self-activate; `register()` returns fast and never blocks on starting a server/worker.
13-
2. **Namespace** — everything user-visible is `rstack.*`. Legacy `rslint.*` / `rstest.*` names appear only in the migration mapping. Command IDs were renamed without aliases (breaking old keybindings was an accepted cost).
13+
2. **Namespace** — everything user-visible is `rstack.*`. Legacy `rslint.*` / `rstest.*` settings and command ids are not read, aliased or migrated (breaking old settings and keybindings was an accepted cost).
1414
3. **Resolve-from-project** — no tool binaries or tool packages in the VSIX; everything resolves from the user's project so the editor runs the CLI's exact versions. Version floors surface as a status, never a crash. All cooperating lint pieces (binary, config loader, plugin host) must come from one resolution root. Enforced by lint: `@typescript-eslint/no-restricted-imports` in the root `rstack.config.ts` rejects any non-type import of `@rslint/core`, `@rstest/core`, `rstack` or `jiti` under `src/` — types only at compile time, runtime modules through explicit project paths.
1515
4. **Status aggregation** — stacks own no UI chrome; they report to the shell's single status bar item, which always exists. In CI the test stack's `MasterLogger` also mirrors every entry to stderr (`RSTACK_E2E_MIRROR_LOGS=1`, set by `e2e/rstest/runTest.ts`) — the output channel is unreadable there; rationale in `stacks/test/logger.ts`.
1616
5. **Worker-cwd decoupling** (test) — a project's cwd is explicit, not derived from the config file path; for native configs behavior stays byte-identical to upstream.
@@ -19,7 +19,7 @@ One extension replacing the standalone `rstack.rslint` and `rstack.rstest` exten
1919

2020
## Rules
2121

22-
- **Pre-1.0.0 the extension breaks freely.** No compatibility is owed with earlier unpublished states of this extension — settings, command ids and behavior may change without deprecation paths, and dead compat code for them is removed, not kept. Only the **latest released** `rstack`, `@rstest/core` and `@rslint/core` need support: whenever a change touches a floor in `SUPPORT_MATRIX`, set it to the latest release at that time — do not reason about which older release would still work — and raise it without a transition story (the floor status names the required version). The settings migration exists for users of the two retired standalone extensions, never for earlier states of this one.
22+
- **Pre-1.0.0 the extension breaks freely.** No compatibility is owed with earlier unpublished states of this extension — settings, command ids and behavior may change without deprecation paths, and dead compat code for them is removed, not kept. Only the **latest released** `rstack`, `@rstest/core` and `@rslint/core` need support: whenever a change touches a floor in `SUPPORT_MATRIX`, set it to the latest release at that time — do not reason about which older release would still work — and raise it without a transition story (the floor status names the required version). No settings migration exists either — not for earlier states of this extension, and not for the two retired standalone extensions (removed in #15; users re-enter their settings under `rstack.*`).
2323
- **The three tools are treated uniformly by default.** Detection, dependency-change retry, restart semantics, version gating and status reporting follow one shared pattern across the lint/test/fmt stacks; a stack diverges only when its tool forces it, and the divergence is recorded here as a gotcha. When adding behavior to one stack, first ask whether it belongs to all three. This is about behavior, not code — the upstream copies still must not be deduplicated.
2424
- One stack failing to register or crashing must never take another stack (or the shell) down.
2525
- The shell always activates; per-folder config detection decides which stacks start, and re-runs on config/lockfile changes without a window reload. Enable-settings are coarse kill switches only.

packages/vscode/README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,9 @@ To use `rs fmt` as the formatter for supported documents, opt in through your VS
103103

104104
Formatting runs one `rs fmt` language server per workspace folder, which loads `define.fmt()` from the `rstack.config.*` at the **folder root** — the same config `rs fmt` in a terminal there would use, so a config in a subdirectory is not picked up (open that subdirectory as its own workspace folder if it needs different settings). Editing the config restarts the server for you. Your editor's own formatting options (tab size, spaces) are not consulted: the project config decides, exactly as on the command line.
105105

106-
## Migrating from the standalone extensions
106+
## Coming from the standalone extensions
107107

108-
Run **Rstack: Migrate Rslint/Rstest Settings** from the Command Palette (it is also offered once, dismissibly, when legacy keys are found).
109-
110-
- Settings are migrated per layer (User, Workspace, Workspace Folder), and the legacy keys are removed after they are copied. Workspace and folder layers touch files inside your repository, so nothing is written before you confirm the previewed key mapping.
111-
- Legacy `rslint.binPath` / `rslint.customBinPath` values are left untouched: a standalone binary path cannot be translated safely into the `@rslint/core` directory the worker requires.
112-
- **Keybindings are not migrated.** Command ids were renamed to `rstack.*` with no aliases, and VS Code has no keybindings API, so any keybinding bound to an old `rslint.*` / `rstest.*` command id has to be re-bound by hand.
113-
- Projects with only `rslint.json` / `rslint.jsonc` are reported as `not detected`; run `rslint --init` to migrate to a JS/TS config.
108+
Settings and keybindings are not carried over from the retired `rstack.rslint` / `rstack.rstest` extensions: re-enter your settings under the `rstack.*` keys listed above and re-bind any keybinding to the new `rstack.*` command ids. Legacy `rslint.binPath` / `rslint.customBinPath` have no equivalent — use `rstack.rslint.corePath` to point at an `@rslint/core` package directory if you still need an override.
114109

115110
## Community
116111

packages/vscode/e2e/suite/shell.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ suite('shell', () => {
3434
for (const command of [
3535
'rstack.showOutput',
3636
'rstack.restart',
37-
'rstack.migrateSettings',
3837
'rstack.rslint.output.focus',
3938
'rstack.rslint.restart',
4039
'rstack.rstest.output.focus',

packages/vscode/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@
5555
"category": "Rstack",
5656
"icon": "$(debug-restart)"
5757
},
58-
{
59-
"command": "rstack.migrateSettings",
60-
"title": "Migrate Rslint/Rstest Settings",
61-
"category": "Rstack"
62-
},
6358
{
6459
"command": "rstack.rslint.output.focus",
6560
"title": "Show Rslint Log",

packages/vscode/src/channels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const CHANNEL_NAMES: Readonly<Record<StackId | 'shell', string>> = {
1010

1111
/**
1212
* The extension's four output channels — a deliberate cap: one per stack plus
13-
* one for the shell (detection results, state transitions, migration logs).
13+
* one for the shell (detection results, state transitions).
1414
*
1515
* Stacks never create their own channel — a copied stack that used to create
1616
* one per workspace folder has to log into the shared channel instead.

packages/vscode/src/extension.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import vscode from 'vscode';
22
import { Channels } from './channels';
33
import { DetectionService } from './detection';
4-
import { maybePromptForMigration, runSettingsMigration } from './migration';
54
import { resetUserNodeCaches } from './shared/nodeResolution';
65
import { StatusBar } from './statusBar';
76
import {
@@ -132,8 +131,6 @@ class ExtensionShell {
132131
// is still initialising — and running beside it would let that restart
133132
// retire a controller whose `register()` has not returned yet.
134133
await this.reconcile();
135-
136-
void maybePromptForMigration(this.context, this.#channels.shell);
137134
}
138135

139136
private registerCommands(): void {
@@ -145,9 +142,6 @@ class ExtensionShell {
145142

146143
register('rstack.showOutput', () => this.#channels.shell.show());
147144
register('rstack.restart', () => this.restart());
148-
register('rstack.migrateSettings', () =>
149-
runSettingsMigration(this.#channels.shell),
150-
);
151145
for (const stack of STACK_IDS) {
152146
register(stackCommand(stack, 'output.focus'), () =>
153147
this.#channels.forStack(stack).show(),

0 commit comments

Comments
 (0)