VS Code
About
Visual Studio Code is built on the Electron framework, which allows developers to create desktop applications using web APIs, standards, and technologies like JavaScript, HTML, and CSS.
Electron essentially combines the Chromium rendering engine and the Node.js runtime, enabling the development of cross-platform applications.
Web APIs utilized by VS Code:
DOM APIs: Even though it's a desktop application, VS Code uses HTML and CSS for rendering its interface, which means it relies on the Document Object Model (DOM) APIs for dynamic content updates and UI manipulations.
Web Storage API: VS Code uses storage mechanisms like
localStorage
orsessionStorage
for persisting state and settings between sessions, similar to web applications.Fetch API/WebSockets: These are used for network communication. For instance, extensions in VS Code can use these APIs to communicate with external services, fetch data, or interact with web-based services.
Web Workers: These are used to run (javascript) scripts in background threads, allowing VS Code to perform heavy tasks without blocking the UI, enhancing performance and responsiveness.
Install
Windows methods ordered by preference:
- CLI: Chocolatey:
choco install vscode
- GUI: Download (
.msi
)
Add "Open with ..." to Explorer Context Menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
Disable Telemetry
@ Menu: File > Preferences > Settings > Search > telemetry
@ settings.JSON: "telemetry.enableTelemetry": "false",
If by GUI, adds: "telemetry.telemetryLevel": "off", (instead)
Depricated or Obsolete
VS Code has improved over the years. The following installation and configuration methods are no longer used or advised.
Install per User setup by downloading from MS site
VSCodeUserSetup-x64-v.vv.v.exe @ https://code.visualstudio.com/
- No Administrator privileges required
- Icons per filetype @ Window File Explorer
Chocolatey installs as System setup,
but okay to use choco upgrade if
a proper JUNCTION POINT
exists.
JUNCTION POINT
"%ProgramFiles%\VS-Code
"
is required by File Explorer REG entries, and by openedit.bat
:: @ System setup
symlink.bat j "%ProgramFiles%\VS-Code" "%ProgramFiles%\Microsoft VS Code"
:: @ User setup
symlink.bat j "%ProgramFiles%\VS-Code" "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code"
symlink.bat j "%ProgramFiles%\Microsoft VS Code" "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code"
v1.46.0, FAIL @ downloading Extensions, unless via VPN adapter.
"Unable to open extension ..."
FIX:
Enable IPv6 @ Gateway Router
IPv6 > Enable > Native
NOT FIX:
Set interface metric of TAP to higher number than desired interface. At PowerShell:
Get-NetIPInterface
Set-NetIPInterface -InterfaceIndex 19 -InterfaceMetric 100
NOT FIX:
Reset IPv6
ipconfig /flushdns
nbtstat –r
netsh int ip reset
netsh winsock reset
netsh winsock reset catalog
netsh int ipv6 reset reset.log
User interface
Shortcut Keys
CTRL + SHIFT + TAB Files [Cycle]
CTRL + P Files Menu
CTRL + F4 Close File
CTRL + ` Terminal [Toggle]
CTRL + , User Settings
CTRL + SHIFT + P Command Pallete
F11 Full Screen [Toggle]
Format Code [w/ Beautify extension installed]
SHIFT + ALT + F Windows
SHIFT + OPTION + F Mac
CTRL + SHIFT + I Ubuntu
User Settings (settings.json
)
%UserProfile%\AppData\Roaming\Code\User
Terminal (CTRL+
)
Uses Git-for-Windows, but invokes .bashrc
NOT .bash_profile
(@USERPROFILE
)
Extensions
To Rollback/Specify Version : Extensions side bar
> settings (icon) > "Install Another Version"
Vim
by vscodevim
File > Preferences > Keyboard Extensions > "Vim emulation ..."
ISSUE @ publisher:"vscodevim" https://github.com/Microsoft/vscode/issues/40260
Everytime we push an update, we always seem to see cases where the extension fails to load. The recommendation I've been giving folks is to delete
~/.vscode/extensions/vscodevim
and reinstall.
So, on fail, delete:
- @ Windows :
del %USERNAME%/.vscode/extensions/vscodevim.vim-*
- @ Linux :
rm ~/.vscode/extensions/vscodevim
and then reinstall.
Remote Development
by Microsoft
- Remote - SSH - Work with source code in any location by opening folders on a remote machine/VM using SSH. Supports x86_64, ARMv7l (AArch32), and ARMv8l (AArch64) glibc-based Linux, Windows 10/Server (1803+), and macOS 10.14+ (Mojave) SSH hosts.
- Remote - Tunnels - Work with source code in any location by opening folders on a remote machine/VM using a VS Code Tunnel (rather than SSH).
- Dev Containers - Work with a separate toolchain or container based application by opening any folder mounted into or inside a container.
- WSL - Get a Linux-powered development experience from the comfort of Windows by opening any folder in the Windows Subsystem for Linux.
Remote - WSL
DEPRICATED DO NOT INSTALL this extension
- It breaks paths by prepending drive path to absolute path,
so
code <FilePath>
fails to open the existing file. - It breaks the integration between WSL and Win; forcing WSL to use its own installed version; downloads and installs something on first run.
- It forces new app launch for each call.
- No method to disable the recurring, nagging pop up to install it.
Use WSL or broader Remote Development extension instead.
Go extension
Install from Git Bash [MINGW64]
Requires .git
folders of all Golang source intact,
else go get -u -v PKG
fails.
Install Golang unstall using Chocolatey,
which installs to C:\tools\go