fix(compiler): install VS Code/VS extensions from marketplace instead of npm#11169
fix(compiler): install VS Code/VS extensions from marketplace instead of npm#11169timotheeguerin wants to merge 4 commits into
Conversation
… of npm `tsp code install` now delegates to `code --install-extension microsoft.typespec-vscode` and `tsp vs install` downloads the latest vsix from the Visual Studio Marketplace, removing the dependency on the `typespec-vscode`/`typespec-vs` npm packages. Fixes part of #11168
commit: |
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
markcowl
left a comment
There was a problem hiding this comment.
I think we probably want to provide more data on other ways to download in case of failure, perhaps in a website doc linked through an aka.ms link.
| const url = `${MARKETPLACE_URL}/_apis/public/gallery/publishers/${extension.publisher}/vsextensions/${extension.name}/${version}/vspackage`; | ||
| const res = await fetch(url); | ||
| if (!res.ok) { | ||
| throw new Error(`Downloading vsix returned status ${res.status}.`); |
There was a problem hiding this comment.
I think we should augment this message to include other mechanisms to download the extension (for example, we could have a documentation page that goes through how to do this directly)
| "vsix-download-failed": { | ||
| severity: "error", | ||
| messages: { | ||
| default: paramMessage`Failed to download extension "${"id"}" from the marketplace: ${"message"}.`, |
There was a problem hiding this comment.
Same: I think we need some better troubleshooting steps, propbably in a document, we can use an aka link here.
Fixes part of #11168.
The
tsp code installandtsp vs installCLI commands previously installed the editor extensions by downloading thetypespec-vscode/typespec-vsnpm packages, extracting the bundled.vsix, and installing that. Those npm packages only exist as a distribution vehicle and are now redundant since both extensions are published to their marketplaces.Changes
tsp code installnow delegates directly tocode --install-extension microsoft.typespec-vscode(respecting--insiders). No npm download.tsp vs installkeeps the "download a.vsix, then runVSIXInstaller.exe" flow, but downloads the latest vsix from the Visual Studio Marketplace instead of npm (via the galleryextensionquery+vspackageendpoints).install-vsix.ts; addeddownload-vsix.ts(marketplace query + download to temp dir + install callback + cleanup, with aTYPESPEC_DEBUG_VSIXlocal override for debugging).vsix-download-faileddiagnostic.Tests
test/cli/vscode.test.ts: install/uninstall invokecode/code-insiders --install-extension microsoft.typespec-vscode;vscode-in-pathdiagnostic whencodeis missing.test/cli/download-vsix.test.ts: version resolution + vspackage URL, temp cleanup,TYPESPEC_DEBUG_VSIXoverride, and download-failure diagnostics.Notes
Fully retiring/unpublishing the
typespec-vscode/typespec-vsnpm packages and their publish pipelines (also part of #11168) is left as a follow-up; this PR removes the CLI's runtime dependency on them.