Using extensions in compiled VSCode

Viewed 4283

I compiled VSCode on mac and was able to run the application but noticed that extensions don't work. Navigating to the extensions pane shows - 'No extensions found.'

So I did a grep on the source code for 'marketplace' and found - "build/lib/extensions.js: base: 'https://marketplace.visualstudio.com/_apis/public/gallery',

I assumed that's the URL for the marketplace and tried doing a curl on it to verify if the API sends back a list of available extensions. All I got back was a 404.

So, if I want to get extensions to work on my compiled version, do I have to change the URL? How to I get extensions to work?

4 Answers

It's not clear where the product.json file is ...

If you are using VSCodium on Mac the product.json file is located at:
/Applications/VSCodium.app/Contents/Resources/app

Edit the file using VSCodium:

code /Applications/VSCodium.app/Contents/Resources/app/product.json

If you search for "extensionsGallery" you should see:

vscodium-default-extensionsGallery

Replace:

  "extensionsGallery": {
    "serviceUrl": "https://open-vsx.org/vscode/gallery",
    "itemUrl": "https://open-vsx.org/vscode/item"
  },

With:

"extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "itemUrl": "https://marketplace.visualstudio.com/items"
},

So you now have this:

vscodium-updated-extensionsGallery

After restarting VSCodium, if we open the Extensions Marketplace: vscodium-open-extensions-marketplace

If you search for your favourite extension or programming language, you will see all of them: vscodium-full-extention-marketplace

It seems that Vscode open source versions (Code -OSS, Vscodium) doesn't use Microsoft extensions gallery by default. Therefore, some extensions will not show up in the extensions tab and the ext command won't work

As @nelsonic mentioned the correct way to fix this in Mac is to edit the /Applications/VSCodium.app/Contents/Resources/app/product.json file.

In Linux, this is quite different. If you are using Code -OSS you edit the following file: /usr/lib/code/product.json.

If you use VsCodium you edit: /usr/lib/codium/product.json

You must change the key extensionsGallery from:

    "extensionsGallery": {
        "serviceUrl": "https://open-vsx.org/vscode/gallery",
        "itemUrl": "https://open-vsx.org/vscode/item"
    },

Before

To:

"extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
    "itemUrl": "https://marketplace.visualstudio.com/items"
}

After

Related