Visual Studio Code

From XennisWiki
Jump to: navigation, search

Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring. It is also customizable, so users can change the editor's theme, keyboard shortcuts, and preferences. It is free and open-source, although the official download is under a proprietary license. (Wikipedia)

Installation

Arch Linux

Install the code package.

Debian

Further information: Running VS Code on Linux

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
apt-get update
apt-get install code

Usage

Markdown

Press [Ctrl] + [Shift] + [V] to open Markdown preview. Or [Ctrl] + [K] and [v] to open side-by-side preview.

Plugins

Launch quick open by pressing [Ctrl] + [p] and enter ext install <plugin-name> to install a plugin.

  • Protocol Buffers: vscode-proto3
  • Flutter: Dart-Code.flutter

Go

Install the plugin vscode.Go.

Errors and problems

Error message
Rename failed: /usr/lib/go/src/os/user/C:18:21: expected type, found '=' (and 3 more errors) /usr/lib/go/src/net/C:18:25: expected type, found '=' (and 2 more errors) gorename: couldn't load packages due to errors: net, os/user
Solution
go get golang.org/x/tools/cmd/gorename

Errors and problems

Falling back to the standard locale

Possible error messages
(anon):12: character not in range
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_CTYPE = "en_US.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C")
Solution

Set the setting terminal.integrated.setLocaleVariables to true.

See also

External links