The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Getting the list of vscode extensions when it upgraded to a version not supported on the platform any more (and packing your extensions in a .vsix list package)

Posted by jpluimers on 2025/01/02

While moving from ancient hardware to more modern hardware, somehow Visual Studio Code had updated itself to a version that didn’t support the underlying operating system any more. Bummer!

Normally I would get the list of extensions through this command (which is listed in many places, like in my blog post How can you export the Visual Studio Code extension list? (via: Stack Overflow), but also for instance answered in the below question by [WaybackSave/Archive] Benny Ng):

code --list-extensions

That obviously would not work, but thanks to [Wayback/Archive] How can you export the Visual Studio Code extension list? – Stack Overflow (thanks [Wayback/Archive] Andrew and [Wayback/Archive] MarkP) I now could do this:

ls -alh ~/.vscode/extensions

(That directory obviously is also in various forms of official documentation like in the the Your Extensions Folder section of [Wayback/Archive] Publishing Extensions | Visual Studio Code Extension API.

A comment to the above question pointed me to an interesting way to automate extension installs on various machines: pack the installed extension list into its own .vsix file:

[Wayback/Archive] visual studio code – How to install multiple extensions in VSCode using command line – Stack Overflow (thanks [Wayback/Archive] BuZZ-dEE and [Wayback/Archive] sharhp)

A

Disclaimer: This is not a command line approach, but rather a graphical way to install existing extensions on a new system using .vsix package, and might help some others with the same.


This method to install extensions on a new system (with reference to an existing system) requires Yeoman VS Code extension generator and vsce (or nodejs to install these).

  1. On the existing machine, generate an extension pack (more details here)
npm install -g yo generator-code

yo code

First command installs Yeoman VS Code generator, second creates the extension pack (choose default options as below. The created package.json contains all extensions in the pack, you can modify that list)

enter image description here

enter image description here

enter image description here

  1. On the existing machine, package the extension pack created above into a .vsix file
npm install -g vsce
 
vsce package

First command installs vsce, second packages the extension into a .vsix file (run from the root of the extension pack created above)

enter image description here

  1. On the new system, install the .vsix file
code --install-extension extension-pack-0.0.1.vsix
  1. Open VS Code on the new system, access this extension, install all required extensions via GUI

enter image description here

Anyway, the ancient system had these extensions installed:

drwxr-xr-x 3  jeroenp staff  96B Apr 24  2018 .lukehoban.go-0.6.78
drwxr-xr-x 23 jeroenp staff 736B Dec 22  2019 .ms-vscode.powershell-2019.12.0
drwxr-xr-x 9  jeroenp staff 288B Jun 22  2022 ambooth.git-rename-1.3.0
drwxr-xr-x 15 jeroenp staff 480B Sep 12 10:36 davidanson.vscode-markdownlint-0.56.0
drwxr-xr-x 13 jeroenp staff 416B Oct 29  2023 eamodio.gitlens-14.4.1
drwxr-xr-x 7  jeroenp staff 224B Mar 20  2023 earshinov.sort-lines-by-selection-1.2.0
-rw-r--r-- 1  jeroenp staff  15K Sep 13 12:34 extensions.json
drwxr-xr-x 27 jeroenp staff 864B Apr 11  2024 jebbs.plantuml-2.18.1
drwxr-xr-x 15 jeroenp staff 480B Feb  9  2023 lextudio.restructuredtext-189.3.0
drwxr-xr-x 10 jeroenp staff 320B Nov 13  2019 mdickin.markdown-shortcuts-0.12.0
drwxr-xr-x 39 jeroenp staff 1.2K Sep 13 12:34 ms-dotnettools.csharp-2.45.25-darwin-x64
drwxr-xr-x 10 jeroenp staff 320B Jul 18 15:24 ms-dotnettools.vscode-dotnet-runtime-2.1.1
drwxr-xr-x 10 jeroenp staff 320B May 24  2023 ms-mssql.data-workspace-vscode-0.5.0
drwxr-xr-x 28 jeroenp staff 896B Nov 13  2023 ms-mssql.mssql-1.22.0
drwxr-xr-x 13 jeroenp staff 416B Aug 17 12:44 ms-mssql.sql-database-projects-vscode-1.4.3
drwxr-xr-x 33 jeroenp staff 1.0K Jul 13  2023 ms-python.isort-2023.10.1
drwxr-xr-x 42 jeroenp staff 1.3K Oct 29  2023 ms-python.python-2023.14.0
drwxr-xr-x 25 jeroenp staff 800B Mar  5  2024 ms-python.vscode-pylance-2024.2.3
drwxr-xr-x 33 jeroenp staff 1.0K Jul 21  2023 ms-toolsai.jupyter-2023.6.1101941928-darwin-x64
drwxr-xr-x 11 jeroenp staff 352B Jul 21  2023 ms-toolsai.jupyter-keymap-1.1.2
drwxr-xr-x 13 jeroenp staff 416B Jul 30 23:19 ms-toolsai.jupyter-renderers-1.0.19
drwxr-xr-x 18 jeroenp staff 576B Mar 17  2023 ms-toolsai.vscode-jupyter-cell-tags-0.1.8
drwxr-xr-x 17 jeroenp staff 544B Feb  9  2023 ms-toolsai.vscode-jupyter-slideshow-0.1.5
drwxr-xr-x 19 jeroenp staff 608B Oct 29  2023 ms-vscode.powershell-2023.8.0
drwxr-xr-x 10 jeroenp staff 320B Jul 10  2018 patrys.vscode-code-outline-0.2.1
drwxr-xr-x 19 jeroenp staff 608B Oct 29  2023 searking.preview-vscode-2.2.5
drwxr-xr-x 15 jeroenp staff 480B Mar 22  2019 tht13.html-preview-vscode-0.2.5
drwxr-xr-x 13 jeroenp staff 416B Oct 29  2023 tyriar.sort-lines-1.11.0
drwxr-xr-x 14 jeroenp staff 448B Feb  6  2022 wosi.omnipascal-0.19.0
drwxr-xr-x 15 jeroenp staff 480B Oct 29  2023 yzane.markdown-pdf-1.5.0
drwxr-xr-x 18 jeroenp staff 576B Jan 16  2024 yzhang.markdown-all-in-one-3.6.2

Query: [WaybackSave/Archive] vscode list of extensions stored in file – Google Suche

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.