I've already looked at questions on StackOwerflow, watched videos, and I remember installing them myself, but now I just can't find the “Download Extension” button. Where did it disappear to? I've attached two screenshots - the first is from a random video, the second is mine where I just can't find the button where it was.
Indeed, such a button does not exist in the Visual Studio Marketplace.
And yet, you can obtain the code of a VSCode extension in the form you can install offline. You can get it via the source code repository.
To do it, you can use the link Repository found on the Visual Studio Marketplace page of the extension you need, the page where you have the button Install (and don't use it).
Get to the source code and copy or clone the current code, its latest release or any release of your choice. Usually, the intended use is taking the latest release and not the latest code snapshot.
Now, with the code in your local directory, you need the directory where the file "package.json"
is. In this directory, you command
vsce package
This command will package the extension code into a .vsix file of an appropriate version, according the data prescribed in "package.json"
.
Of course, you need node.js, npm
, and vsce
installed. To find all the instructions you may need, please see Publishing Extensions. Even though you need not publish but install, you need vsce
.
One of the ways to install an extension offline is the VSCode CLI command
code --install-extension myextension.vsix
See also: Extension Marketplace, Command line extension management, Install from a VSIX, etc.
By the way, using the extension code, you can even locally debug the extension obtained from the Visual Studio Marketplace.
There is also an alternative method of getting the extension product files. It works if you have VSCode with an already installed extension. In this case, you need to locate your VSCode data use the directory data/extension
. The exact location of this directory depends on the platform and the type of VSCode installation. In particular, if you have a portable VSCode installation, you will find data/extension
in the VSCode installation directory, a sibling directory to bin
. Inside data/extension
directory, you can locate the directory of the extension you need and run vsce package
.