Skip to content

[Lifecycle] Investigate missing formatter fallback during replacement #139

Closed

Description

Observed

During an extension-driven restart with isFormatter: true, the old client's state listeners are disposed before the old client is stopped. If the old client was Running, the placeholder is not re-registered at the beginning of the restart. After the old client stops and while replacement startup is pending, no fallback placeholder is registered.

Reproduction

  1. Start with a Running formatter client and its placeholder unregistered.
  2. Trigger runServer() again, allowing the old stop to finish while holding the replacement client's start() pending.
  3. Observe that the old client is Stopped and the placeholder remains unregistered until the replacement finishes.

Confirmed using the real createToolContext and restartServer orchestration with the existing stateful client mock on Node 24.17.0. The S3 characterization test also protects this existing boundary. The effect on the live VS Code formatter picker has not been verified in an extension host; a formatter could temporarily disappear while replacement startup is pending.

Follow-up

Decide whether a fallback should be available in this interval and, if so, how to restore it without reintroducing duplicate formatter entries while the old client is still healthy. Discovered while reviewing #137; that issue is intentionally tests-only.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions