Skip to content

Changing rstack.rslint.trace.server restarts every stack instead of updating trace in place #39

Description

@fi3ework

Problem

Changing rstack.rslint.trace.server restarts the whole extension instead of updating the trace level in place.

trace.server is listed in the Rslint controller's restartOnSettings (packages/vscode/src/stacks/lint/index.ts:71-75). The shell answers any matching configuration change with restart(undefined, …) (packages/vscode/src/extension.ts:73-110), which expands to every stack (extension.ts:248-257). So flipping a debug-only setting from off to messages:

  1. retires Rslint, Rstest and fmt (status bar goes to starting),
  2. sends didClose for every open document and deletes its diagnostics,
  3. disposes the Rstest TestController (the Test Explorer tree is destroyed and rebuilt),
  4. stops every fmt server,
  5. re-runs detection and rebuilds all three stacks.

The replacement client only attaches a trace channel and calls client.setTrace when the setting is non-off at construction time (packages/vscode/src/stacks/lint/Rslint.ts:415-445,509-514), so there is no path to enable tracing on a running client.

Upstream behavior

The standalone rslint extension supplied a traceOutputChannel unconditionally and let vscode-languageclient own the setting: it puts the initial value into the initialize request's trace field and sends $/setTrace on every later change, with no restart (rslint@origin/main:packages/vscode-extension/src/Rslint.ts:96-119,429-434). Its E2E asserts that off → messages → verbose → off reaches every running client via $/setTrace while each server's start count stays at 1 (packages/vscode-extension/__tests__/suite-jsconfig/trace-output-channel.test.ts:200-300).

Proposal

  • Drop trace.server from restartOnSettings in stacks/lint/index.ts.
  • Pass the trace channel to the language client unconditionally so vscode-languageclient handles $/setTrace itself; remove the manual setTrace call.
  • Keep the shared Rstack: Rslint channel for trace output (the four-channel layout in channels.ts is a deliberate cap and unrelated to whether a restart is needed).
  • Add an E2E in e2e/lint/ mirroring the upstream assertions: changing the setting notifies running clients and does not restart any server.
  • Check whether rstack.fmt.trace.server has the same issue and apply the same fix.

Context

Found while auditing the standalone rslint/rstest extensions for sunset. This is the only confirmed behavior regression relative to the standalone extensions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions