Resolve native-preview tsdk symlinks before locating platform package#4561
Open
jakebailey with Copilot wants to merge 2 commits into
Open
Resolve native-preview tsdk symlinks before locating platform package#4561jakebailey with Copilot wants to merge 2 commits into
jakebailey with Copilot wants to merge 2 commits into
Conversation
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
Contributor
There was a problem hiding this comment.
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 newrealpathUrihelper before searching forpackage.jsonand platform package siblings. - Preserve existing behavior for non-
fileURI schemes and for cases whererealpathfails (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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pnpm can install
@typescript/native-previewas a symlink into its virtual store. The extension followed the configured path to readpackage.json, but derived the platform package path from the unresolved symlink location, which fails when dependencies are not hoisted.tsdk resolution
realpathbefore looking for sibling platform packages.realpathfails.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/.