Visual Studio Code - ArchWiki
(Redirected from VSCode ) Code is a cross-platform text editor developed by Microsoft, built on the Electron framework. Visual Studio Code is a binary distribution of the MIT-licensed Code - OSS repository, with Microsoft specific customizations and released under a proprietary license . For details on the mixed licensing, see this GitHub comment . There is also a community-driven, MIT-licensed binary release called VSCodium with telemetry disabled by default.
Installation The following flavors of Visual Studio Code are available: Code - OSS — Official Arch Linux open-source release. Ships a configuration enabling Open VSX . https://github.com/microsoft/vscode || code Visual Studio Code — Proprietary Microsoft-branded release. https://code.visualstudio.com/ || visual-studio-code-bin AUR VSCodium — Community open-source release. Nullifies telemetry in the source code [1] , also ships configuration with Open VSX. https://vscodium.com/ || vscodium AUR These different flavors are all built from the Code - OSS repository , but with different licensing and default configurations.
Notably, only the proprietary builds are permitted to use Microsoft's marketplace and use Microsoft proprietary extensions such as the OmniSharp C# Debugger . The latter is enforced by a handshake mechanism, and cannot be circumvented. For more info on the differences between open source and proprietary "Visual Studio Code" branded builds, consult the Code - OSS GitHub wiki . Extensions support One of Code's main strengths is its flexible API and rich extension ecosystem hosted on the Visual Studio Marketplace .
However, the terms of use of the marketplace only permit it to be used with the Microsoft branded releases. As a result, the Code - OSS source does not include a configured marketplace. The open-source releases above add the Open VSX extension registry, but this does not offer the same breadth of extensions. It is possible to bypass this limitation. Warning Some language extensions developed by Microsoft now strictly require the proprietary Visual Studio Code release to work [2] .
Tweaking product.json does not seem to help. Currently C/C++ and C# Dev Kit are known to be affected. Known workarounds are: ask the maintainer to upload its extension to the Open VSX registry ; add the Microsoft Visual Studio Code Marketplace by using code-marketplace AUR (or vscodium-marketplace AUR for VSCodium). The package installs a Pacman hook that patches product.json as shown in this Github comment after every package update.
Tip It is useful to enable a keyboard shortcut to reload the IDE when experimenting with changing product.json . Usage Run code to start the application (or codium for VSCodium). If for any reason you wish to launch multiple instances of Visual Studio Code, the -n flag can be used. Configuration Launch configuration Per-user configuration can be set in the following files. Note that this is specific to these packages, as they use a patched loader script that reads these options.
Using these files, one can add flags for Visual Studio Code , Electron , or Chromium . Package Location code ~/.config/code-flags.conf visual-studio-code-bin AUR ~/.config/code-flags.conf vscodium AUR Not supported Application configuration Note Packages like code-features AUR that patch product.json can override the nameShort and dataFolderName variables, making the below section inaccurate. VSC stores settings in $XDG_CONFIG_HOME/ nameShort /User/settings.json and the extension data in an XDG-nonstandard $HOME/ dataFolderName directory, using variables from product.json .
This translates to the following default paths in various versions: code stores settings in ~/.config/Code - OSS/User/settings.json and extensions in ~/.vscode-oss visual-studio-code-bin AUR stores settings in ~/.config/Code/User/settings.json and extensions in ~/.vscode vscodium AUR stores settings in ~/.config/VSCodium/User/settings.json and extensions in ~/.vscode-oss When migrating from Code to Codium (or vice versa), the settings directory can be copied or moved.
Since they share most of their codebase, the settings are compatible. Integrated terminal View > Integrated Terminal or Ctrl + ` opens up an integrated terminal. By default, Bash is used with no additional arguments, although this can be changed. terminal.integrated.shell.linux sets the default shell to be used and terminal.integrated.shellArgs.linux sets the arguments to be passed to the shell. Example: ~/.config/Code/User/settings.json "terminal.integrated.shell.linux": "/usr/bin/fish", "terminal.integrated.shellArgs.linux": ["-l","-d 3"] You might face weird prompts after setting the integrated shell arguments with an external terminal.
Remove the line to solve the problem or use an external terminal. External terminal If you are using Terminator as default terminal for Arch and you have an error on Visual Studio Code: Unable to launch debugger worker process (vsdbg) through the terminal. spawn truecolor ENOENT , you can change the terminal that will be used by Visual Studio to another terminal (e.g. gnome-terminal ). "terminal.external.linuxExec": "Your alternative terminal" sets the default terminal to be used for exec debug.
Example: ~/.config/Code/User/settings.json "terminal.external.linuxExec": "gnome-terminal" Running natively under Wayland Visual Studio Code uses Electron, see Wayland#Electron for more information on how to run it natively under Wayland. Keep in mind that some applications bring their own copy of Electron and will not read the standard Electron flags file. You can set flags separately in each application's configuration file . vscodium AUR does not load config files.
It provides a dedicated vscodium-wayland.desktop desktop entry file, which appears as "VSCodium - Wayland" in the menu. Native file dialog If using Plasma, by default VS Codium opens GTK file dialogs. To fix that, ensure that KDE desktop portal ( xdg-desktop-portal-kde ) is installed and set the GTK_USE_PORTAL=1 environment variable . Remote SSH The official "Remote - SSH" extension is not working with code (VSCode-OSS).
There are two options: install code-features AUR install the Open Remote-SSH extension (there is a PR to make it work with VSCode-OSS ). Troubleshooting Global menu not working in KDE/Plasma Visual Studio Code uses DBus to pass the menu to Plasma, try installing libdbusmenu-glib . [3] Unable to move items to trash By default, Electron applications use gio to delete files. kioclient5 is automatically selected instead if Plasma is detected.
Different trash implementations can be used by setting the ELECTRON_TRASH environment variable . For example, for deleting files using trash-cli : $ ELECTRON_TRASH=trash-cli code At the time of writing, Electron supports kioclient5 , kioclient , trash-cli , gio (default) and gvfs-trash (deprecated). More info is available at this documentation page . Unable to debug C# If you want to debug C# .NET (using the OmniSharp extension ) then you need to install the Microsoft branded release (from the AUR).
This is apparently because the .NET Core debugger is only licensed to be used with official Microsoft products - see this github discussion . When using the open-source package, debugging fails fairly quietly. The debug console will just show the initial message: You may only use the Microsoft .NET Core Debugger (vsdbg) with Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you develop and test your applications.
For debugging with the open-source package, netcoredbg AUR can be used. To run it in VS Code, add this configuration to .NET Core launch configuration of the project: ./.vscode/launch.json "configurations": [ { ... "pipeTransport": { "pipeCwd": "${workspaceFolder}", "pipeProgram": "/usr/bin/bash", "pipeArgs": ["-c"], "debuggerPath": "/usr/bin/netcoredbg" } ... This is stable, actively maintained, and the preferred method for open-source VS Code users.
If you run into the Failed c
The rest of this page is on the live site.