Skip to content

fix(windows): launch canonicalized batch shims through cmd.exe #301

Description

@TreyThomasCodes

Problem

On Windows, LSP executables discovered through canonicalized lsp_paths_extra directories can be represented as extended-length (\\?\\...) paths. Passing a .cmd or .bat shim in that namespace to cmd.exe breaks npm shim %~dp0 handling and the server fails to start with The system cannot find the path specified.

Native .exe launches are unaffected. The path should remain canonical for internal identity and filesystem operations.

Proposed design

At the shared batch-launch boundary only, translate recognized canonical paths into the spelling cmd.exe supports:

  • \\?\\C:\\... -> C:\\...
  • \\?\\UNC\\server\\share\\... -> \\server\\share\\...
  • preserve unsupported verbatim namespaces unchanged.

This applies equally to npm LSP shims and formatter/tool shims, while leaving native executable launching unchanged.

Evidence

The installed yaml-language-server@1.24.0 fails through the AFT configure + LSP-inspect path before conversion and starts successfully once the batch launch argument is converted at this boundary.

Implementation

PR #293 implements the change with DOS, UNC, percent-character, space, and unsupported-namespace regression coverage.

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

    design-approvedDesign agreed by a maintainer; a PR closing this issue can be reviewed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions