Skip to content

Miscellaneous extension improvements#3516

Merged
andrewbranch merged 6 commits intomicrosoft:mainfrom
andrewbranch:extension-improvements
Apr 23, 2026
Merged

Miscellaneous extension improvements#3516
andrewbranch merged 6 commits intomicrosoft:mainfrom
andrewbranch:extension-improvements

Conversation

@andrewbranch
Copy link
Copy Markdown
Member

Version picker with persistent preference

  • Ports the "Select TypeScript Version" command handler from the built-in TypeScript extension, which prior to this PR results in an error if you're using the native preview. This automates setting/changing your workspace setting’s typescript.native-preview.tsdk value.

  • Like the built-in extension, upon discovering a workspace tsdk setting, we now prompt one time to ask if you want to use it, and save the preference.

    Screenshot 2026-04-22 at 1 00 53 PM
  • A new typescript.native-preview.additionalTsdkLocations setting adds to the pick list. This is a selfish feature because it's always annoying as a developer working on TypeScript to swap to a workspace-installed version via the UI and then not be able to switch back to your local clone without manually typing it into the settings file. I added my local build to my user preferences so it will always show up in the UI for me.

    Screenshot 2026-04-22 at 1 14 30 PM

Adds PID and binary path location to server menu with a setting

If you enable typescript.native-preview.showDebugInfo, clicking on the tsgo status item menu shows:

Screenshot 2026-04-22 at 1 14 21 PM

I'm constantly guessing which tsgo process to attach to for debugging. (Selecting the item copies the value to the clipboard.)

Fix diagnostic collection owner name

Per request from @mjbvz

Copilot AI review requested due to automatic review settings April 22, 2026 22:22
Comment thread _extension/src/client.ts
}

get serverPid(): number | undefined {
return (this.client as any)?._serverProcess?.pid;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is unfortunate

Comment thread _extension/src/session.ts
});

// Workspace versions
if (vscode.workspace.isTrusted) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The trust checks are dead code for now, because the extension doesn't activate on untrusted workspaces, but I assume that's something we'll remove by RC / stable / whenever we ship by default in VS Code.

Copy link
Copy Markdown
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Nice! At some point we're going to have to write the code that tries to use the regular tsdk setting, too

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 improves the VS Code native-preview extension by adding a TypeScript version picker (with workspace opt-in persistence), surfacing debug info (PID/exe path) in the server menu, and aligning diagnostic collection ownership.

Changes:

  • Add workspace-tsdk opt-in gating and persistence via workspaceState, plus a prompt to use detected workspace installs.
  • Implement a version-selection quick pick (bundled/workspace/custom locations) and add optional debug info items to the server menu.
  • Set the diagnostic collection name to "typescript" and add new extension settings/command contributions.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
_extension/src/util.ts Adds workspace-level tsdk opt-in gating and storage key.
_extension/src/session.ts Adds version picker logic, workspace-version prompt, and debug-info menu items.
_extension/src/extension.ts Calls workspace-version prompt after session start.
_extension/src/client.ts Sets diagnostic collection name and exposes server PID.
_extension/package.json Adds settings for extra TSDK locations + debug info, and contributes a “Select Version” command.

Comment thread _extension/src/session.ts Outdated
Comment thread _extension/src/session.ts
Comment thread _extension/src/session.ts Outdated
Comment thread _extension/src/client.ts
Comment thread _extension/src/util.ts Outdated
Comment thread _extension/package.json Outdated
Comment thread _extension/src/extension.ts Outdated
@andrewbranch andrewbranch added this pull request to the merge queue Apr 23, 2026
Merged via the queue into microsoft:main with commit baae7a1 Apr 23, 2026
21 checks passed
@andrewbranch andrewbranch deleted the extension-improvements branch April 23, 2026 00:45
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.

3 participants