Installing VS Code extensions in your Domino environment

andrea.loweandrea.lowe Member, Moderator, Domino Posts: 27 mod

To persist VS Code extensions from one workspace session to the next you'll need to install these in a Domino compute environment using the following steps:

  1. Install it first via the VS Code GUI and check in "/home/ubuntu/.local/share/code-server/extensions/" for the full, proper name of the extension (e.g. ms-python.python-2019.3.6558)
  2. Search for your desired extension in the Visual Studio Marketplace and find the download button. The link will be obscured, but you can find it by clicking the link while your dev tools console is open. It should have the format: https://marketplace.visualstudio.com/_apis/public/gallery/publishers/<PUBLISHER>/vsextensions/<EXTENSION-NAME>/<VERSION>/vspackage (e.g. https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/2019.4.11987/vspackage).
  3. Add the following to your compute environment using the name of your package and the download URL. This downloads the extension, extracts the relevant part and adds it to the appropriate folder.
RUN apt-get update -y && \
    apt-get install -y bsdtar
 
# Install a SQL browser/run
RUN mkdir -p /home/ubuntu/.local/share/code-server/extensions/<name of extension>
RUN cd /home/ubuntu/.local/share/code-server/extensions/<name of extension> && \
    curl -JL <extension download URL> | bsdtar -xvf - extension
RUN mv /home/ubuntu/.local/share/code-server/extensions/<name of extension>/extension/* /home/ubuntu/.local/share/code-server/extensions/<name of extension>/
  
RUN chown ubuntu:ubuntu /home/ubuntu/.local/share/code-server/

EXAMPLE: To install sqltools (a plugin for that adds a database browser, sql execution window, results pane, etc) you would add the following to your environment Dockerfile:

RUN apt-get update -y && \
    apt-get install -y bsdtar
 
# Install a SQL browser/run
RUN mkdir -p /home/ubuntu/.local/share/code-server/extensions/mtxr.sqltools-0.15.1
RUN cd /home/ubuntu/.local/share/code-server/extensions/mtxr.sqltools-0.15.1 && \
    curl -JL https://marketplace.visualstudio.com/_apis/public/gallery/publishers/mtxr/vsextensions/sqltools/0.19.6/vspackage | bsdtar -xvf - extension
RUN mv /home/ubuntu/.local/share/code-server/extensions/mtxr.sqltools-0.15.1/extension/* /home/ubuntu/.local/share/code-server/extensions/mtxr.sqltools-0.15.1/
  
RUN chown ubuntu:ubuntu /home/ubuntu/.local/share/code-server/
Sign In or Register to comment.