microsoft / microsoft/vscode-remote-release

"Code" CLI does not have advanced options while trying to install a .vsix extension on my remote Linux VM over the SSH session

Open
#2,749 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

remote
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

  • VSCode Version: 1.44.0
  • Local OS Version: MacOS Catalina (Version 10.15.2)
  • Remote OS Version:"14.04.6 LTS, Trusty Tahr"
  • Remote Extension/Connection Type: SSH/Docker/WSL

Steps to Reproduce:

  1. Build your VSCode extension on your Mac and test it using the debug steps as outlined here: https://www.digitalocean.com/community/tutorials/how-to-create-your-first-visual-studio-code-extension
  2. Create a .vsix file on your Mac by following the steps outlined here: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#packaging-extensions
  3. Now connect to your remote Linux server using the remote-ssh extension
  4. Using the Terminal as exposed by the VSCode client, try to issue the CLI "code --install-extension <path-to-.vsix-file>" and you see this error:
:~/workspace/restricted$ code --install-extension
/home/cohesity/.vscode-server/bin/2aae1f26c72891c399f860409176fe435a154b13
Ignoring option install-extension: not supported for code.
At least one file or folder must be provided.

Further, when I try to look at the --help options on the remote machine, I see this:

$ code --help
/home/cohesity/.vscode-server/bin/2aae1f26c72891c399f860409176fe435a154b13
code 1.44.0

Usage: code [options][paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | code -')

Options
  -d --diff <file> <file>           Compare two files with each other.
  -g --goto <file:line[:character]> Open a file at the path on the specified line and character position.
  -n --new-window                   Force to open a new window.
  -r --reuse-window                 Force to open a file or folder in an already opened window.
  --folder-uri <uri>                Opens a window with given folder uri(s)
  --file-uri <uri>                  Opens a window with given file uri(s)
  -w --wait                         Wait for the files to be closed before returning.
  -h --help                         Print usage.

Troubleshooting
  -v --version Print version.
  -s --status  Print process usage and diagnostics information.

However, on my Mac, I see the right set of options, for the same version of "code" (1.44.0):

% code --help
Visual Studio Code 1.44.0

Usage: code [options][paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | code -')

Options
  -d --diff <file> <file>           Compare two files with each other.
  -a --add <folder>                 Add folder(s) to the last active window.
  -g --goto <file:line[:character]> Open a file at the path on the specified line and character position.
  -n --new-window                   Force to open a new window.
  -r --reuse-window                 Force to open a file or folder in an already opened window.
  --folder-uri <uri>                Opens a window with given folder uri(s)
  --file-uri <uri>                  Opens a window with given file uri(s)
  -w --wait                         Wait for the files to be closed before returning.
  --locale <locale>                 The locale to use (e.g. en-US or zh-TW).
  --user-data-dir <dir>             Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of
                                    Code.
  -h --help                         Print usage.

Extensions Management
  --extensions-dir <dir>                            Set the root path for extensions.
  --list-extensions                                 List the installed extensions.
  --show-versions                                   Show versions of installed extensions, when using --list-extension.
  --category                                        Filters installed extensions by provided category, when using --list-extension.
  --install-extension <extension-id | path-to-vsix> Installs or updates the extension. Use `--force` argument to avoid prompts.
  --uninstall-extension <extension-id>              Uninstalls an extension.
  --enable-proposed-api <extension-id>              Enables proposed API features for extensions. Can receive one or more extension IDs to
                                                    enable individually.

Troubleshooting
  -v --version                       Print version.
  --verbose                          Print verbose output (implies --wait).
  --log <level>                      Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug',
                                     'trace', 'off'.
  -s --status                        Print process usage and diagnostics information.
  --prof-startup                     Run CPU profiler during startup
  --disable-extensions               Disable all installed extensions.
  --disable-extension <extension-id> Disable an extension.
  --sync <on> <off>                  Turn sync on or off
  --inspect-extensions <port>        Allow debugging and profiling of extensions. Check the developer tools for the connection URI.
  --inspect-brk-extensions <port>    Allow debugging and profiling of extensions with the extension host being paused after start. Check the
                                     developer tools for the connection URI.
  --disable-gpu                      Disable GPU hardware acceleration.
  --max-memory                       Max memory size for a window (in Mbytes).
  --telemetry                        Shows all telemetry events which VS code collects.

Further, I checked the output of "vsce package" and I do see all the npm packages being included.

Does this issue occur when you try this locally?: No (The 'code' CLI has all the options available on my Mac)
Does this issue occur when you try this locally and all extensions are disabled?: No

I looked at other bugs but could not find any issue that pointed towards a truncated set of options with the "code" CLI...

Another point to note: I did not have an active installation of VSCode on my remote machine. I just installed VSCode on my Mac and used the "Remote SSH" extension to help out with the installation of the VSCode server on that machine.

Any pointers on what I might be doing wrong would be really helpful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the remote code --help output from the VS Code Server installed through Remote SSH with the local VS Code CLI options shown in the issue. Reproduce code --install-extension <path-to-vsix-file> on the remote Linux VM and verify that the remote CLI exposes the extension-management option and installs the .vsix successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
cli, devtools, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.