Skip to content

Resolve native-preview tsdk symlinks before locating platform package#4561

Open
jakebailey with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-symlinks-resolving
Open

Resolve native-preview tsdk symlinks before locating platform package#4561
jakebailey with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-symlinks-resolving

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

pnpm can install @typescript/native-preview as a symlink into its virtual store. The extension followed the configured path to read package.json, but derived the platform package path from the unresolved symlink location, which fails when dependencies are not hoisted.

  • tsdk resolution

    • Resolve file-based tsdk URIs through realpath before looking for sibling platform packages.
    • Preserve the existing behavior for non-file URIs and paths where realpath fails.
  • pnpm virtual store support

    • Allows settings like:

      {
        "typescript.native-preview.tsdk": "./node_modules/@typescript/native-preview"
      }

      to resolve the executable from the real package location under .pnpm/.../node_modules/@typescript/.

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix extension not following symlinks for tsdk Resolve native-preview tsdk symlinks before locating platform package Jul 8, 2026
Copilot AI requested a review from jakebailey July 8, 2026 07:54
@DanielRosenwasser DanielRosenwasser marked this pull request as ready for review July 8, 2026 08:48
Copilot AI review requested due to automatic review settings July 8, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes VS Code native-preview TSDK executable discovery when @typescript/native-preview is installed as a symlink (notably via pnpm’s virtual store), by resolving file-based TSDK locations through realpath before deriving the sibling platform-package path.

Changes:

  • Resolve workspaceResolve(tsdkPath) through a new realpathUri helper before searching for package.json and platform package siblings.
  • Preserve existing behavior for non-file URI schemes and for cases where realpath fails (falls back to the original URI).
Show a summary per file
File Description
_extension/src/util.ts Resolve file-based TSDK URIs via realpath before locating the platform package so pnpm symlink installs work when deps aren’t hoisted.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Low

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension does not follow symlinks when resolving the tsdk path (breaks pnpm virtual store)

3 participants