blob: 0e59e055524ca7496a7fee4e66c8bfc8b5914ad8 [file] [log] [blame] [view]
ljustene262c842017-04-12 08:29:041# Visual Studio Code Dev
2
3Visual Studio Code is a free, lightweight and powerful code editor for Windows,
4Mac and Linux, based on Electron/Chromium. It has built-in support for
5JavaScript, TypeScript and Node.js and a rich extension ecosystem that adds
6intellisense, debugging, syntax highlighting etc. for many languages (C++,
Michael Thiessenf643e29f2020-03-24 20:23:017Python, Go, Java). It works without too much setup. Get started
ljustene262c842017-04-12 08:29:048[here](https://code.visualstudio.com/docs).
9
10It is NOT a full-fledged IDE like Visual Studio. The two are completely
11separate products. The only commonality with Visual Studio is that both are
12from Microsoft.
13
14Here's what works well:
15
16* Editing code works well especially when you get used to the [keyboard
17 shortcuts](https://code.visualstudio.com/docs/customization/keybindings).
18 VS Code is very responsive and can handle even big code bases like Chromium.
19* Git integration is a blast. Built-in side-by-side view, local commit and
20 even extensions for
21 [history](https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory)
22 and
23 [blame view](https://marketplace.visualstudio.com/items?itemName=ryu1kn.annotator).
24* [Debugging](https://code.visualstudio.com/Docs/editor/debugging) works
25 well, even though startup times can be fairly high (~40 seconds with
26 gdb on Linux, much lower on Windows). You can step through code, inspect
27 variables, view call stacks for multiple threads etc.
28* Opening files and searching solution-wide works well now after having
29 problems in earlier versions.
30* Building works well. Build tools are easy to integrate. Warnings and errors
31 are displayed on a separate page and you can click to jump to the
32 corresponding line of code.
Daniel Murphyd9e88fb2020-03-17 19:26:2333* VSCode Remote, which allows you to edit remotely-hosted code, and even run
34 computationally expensive plugins like vscode-clangd on the remote
35 server/workstation (see the [Remote section](#Remote)). Great for working-
James Cook3a415982020-03-25 18:47:3836 from-home. (Googlers: See [go/vscode-remote](http://go/vscode-remote)].)
chaopengba312ce2017-02-12 03:38:2537
chaopengca285112017-03-02 15:39:0438[TOC]
39
ljustene262c842017-04-12 08:29:0440## Updating This Page
chaopengba312ce2017-02-12 03:38:2541
ljustene262c842017-04-12 08:29:0442Please keep this doc up-to-date. VS Code is still in active development and
43subject to changes. This doc is checked into the Chromium git repo, so if you
44make changes, read the [documentation
James Cook9d7e2192017-06-19 19:59:0945guidelines](https://chromium.googlesource.com/chromium/src/+/master/docs/documentation_guidelines.md)
ljustene262c842017-04-12 08:29:0446and [submit a change list](https://www.chromium.org/developers/contributing-code).
chaopengba312ce2017-02-12 03:38:2547
ljustene262c842017-04-12 08:29:0448All file paths and commands have been tested on Linux. Windows and Mac might
49require a slightly different setup (e.g. `Ctrl` -> `Cmd`). Please update this
50page accordingly.
chaopengba312ce2017-02-12 03:38:2551
ljustene262c842017-04-12 08:29:0452## Setup
chaopengba312ce2017-02-12 03:38:2553
ljustene262c842017-04-12 08:29:0454### Installation
chaopengba312ce2017-02-12 03:38:2555
ljustene262c842017-04-12 08:29:0456Follow the steps on https://code.visualstudio.com/docs/setup/setup-overview. To
57run it on Linux, just navigate to `chromium/src` folder and type `code .` in a
58terminal. The argument to `code` is the base directory of the workspace. VS
59Code does not require project or solution files. However, it does store
60workspace settings in a `.vscode` folder in your base directory.
chaopengba312ce2017-02-12 03:38:2561
Mounir Lamouri1679feab2019-01-25 19:30:0362### Fixes for Known Issues
63
64#### Git on Windows
Mounir Lamouri8202f362019-01-14 11:48:2665
66If you only have the `depot_tools` Git installed on your machine, even though it
67is in your PATH, VS Code will ignore it as it seems to be looking for `git.exe`.
68You will have to add the following to your settings in order for the Git
69integration to work:
70
Mounir Lamouri1679feab2019-01-25 19:30:0371```json
Mounir Lamouri8202f362019-01-14 11:48:2672{
73 "git.path": "C:\\src\\depot_tools\\git.bat"
74}
75```
76
Mounir Lamouri1679feab2019-01-25 19:30:0377#### Rendering of underscore on Linux
78
79As mentioned in [#35901](https://github.com/Microsoft/vscode/issues/35901), VS
80Code will not show underscore (`_`) properly on Linux by default. You can work
81around this issue by forcing another font such as the default `monospace` or
82changing the font size in your settings:
83
84```json
85{
86 // If you want to use the default "monospace" font:
87 //"terminal.integrated.fontFamily": "monospace"
88 // If you would rather just increase the size of the font:
89 //"terminal.integrated.fontSize": 15
90 // If you would rather decrease the size of the font:
Mounir Lamouria1e5a9e2019-07-30 20:06:0091 //"terminal.integrated.fontSize": 13
Mounir Lamouri1679feab2019-01-25 19:30:0392}
93```
94
ljustene262c842017-04-12 08:29:0495### Useful Extensions
chaopengba312ce2017-02-12 03:38:2596
ljustene262c842017-04-12 08:29:0497Up to now, you have a basic version of VS Code without much language support.
98Next, we will install some useful extensions. Jump to the extensions window
99(`Ctrl+Shift+X`) and install these extensions, you will most likely use them
100every day:
chaopengba312ce2017-02-12 03:38:25101
ljustene262c842017-04-12 08:29:04102* ***C/C++*** -
Jesse McKennafffd8112020-05-08 19:18:48103 Code formatting, debugging, Intellisense. Enables the use of clang-format
104 (via the `C_Cpp.clang_format_path` setting) and format-on-save (via the
105 `editor.formatOnSave` setting).
ljustene262c842017-04-12 08:29:04106* ***Python*** -
107 Linting, intellisense, code formatting, refactoring, debugging, snippets.
James Cook9f7c73d2017-06-20 15:06:19108* ***Toggle Header/Source*** -
109 Toggles between .cc and .h with `F4`. The C/C++ extension supports this as
110 well through `Alt+O` but sometimes chooses the wrong file when there are
111 multiple files in the workspace that have the same name.
ljustene262c842017-04-12 08:29:04112* ***Protobuf support*** -
113 Syntax highlighting for .proto files.
Kenichi Ishibashib6d2e3b2020-04-22 18:16:07114* [***Mojom IDL support***](https://github.com/GoogleChromeLabs/mojom-language-support) -
115 Syntax highlighting and a
116 [language server](https://microsoft.github.io/language-server-protocol/)
117 for .mojom files. This isn't available on the VS Code marketplace for now.
118 You need to install it manually.
Jesse McKennafffd8112020-05-08 19:18:48119* ***vscode-clangd*** -
120 If you do not plan to use VSCode for debugging, vscode-clangd is a great
121 alternative to C/C++ IntelliSense. It knows about how to compile Chromium,
122 enabling it to provide smarter autocomplete than C/C++ IntelliSense as well
123 as allowing you to jump from functions to their definitions. See
124 [clangd.md](clangd.md) for setup instructions.
Tal Pressmanbcb58ae92020-06-02 23:36:10125 If you need to debug, enable C/C++ extension but set "C_Cpp: Intelli Sense Engine" to disabled,
126 and restart VSCode.
ljustene262c842017-04-12 08:29:04127* ***Rewrap*** -
128 Wrap lines at 80 characters with `Alt+Q`.
Daniel Murphyd9e88fb2020-03-17 19:26:23129* ***Remote*** -
130 Remotely connect to your workstation through SSH using your laptop. See the
131 [Remote](#Remote) section for more information about how to set this up.
chaopengba312ce2017-02-12 03:38:25132
ljustene262c842017-04-12 08:29:04133The following extensions might be useful for you as well:
chaopengba312ce2017-02-12 03:38:25134
ljustene262c842017-04-12 08:29:04135* ***Annotator*** -
136 Git blame view.
137* ***Git History (git log)*** -
138 Git history view.
139* ***chromium-codesearch*** -
Jesse McKennafffd8112020-05-08 19:18:48140 Mac and Linux only: adds ability to open the current line in [Chromium Code
141 Search](https://cs.chromium.org/). All other functionality is deprecated, so
142 currently only of limited usefulness.
ljustene262c842017-04-12 08:29:04143* ***change-case*** -
144 Quickly change the case of the current selection or current word.
145* ***Instant Markdown*** -
146 Instant markdown (.md) preview in your browser as you type. This document
147 was written with this extension!
Jesse McKennafffd8112020-05-08 19:18:48148* ***you-complete-me*** -
149 Alternative autocomplete extension. Can be configured to use a variety of
150 language servers, so helpful if not using clangd for code completion.
151 See [You-Complete-Me extension setup](#You-Complete-Me-extension-setup)
152 for additional setup instructions.
chaopengba312ce2017-02-12 03:38:25153
ljustene262c842017-04-12 08:29:04154Also be sure to take a look at the
Jesse McKennafffd8112020-05-08 19:18:48155[VS Code marketplace](https://marketplace.visualstudio.com/VSCode) to check out
156other useful extensions.
chaopengba312ce2017-02-12 03:38:25157
ljustene262c842017-04-12 08:29:04158### Color Scheme
159Press `Ctrl+Shift+P, color, Enter` to pick a color scheme for the editor. There
160are also tons of [color schemes available for download on the
161marketplace](https://marketplace.visualstudio.com/search?target=VSCode&category=Themes&sortBy=Downloads).
chaopengba312ce2017-02-12 03:38:25162
ljustene262c842017-04-12 08:29:04163### Usage Tips
164* `Ctrl+P` opens a search box to find and open a file.
165* `F1` or `Ctrl+Shift+P` opens a search box to find a command (e.g. Tasks: Run
166 Task).
167* `Ctrl+K, Ctrl+S` opens the key bindings editor.
168* ``Ctrl+` `` toggles the built-in terminal.
169* `Ctrl+Shift+M` toggles the problems view (linter warnings, compile errors
170 and warnings). You'll swicth a lot between terminal and problem view during
171 compilation.
172* `Alt+O` switches between the source/header file.
173* `Ctrl+G` jumps to a line.
174* `F12` jumps to the definition of the symbol at the cursor (also available on
175 right-click context menu).
176* `Shift+F12` or `F1, CodeSearchReferences, Return` shows all references of
177 the symbol at the cursor.
178* `F1, CodeSearchOpen, Return` opens the current file in Code Search.
179* `Ctrl+D` selects the word at the cursor. Pressing it multiple times
180 multi-selects the next occurrences, so typing in one types in all of them,
181 and `Ctrl+U` deselects the last occurrence.
182* `Ctrl+K, Z` enters Zen Mode, a fullscreen editing mode with nothing but the
183 current editor visible.
184* `Ctrl+X` without anything selected cuts the current line. `Ctrl+V` pastes
185 the line.
186
Michael Thiessenf643e29f2020-03-24 20:23:01187### Java/Android Support
188To get Java support in VS Code, you'll need to install the
189'Java Extension Pack' extension, but you'll want to immediately uninstall or
190disable the Maven for Java extension so it stops nagging you as we won't need
191it.
192
193#### Setting up code completion/reference finding/etc.
Mehran Mahmoudib96ca412020-03-25 21:48:14194You'll need to generate a placeholder .classpath file and locate it. In order
195to generate it, right click on any Java source folder in the left panel and
196choose "Add folder to java source path". Its location will depend on whether
197you're doing local or remote development. Local path on linux will look
198something like:
Michael Thiessenf643e29f2020-03-24 20:23:01199
200`~/.vscode/data/User/workspaceStorage/<hash>/redhat.java/jdt_ws/<project>/.classpath`
201
Mehran Mahmoudib96ca412020-03-25 21:48:14202You might find multiple folders when looking for `<project>`. Choose anything except
203`jdt.ls-java-project`. If you only see `jdt.ls-java-project`, try using the
204"Add folder to java source path" option again.
205
Michael Thiessenf643e29f2020-03-24 20:23:01206If doing remote development, the file will be under `~/.vscode-server/` on your
207remote machine.
208
Michael Thiessene057a6c2020-03-25 19:24:01209You'll need to replace all of the contents of that file with the contents of
210`tools/android/eclipse/.classpath` (external) or
211`clank/development/ide/eclipse/.classpath` (generated by gclient runhooks for
212Chrome developers), and then replace some paths as vscode interprets some paths
213differently from eclipse.
Michael Thiessenf643e29f2020-03-24 20:23:01214* Replace: `kind="src" path="` with `kind="src" path="_/`
Michael Thiessene057a6c2020-03-25 19:24:01215 * eg. `<classpathentry kind="src" path="_/android_webview/glue/java/src"/>`
Michael Thiessenf643e29f2020-03-24 20:23:01216* Replace: `kind="lib" path="../src` with `kind="lib" path="_`
Michael Thiessene057a6c2020-03-25 19:24:01217 * eg.
218`<classpathentry kind="lib" path="_/out/Debug/lib.java/base/base_java.jar"/>`
Michael Thiessenf643e29f2020-03-24 20:23:01219* Remove all nested paths (or exclude them from their parents). At time of
220writing:
221 * `third_party/android_protobuf/src/java/src/main/java`
222 * `third_party/junit/src/src/main/java`
223
Henry Jiandabdddf2020-03-26 17:59:39224Also, make sure
225`export ANDROID_HOME=/usr/local/google/home/{your_ldap}/Android/Sdk` is in the
226remote machine's `~/.bashrc`.
227
Michael Thiessenf643e29f2020-03-24 20:23:01228Then restart vscode, open a Java file, and wait for a bit.
229
Michael Thiessene057a6c2020-03-25 19:24:01230Debugging tips:
231* Right clicking on a folder in vscode and clicking "Add folder to java source
232path" will error if there are syntax problems with your classpath. (Don't use
233this actually add new paths to your classpath as it won't work correctly)
234 * If there are no syntax errors, ensure the correct .classpath file is being
235 used by seeing if the folder was actually added to the .classpath file you
236 edited.
237
ljustene262c842017-04-12 08:29:04238## Setup For Chromium
239
240VS Code is configured via JSON files. This paragraph contains JSON configuration
241files that are useful for Chromium development, in particular. See [VS Code
242documentation](https://code.visualstudio.com/docs/customization/overview) for an
243introduction to VS Code customization.
244
245### Workspace Settings
Darwin Huang985c38a2018-11-21 19:24:13246Open the file [//tools/vscode/settings.json5](/tools/vscode/settings.json5),
247and check out the default settings there. Feel free to commit added or removed
248settings to enable better team development, or change settings locally to suit
249personal preference. Remember to replace `<full_path_to_your_home>`! To use
250these settings wholesale, enter the following commands into your terminal while
251at the src directory:
ljustene262c842017-04-12 08:29:04252```
Darwin Huang985c38a2018-11-21 19:24:13253$ mkdir .vscode/
254$ cp tools/vscode/settings.json5 .vscode/settings.json
ljustene262c842017-04-12 08:29:04255```
256
Jesse McKennafffd8112020-05-08 19:18:48257Note: these settings assume that the workspace folder (the root folder displayed
258in the Explorer tab) is chromium/src. If this is not the case, replace any
259references to ${workspaceFolder} with the path to chromium/src.
260
ljustene262c842017-04-12 08:29:04261### Tasks
262Next, we'll tell VS Code how to compile our code and how to read warnings and
Darwin Huang985c38a2018-11-21 19:24:13263errors from the build output. Open the file
264[//tools/vscode/tasks.json5](/tools/vscode/tasks.json5). This will provide 5
265tasks to do basic things. You might have to adjust the commands to your
266situation and needs. To use these settings wholesale, enter the following
267command into your terminal:
ljustene262c842017-04-12 08:29:04268```
Darwin Huang985c38a2018-11-21 19:24:13269$ cp tools/vscode/tasks.json5 .vscode/tasks.json
ljustene262c842017-04-12 08:29:04270```
271
272### Launch Commands
273Launch commands are the equivalent of `F5` in Visual Studio: They launch some
274program or a debugger. Optionally, they can run some task defined in
275`tasks.json`. Launch commands can be run from the debug view (`Ctrl+Shift+D`).
Darwin Huang985c38a2018-11-21 19:24:13276Open the file at [//tools/vscode/launch.json5](/tools/vscode/launch.json5) and
Jesse McKenna37eceb82020-06-02 00:03:50277adjust the example launch commands to your situation and needs (e.g., the value
278of "type" needs adjustment for Windows). To use these settings wholesale, enter
279the following command into your terminal:
ljustene262c842017-04-12 08:29:04280```
Darwin Huang985c38a2018-11-21 19:24:13281$ cp tools/vscode/launch.json5 .vscode/launch.json
ljustene262c842017-04-12 08:29:04282```
283
284### Key Bindings
285To edit key bindings, press `Ctrl+K, Ctrl+S`. You'll see the defaults on the
286left and your overrides on the right stored in the file `keybindings.json`. To
287change a key binding, copy the corresponding key binding to the right. It's
288fairly self-explanatory.
289
290You can bind any command to a key, even commands specified by extensions like
291`CodeSearchOpen`. For instance, to bind `CodeSearchOpen` to `F2` to , simply add
292`{ "key": "F2", "command": "cs.open" },`.
293Note that the command title `CodeSearchOpen` won't work. You have to get the
294actual command name from the [package.json
295file](https://github.com/chaopeng/vscode-chromium-codesearch/blob/master/package.json)
296of the extension.
297
298If you are used to other editors, you can also install your favorite keymap.
299For instance, to install eclipse keymaps, install the
300`vscode-eclipse-keybindings` extension. More keymaps can be found
301[in the marketplace](https://marketplace.visualstudio.com/search?target=vscode&category=Keymaps).
302
Darwin Huang985c38a2018-11-21 19:24:13303Some key bindings that are likely to be useful for you are available at
304[//tools/vscode/keybindings.json5](/tools/vscode/keybindings.json5). Please
305take a look and adjust them to your situation and needs. To use these settings
306wholesale, enter the following command into your terminal:
ljustene262c842017-04-12 08:29:04307```
Darwin Huang985c38a2018-11-21 19:24:13308$ cp tools/vscode/keybindings.json5 .vscode/keybindings.json
ljustene262c842017-04-12 08:29:04309```
310
Daniel Murphyd9e88fb2020-03-17 19:26:23311### Remote
312VSCode now has a
313[Remote](https://code.visualstudio.com/docs/remote/remote-overview) framework
314that allows you to use VSCode on your laptop while your code is hosted
315elsewhere. This really shines when used in conjunction with the vscode-clangd plugin,
316which allows clangd to run remotely as well.
317
318To get this to run, install the Remote pack extension, and then make sure your
319ssh config file has your remote connection:
320
321`~/.ssh/config`:
322```
323Host my-connection
324 HostName my-remote-host.corp.company.com
325```
326
327VSCode will then list this connection in the 'Remote Explorer' section on the
328left. To launch VSCode with this connection, click on the '+window' icon next
329to the listed hostname. It has you choose a folder - use the 'src' folder root.
330This will open a new VSCode window in 'Remote' mode. ***Now you can install
331extensions specifically for your remote connection, like vscode-clangd, etc.***
332
Peter Wen3ba91202020-06-17 15:56:54333#### Chromebooks
334
335For Googlers, [here](http://go/vscode/remote_development_via_web) are
336Google-specific instructions for setting up remote development on chromebooks
337without using Crostini.
338
Daniel Murphyd9e88fb2020-03-17 19:26:23339#### Windows & SSH
340This currently is difficult on Windows because VSCode remote tools assumes
341'sshd' is installed, which isn't the case on Windows. If someone figures out
342how to get vscode remote working on windows with ssh please update this
343document :)
344
Dan Harringtonb06ce2f2019-04-09 15:35:29345### Snippets
346There are some useful snippets provided in
347[//tools/vscode/cpp.json5](/tools/vscode/cpp.json5).
348
Mounir Lamouri3b9e31d2019-07-30 20:14:41349You can either install them in your user profile (path may vary depending on the
350platform):
351```
352$ cp tools/vscode/cpp.json5 ~/.config/Code/User/snippets/cpp.json
353```
354
355Or install them as project snippets after installing the [Project
356Snippets](https://marketplace.visualstudio.com/items?itemName=rebornix.project-snippets)
357extension:
358```
359$ cp tools/vscode/cpp.json5 .vscode/snippets/cpp.json
360```
361
ljustene262c842017-04-12 08:29:04362### Tips
363
364#### The `out` folder
365Automatically generated code is put into a subfolder of out/, which means that
366these files are ignored by VS Code (see files.exclude above) and cannot be
Christian Dullweberd67c9b32018-04-03 08:30:42367opened e.g. from quick-open (`Ctrl+P`).
368As of version 1.21, VS Code does not support negated glob commands, but you can
369define a set of exclude pattern to include only out/Debug/gen:
Christian Dullweberbabb96e12018-05-28 14:00:14370```
Christian Dullweberd67c9b32018-04-03 08:30:42371"files.exclude": {
372 // Ignore build output folders. Except out/Debug/gen/
373 "out/[^D]*/": true,
374 "out/Debug/[^g]*": true,
375 "out/Debug/g[^e]*": true,
376 "out_*/**": true,
377},
Christian Dullweberbabb96e12018-05-28 14:00:14378```
Christian Dullweberd67c9b32018-04-03 08:30:42379
380Once it does, you can use
ljustene262c842017-04-12 08:29:04381```
382"!out/Debug/gen/**": true
383```
384in files.exclude instead of the symlink.
385
386#### Using VS Code as git editor
387Add `[core] editor = "code --wait"` to your `~/.gitconfig` file in order to use
388VS Code as editor for git commit messages etc. Note that the editor starts up
389significantly slower than nano or vim. To use VS Code as merge tool, add
390`[merge] tool = code`.
391
392#### Task Names
393Note that we named the tasks `1-build_chrome_debug`, `2-build_chrome_release`
394etc. This allows you to quickly execute tasks by pressing their number:
395Press `Ctrl+P` and enter `task <n>`, where `<n>` is the number of the task. You
396can also create a keyboard shortcut for running a task. `File > Preferences >
397Keyboard Shortcuts` and add `{ "key": "ctrl+r", "command":
398"workbench.action.tasks.runTask", "when": "!inDebugMode" }`. Then it's
399sufficient to press `Ctrl+R` and enter `<n>`.
400
401#### Working on Laptop
402Because autocomplete is provided by the You-Complete-Me extension, consider
403disabling C/C++ autocomplete and indexing to save battery. In addition, you
404might want to disable git status autorefresh as well.
chaopengca285112017-03-02 15:39:04405
406```
chaopeng5c66dfe2017-03-22 13:51:45407"git.autorefresh": false,
chaopengca285112017-03-02 15:39:04408"C_Cpp.autocomplete": "Disabled",
chaopengca285112017-03-02 15:39:04409```
410
Jianpeng Chaob4048b82018-08-28 23:40:01411### Unable to open $File resource is not available when debugging Chromium on Linux
412Chromium [recently changed](https://docs.google.com/document/d/1OX4jY_bOCeNK7PNjVRuBQE9s6BQKS8XRNWGK8FEyh-E/edit?usp=sharing)
413the file path to be relative to the output dir. Check
414`gn args out/$dir --list` if `strip_absolute_paths_from_debug_symbols` is true (which is the default),
415set `cwd` to the output dir. otherwise, set `cwd` to `${workspaceRoot}`.
416
Jesse McKennafffd8112020-05-08 19:18:48417### You-Complete-Me extension setup
418If using the You-Complete-Me extension, complete its installation by entering
419these commands in a terminal:
420
421```
422$ git clone https://github.com/Valloric/ycmd.git ~/.ycmd
423$ cd ~/.ycmd
424$ git submodule update --init --recursive
425$ ./build.py --clang-completer
426```
427If it fails with "Your C++ compiler does NOT fully support C++11." but you know
428you have a good compiler, hack cpp/CMakeLists.txt to set CPP11_AVAILABLE true.
429
430On Mac, replace the last command above with the following.
431
432```
433$ ./build.py --clang-completer --system-libclang
434```
435
436On Windows, if depot_tools' Python is the only one installed, a separate Python
4373 install is needed. The last command should then be run as follows.
438
439```
440> <Python 3 directory>/python.exe build.py --clang-completer
441```
442
chaopengba312ce2017-02-12 03:38:25443### More
ljustene262c842017-04-12 08:29:04444More tips and tricks can be found
sangwoo.ko5fe74c732017-09-01 14:44:56445[here](https://github.com/Microsoft/vscode-tips-and-tricks/blob/master/README.md).