LOLINTERNETZ / vscodeoffline

Enables Visual Studio Code's extension gallery to be used in offline (air-gapped) environments. Or, run your own gallery!
https://hub.docker.com/u/lolinternet
MIT License
95 stars 28 forks source link

PreRelease check on C/C++ extension returns invalid data and prevents extension from loading #61

Open alog243 opened 5 months ago

alog243 commented 5 months ago

VSCode ver: 1.85.2 C/C++ Extension (ms-vscode.cpptools) ver: 1.18.5

https://github.com/microsoft/vscode-cpptools/blob/b742a191ee543a1d8df255a2420a5bfe33672e2d/Extension/src/LanguageServer/extension.ts#L1293

In this function preReleaseCheck, the extension performs an API query to the marketplace to see if a prerelease version of the extension is available. On vscodeoffline this returns a 500 server error wrapped in json. Since node-fetch doesn't treat 3xx-5xx return codes as exceptions, this isn't caught and the error json object causes an unhandled exception (line 1295 above), which prevents the C/C++ extension from loading.

This can be fixed by returning an empty json object for this endpoint (the query parameters can be seen starting on line 1281).

alog243 commented 5 months ago

Looks like this is the same as https://github.com/LOLINTERNETZ/vscodeoffline/pull/60

LOLINTERNETZ commented 2 months ago

I think this passes now with PR #60 merged, but I don't use the extensions to triple check

python3 sync.py --extension-name ms-vscode.cpptools --update-extensions --prerelease-extensions