eecs280staff / tutorials

Tools and tutorials
https://eecs280staff.github.io/tutorials/
Other
5 stars 4 forks source link

VS Code Install Extensions Command Ordering #148

Closed jamesjuett closed 1 year ago

jamesjuett commented 1 year ago

The commands to install VS Code extensions are in the wrong order (and I believe only recently is the ordering significant.)

Quick Version:

I believe everything is fixed if we change the ordering to:

code --install-extension ms-vscode-remote.remote-wsl
code --install-extension ms-vscode.cpptools

This installs WSL extension first, which ensures the subsequent C++ extension is installed on the WSL side as it should be.

Long Version:

For some context, once the WSL extension is installed, additional extensions like the C++ extension may be installed locally in Windows VS Code or remotely in WSL VS Code.

I think the problem is that running code from a bash terminal no longer installs the WSL extension automatically if it wasn't already installed. Instead, it will just affect the Windows VS Code, including installing extensions to there.

We give these commands to install and verify extensions:

image

It's unclear whether they should be run in PowerShell or in bash.

If they are run in Powershell, the effect is:

  1. Install C++ extension in Windows VS Code but not WSL VS Code
  2. Install WSL extension in Windows VS Code
  3. Listed extensions match what's show in the tutorial, but this is misleading since C++ extension is not installed in WSL VS Code.

If they are run in bash, the effect is:

  1. Install C++ extension in Windows VS Code
  2. Install WSL extension in Windows VS Code. Subsequent code commands begin to refer to WSL VS Code.
  3. Listed extensions do not include either shown in the tutorial, since no extensions have been installed in WSL VS Code.
  4. Student may try installing both again. Now C++ gets installed to WSL VS Code. A weird "dummy" remote WSL extension gets installed into WSL VS Code.
  5. Listed extensions match the tutorial.