ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 1 | # Visual Studio Code Dev |
| 2 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 3 | **Get started [here](#setup)**. |
| 4 | |
| 5 | [Visual Studio Code (VS Code)](https://code.visualstudio.com) is a free, |
| 6 | open source, lightweight and powerful code editor for Windows, Mac and Linux, |
| 7 | based on [Electron](https://www.electronjs.org/)/Chromium. |
| 8 | It has built-in support for JavaScript, TypeScript and Node.js and a rich |
| 9 | extension ecosystem that adds intellisense, debugging, syntax highlighting etc. |
| 10 | For many languages like C++, Python, Go, Java, it works without too much setup. |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 11 | |
| 12 | It is NOT a full-fledged IDE like Visual Studio. The two are completely |
| 13 | separate products. The only commonality with Visual Studio is that both are |
| 14 | from Microsoft. |
| 15 | |
| 16 | Here's what works well: |
| 17 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 18 | * **Editing code** works well especially when you get used to the [keyboard |
| 19 | shortcuts](#Keyboard-Shortcuts). VS Code is very responsive and can handle |
| 20 | even big code bases like Chromium. |
| 21 | * **Git integration** is a blast. Built-in side-by-side view, local commit and |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 22 | even extensions for |
| 23 | [history](https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory) |
| 24 | and |
| 25 | [blame view](https://marketplace.visualstudio.com/items?itemName=ryu1kn.annotator). |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 26 | * [**Debugging**](https://code.visualstudio.com/Docs/editor/debugging) works |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 27 | well, even though startup times can be fairly high (~40 seconds with |
| 28 | gdb on Linux, much lower on Windows). You can step through code, inspect |
| 29 | variables, view call stacks for multiple threads etc. |
Ryan Heise | 9a71143 | 2020-10-14 23:55:39 | [diff] [blame] | 30 | * For more information on debugging Python code, see [here](vscode_python.md). |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 31 | * **Command Palette** makes opening files and searching solution really easy. |
| 32 | * **Building** works well. Build tools are easy to integrate. Warnings and errors |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 33 | are displayed on a separate page and you can click to jump to the |
| 34 | corresponding line of code. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 35 | * **VS Code Remote**, which allows you to edit remotely-hosted code, and even |
| 36 | run computationally expensive plugins like vscode-clangd on the remote |
| 37 | server. Great for working from home. See the [Remote section](#Remote) for |
| 38 | more details. |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 39 | |
chaopeng | ca28511 | 2017-03-02 15:39:04 | [diff] [blame] | 40 | [TOC] |
| 41 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 42 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 43 | ## Updating This Page |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 44 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 45 | Please keep this doc up-to-date. VS Code is still in active development and |
| 46 | subject to changes. This doc is checked into the Chromium git repo, so if you |
| 47 | make changes, read the [documentation |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 48 | guidelines](documentation_guidelines.md) and |
| 49 | [submit a change list](contributing.md). |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 50 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 51 | All file paths and commands have been tested on Linux. Windows and Mac might |
| 52 | require a slightly different setup (e.g. `Ctrl` -> `Cmd`). Please update this |
| 53 | page accordingly. |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 54 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 55 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 56 | ## Setup |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 57 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 58 | ### Installation |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 59 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 60 | *** promo |
| 61 | Googlers: See [go/vscode/install](http://go/vscode/install). |
| 62 | *** |
| 63 | |
| 64 | Follow the steps on [Setting up Visual Studio Code](https://code.visualstudio.com/docs/setup/setup-overview). |
| 65 | |
| 66 | ### Usage |
| 67 | |
| 68 | To run it on Linux, just navigate to Chromium's `src` folder and type `code .` |
| 69 | in a terminal. The argument to `code` is the base directory of the workspace. VS |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 70 | Code does not require project or solution files. However, it does store |
| 71 | workspace settings in a `.vscode` folder in your base directory. |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 72 | |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 73 | If you installed Code Insiders, the binary name is `code-insiders` instead. |
| 74 | |
Mounir Lamouri | 1679feab | 2019-01-25 19:30:03 | [diff] [blame] | 75 | ### Fixes for Known Issues |
| 76 | |
| 77 | #### Git on Windows |
Mounir Lamouri | 8202f36 | 2019-01-14 11:48:26 | [diff] [blame] | 78 | |
| 79 | If you only have the `depot_tools` Git installed on your machine, even though it |
| 80 | is in your PATH, VS Code will ignore it as it seems to be looking for `git.exe`. |
| 81 | You will have to add the following to your settings in order for the Git |
| 82 | integration to work: |
| 83 | |
Mounir Lamouri | 1679feab | 2019-01-25 19:30:03 | [diff] [blame] | 84 | ```json |
Mounir Lamouri | 8202f36 | 2019-01-14 11:48:26 | [diff] [blame] | 85 | { |
| 86 | "git.path": "C:\\src\\depot_tools\\git.bat" |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 87 | |
| 88 | // more settings here... |
Mounir Lamouri | 8202f36 | 2019-01-14 11:48:26 | [diff] [blame] | 89 | } |
| 90 | ``` |
| 91 | |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 92 | Tip: you can jump to the settings JSON file by using `Ctrl+Shift+P` and using |
| 93 | the "Preferences: Open User Settings (JSON)" verb (for whatever reason, setting |
| 94 | `git.path` as a folder setting does not appear to work). |
| 95 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 96 | ### Useful Extensions |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 97 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 98 | Up to now, you have a basic version of VS Code without much language support. |
| 99 | Next, we will install some useful extensions. Jump to the extensions window |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 100 | (`Ctrl+Shift+X`) and install the extensions, or run the following commands. |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 101 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 102 | You will most likely use the following extensions every day: |
| 103 | |
| 104 | ```bash |
| 105 | $ echo "ms-vscode.cpptools llvm-vs-code-extensions.vscode-clangd ms-python.python bbenoist.togglehs peterj.proto Google.vscode-mojom npclaudiu.vscode-gn stkb.rewrap ms-vscode-remote.remote-ssh eamodio.gitlens" | xargs -n 1 code --install-extension --force |
| 106 | ``` |
| 107 | |
| 108 | * [**C/C++**](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) - |
Jesse McKenna | fffd811 | 2020-05-08 19:18:48 | [diff] [blame] | 109 | Code formatting, debugging, Intellisense. Enables the use of clang-format |
| 110 | (via the `C_Cpp.clang_format_path` setting) and format-on-save (via the |
| 111 | `editor.formatOnSave` setting). |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 112 | * [**vscode-clangd**](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) - |
| 113 | Enables VS Code to compile Chromium, provide Chromium XRefs to support |
| 114 | functions like jumping to definition, and provide smarter autocompletion |
| 115 | than **C/C++** extension's IntelliSense, but they also conflicts with each |
| 116 | other. To resolve the conflict, add the following to `settings.json`: |
| 117 | `"C_Cpp.intelliSenseEngine": "Disabled"`. See [clangd.md](clangd.md) for |
| 118 | setup instructions. |
| 119 | * [**Python**](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 120 | Linting, intellisense, code formatting, refactoring, debugging, snippets. |
Peter Wen | a7551d96b | 2022-05-30 17:21:22 | [diff] [blame] | 121 | * If you want type checking, add: `"python.analysis.typeCheckingMode": "basic",` |
| 122 | to your `settings.json` file (you can also find it in the settings UI). |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 123 | * [**Toggle Header/Source**](https://marketplace.visualstudio.com/items?itemName=bbenoist.togglehs) - |
James Cook | 9f7c73d | 2017-06-20 15:06:19 | [diff] [blame] | 124 | Toggles between .cc and .h with `F4`. The C/C++ extension supports this as |
| 125 | well through `Alt+O` but sometimes chooses the wrong file when there are |
| 126 | multiple files in the workspace that have the same name. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 127 | * [**Protobuf support**](https://marketplace.visualstudio.com/items?itemName=peterj.proto) - |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 128 | Syntax highlighting for .proto files. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 129 | * [**Mojom IDL support**](https://marketplace.visualstudio.com/items?itemName=Google.vscode-mojom) - |
Kenichi Ishibashi | b6d2e3b | 2020-04-22 18:16:07 | [diff] [blame] | 130 | Syntax highlighting and a |
| 131 | [language server](https://microsoft.github.io/language-server-protocol/) |
Kenichi Ishibashi | 93c7b8e | 2021-11-05 05:42:23 | [diff] [blame] | 132 | for .mojom files. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 133 | * [**GN**](https://marketplace.visualstudio.com/items?itemName=npclaudiu.vscode-gn) - |
| 134 | Syntax highlighting for .gn files. |
| 135 | * [**Rewrap**](https://marketplace.visualstudio.com/items?itemName=stkb.rewrap) - |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 136 | Wrap lines at 80 characters with `Alt+Q`. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 137 | * [**Remote**](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) - |
Daniel Murphy | d9e88fb | 2020-03-17 19:26:23 | [diff] [blame] | 138 | Remotely connect to your workstation through SSH using your laptop. See the |
| 139 | [Remote](#Remote) section for more information about how to set this up. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 140 | * [**GitLens**](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) - |
| 141 | Git supercharged. A Powerful, feature rich, and highly customizable git |
| 142 | extension. |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 143 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 144 | The following extensions might be useful for you as well: |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 145 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 146 | ```bash |
| 147 | $ echo "wmaurer.change-case shd101wyy.markdown-preview-enhanced Gruntfuggly.todo-tree alefragnani.Bookmarks spmeesseman.vscode-taskexplorer streetsidesoftware.code-spell-checker tht13.html-preview-vscode anseki.vscode-color" | xargs -n 1 code --install-extension --force |
| 148 | ``` |
| 149 | |
| 150 | * **chromium-codesearch** - |
Jesse McKenna | fffd811 | 2020-05-08 19:18:48 | [diff] [blame] | 151 | Mac and Linux only: adds ability to open the current line in [Chromium Code |
| 152 | Search](https://cs.chromium.org/). All other functionality is deprecated, so |
| 153 | currently only of limited usefulness. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 154 | * [**change-case**](https://marketplace.visualstudio.com/items?itemName=wmaurer.change-case) - |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 155 | Quickly change the case of the current selection or current word. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 156 | * [**Markdown Preview Enhanced**](https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced) - |
| 157 | Preview markdown side-by-side with automatic scroll sync and many other |
| 158 | features with `ctrl+k v`. This document was written with this extension! |
| 159 | * [**Todo Tree**](https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree) - |
| 160 | Displays comment tags like TODO/FIXME in a tree view in a dedicated sidebar. |
| 161 | * [**Bookmarks**](https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks) - |
| 162 | Supports easy mark/unmark positions in the codebase and displays them in a |
| 163 | dedicated sidebar. Very useful for a large codebase like Chromium. |
| 164 | * [**Task Explorer**](https://marketplace.visualstudio.com/items?itemName=spmeesseman.vscode-taskexplorer) - |
| 165 | Displays supported tasks, e.g. vscode tasks, shell scripts and others, |
| 166 | organized into a treeview in sidebar. |
| 167 | * [**Code Spell Checker**](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) - |
| 168 | A basic spell checker that works well with camelCase code. It helps catch |
| 169 | common spelling errors. |
| 170 | * [**HTML Preview**](https://marketplace.visualstudio.com/items?itemName=tht13.html-preview-vscode) - |
| 171 | Previews HTML files while editing with `ctrl+k v`. |
| 172 | * [**Color Picker**](https://marketplace.visualstudio.com/items?itemName=anseki.vscode-color) - |
| 173 | Visualizes color codes inline and provides color picker GUI to generates new |
| 174 | color codes. |
| 175 | |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 176 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 177 | Also be sure to take a look at the |
Jesse McKenna | fffd811 | 2020-05-08 19:18:48 | [diff] [blame] | 178 | [VS Code marketplace](https://marketplace.visualstudio.com/VSCode) to check out |
| 179 | other useful extensions. |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 180 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 181 | ### Color Scheme |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 182 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 183 | Press `Ctrl+Shift+P, color, Enter` to pick a color scheme for the editor. There |
| 184 | are also tons of [color schemes available for download on the |
| 185 | marketplace](https://marketplace.visualstudio.com/search?target=VSCode&category=Themes&sortBy=Downloads). |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 186 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 187 | ### Keyboard Shortcuts |
| 188 | |
| 189 | #### CheatSheet |
| 190 | |
| 191 | * [Windows](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf) |
| 192 | * [Mac](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf) |
| 193 | |
| 194 | #### Useful Shortcuts |
| 195 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 196 | * `Ctrl+P` opens a search box to find and open a file. |
| 197 | * `F1` or `Ctrl+Shift+P` opens a search box to find a command (e.g. Tasks: Run |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 198 | Task). Note: if you want to run one of the [Predefined tasks in |
| 199 | tasks.json](#Tasks), it is faster to just use `Ctrl+P` > "task <n>". |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 200 | * `Ctrl+K, Ctrl+S` opens the key bindings editor. |
| 201 | * ``Ctrl+` `` toggles the built-in terminal. |
| 202 | * `Ctrl+Shift+M` toggles the problems view (linter warnings, compile errors |
Quinten Yearsley | 317532d | 2021-10-20 17:10:31 | [diff] [blame] | 203 | and warnings). You'll switch a lot between terminal and problem view during |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 204 | compilation. |
| 205 | * `Alt+O` switches between the source/header file. |
| 206 | * `Ctrl+G` jumps to a line. |
| 207 | * `F12` jumps to the definition of the symbol at the cursor (also available on |
| 208 | right-click context menu). |
| 209 | * `Shift+F12` or `F1, CodeSearchReferences, Return` shows all references of |
| 210 | the symbol at the cursor. |
| 211 | * `F1, CodeSearchOpen, Return` opens the current file in Code Search. |
| 212 | * `Ctrl+D` selects the word at the cursor. Pressing it multiple times |
| 213 | multi-selects the next occurrences, so typing in one types in all of them, |
| 214 | and `Ctrl+U` deselects the last occurrence. |
| 215 | * `Ctrl+K, Z` enters Zen Mode, a fullscreen editing mode with nothing but the |
| 216 | current editor visible. |
| 217 | * `Ctrl+X` without anything selected cuts the current line. `Ctrl+V` pastes |
| 218 | the line. |
| 219 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 220 | *** aside |
| 221 | Note: See also [Key Bindings for Visual Studio Code |
| 222 | ](https://code.visualstudio.com/docs/getstarted/keybindings). |
| 223 | *** |
| 224 | |
Michael Thiessen | f643e29f | 2020-03-24 20:23:01 | [diff] [blame] | 225 | ### Java/Android Support |
Victor Hugo Vianna Silva | c37c9b7 | 2021-10-28 00:32:32 | [diff] [blame] | 226 | |
| 227 | *Before anything*, add these to your settings.json. |
| 228 | ``` |
| 229 | // LightWeight is the language support, the feature we care about. The other |
| 230 | // modes include build functionality with Maven and Gradle. They try to build |
| 231 | // on their own and end up showing thousands of errors. |
| 232 | "java.server.launchMode": "LightWeight", |
| 233 | // Avoids overwriting the custom .classpath file (c.f. next section). |
| 234 | "java.configuration.updateBuildConfiguration": "disabled", |
| 235 | ``` |
| 236 | Then install the "Language Support for Java" extension. If you installed it |
| 237 | before setting the configs above, uninstall, delete the <project> folder (c.f. |
| 238 | next section) and reinstall. You also don't need any of the remaining extensions |
| 239 | in "Extension Pack for Java". |
Michael Thiessen | f643e29f | 2020-03-24 20:23:01 | [diff] [blame] | 240 | |
| 241 | #### Setting up code completion/reference finding/etc. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 242 | |
Mehran Mahmoudi | b96ca41 | 2020-03-25 21:48:14 | [diff] [blame] | 243 | You'll need to generate a placeholder .classpath file and locate it. In order |
| 244 | to generate it, right click on any Java source folder in the left panel and |
| 245 | choose "Add folder to java source path". Its location will depend on whether |
| 246 | you're doing local or remote development. Local path on linux will look |
| 247 | something like: |
Michael Thiessen | f643e29f | 2020-03-24 20:23:01 | [diff] [blame] | 248 | |
| 249 | `~/.vscode/data/User/workspaceStorage/<hash>/redhat.java/jdt_ws/<project>/.classpath` |
| 250 | |
Mehran Mahmoudi | b96ca41 | 2020-03-25 21:48:14 | [diff] [blame] | 251 | You might find multiple folders when looking for `<project>`. Choose anything except |
| 252 | `jdt.ls-java-project`. If you only see `jdt.ls-java-project`, try using the |
| 253 | "Add folder to java source path" option again. |
| 254 | |
Michael Thiessen | f643e29f | 2020-03-24 20:23:01 | [diff] [blame] | 255 | If doing remote development, the file will be under `~/.vscode-server/` on your |
| 256 | remote machine. |
| 257 | |
Michael Thiessen | e057a6c | 2020-03-25 19:24:01 | [diff] [blame] | 258 | You'll need to replace all of the contents of that file with the contents of |
| 259 | `tools/android/eclipse/.classpath` (external) or |
| 260 | `clank/development/ide/eclipse/.classpath` (generated by gclient runhooks for |
| 261 | Chrome developers), and then replace some paths as vscode interprets some paths |
| 262 | differently from eclipse. |
Michael Thiessen | f643e29f | 2020-03-24 20:23:01 | [diff] [blame] | 263 | * Replace: `kind="src" path="` with `kind="src" path="_/` |
Michael Thiessen | e057a6c | 2020-03-25 19:24:01 | [diff] [blame] | 264 | * eg. `<classpathentry kind="src" path="_/android_webview/glue/java/src"/>` |
Michael Thiessen | f643e29f | 2020-03-24 20:23:01 | [diff] [blame] | 265 | * Replace: `kind="lib" path="../src` with `kind="lib" path="_` |
Michael Thiessen | e057a6c | 2020-03-25 19:24:01 | [diff] [blame] | 266 | * eg. |
| 267 | `<classpathentry kind="lib" path="_/out/Debug/lib.java/base/base_java.jar"/>` |
Michael Thiessen | f643e29f | 2020-03-24 20:23:01 | [diff] [blame] | 268 | * Remove all nested paths (or exclude them from their parents). At time of |
| 269 | writing: |
| 270 | * `third_party/android_protobuf/src/java/src/main/java` |
| 271 | * `third_party/junit/src/src/main/java` |
| 272 | |
Henry Jian | dabdddf | 2020-03-26 17:59:39 | [diff] [blame] | 273 | Also, make sure |
| 274 | `export ANDROID_HOME=/usr/local/google/home/{your_ldap}/Android/Sdk` is in the |
| 275 | remote machine's `~/.bashrc`. |
| 276 | |
Michael Thiessen | f643e29f | 2020-03-24 20:23:01 | [diff] [blame] | 277 | Then restart vscode, open a Java file, and wait for a bit. |
| 278 | |
Michael Thiessen | e057a6c | 2020-03-25 19:24:01 | [diff] [blame] | 279 | Debugging tips: |
| 280 | * Right clicking on a folder in vscode and clicking "Add folder to java source |
| 281 | path" will error if there are syntax problems with your classpath. (Don't use |
| 282 | this actually add new paths to your classpath as it won't work correctly) |
| 283 | * If there are no syntax errors, ensure the correct .classpath file is being |
| 284 | used by seeing if the folder was actually added to the .classpath file you |
| 285 | edited. |
| 286 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 287 | ## Setup For Chromium |
| 288 | |
| 289 | VS Code is configured via JSON files. This paragraph contains JSON configuration |
| 290 | files that are useful for Chromium development, in particular. See [VS Code |
| 291 | documentation](https://code.visualstudio.com/docs/customization/overview) for an |
| 292 | introduction to VS Code customization. |
| 293 | |
| 294 | ### Workspace Settings |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 295 | |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 296 | Open the file [//tools/vscode/settings.json](/tools/vscode/settings.json), |
Darwin Huang | 985c38a | 2018-11-21 19:24:13 | [diff] [blame] | 297 | and check out the default settings there. Feel free to commit added or removed |
| 298 | settings to enable better team development, or change settings locally to suit |
| 299 | personal preference. Remember to replace `<full_path_to_your_home>`! To use |
| 300 | these settings wholesale, enter the following commands into your terminal while |
| 301 | at the src directory: |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 302 | ```bash |
Darwin Huang | 985c38a | 2018-11-21 19:24:13 | [diff] [blame] | 303 | $ mkdir .vscode/ |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 304 | $ cp tools/vscode/settings.json .vscode |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 305 | ``` |
| 306 | |
Jesse McKenna | fffd811 | 2020-05-08 19:18:48 | [diff] [blame] | 307 | Note: these settings assume that the workspace folder (the root folder displayed |
Bartek Nowierski | fa835f8c | 2021-02-24 00:36:02 | [diff] [blame] | 308 | in the Explorer tab) is Chromium's `src/` directory. If this is not the case, |
| 309 | replace any references to ${workspaceFolder} with the path to your `src/`. |
Jesse McKenna | fffd811 | 2020-05-08 19:18:48 | [diff] [blame] | 310 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 311 | ### Tasks |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 312 | |
Dan Harrington | b426cf9b | 2020-09-10 19:47:08 | [diff] [blame] | 313 | Next, we'll tell VS Code how to compile our code, run tests, and to read |
| 314 | warnings and errors from the build output. Open the file |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 315 | [//tools/vscode/tasks.json](/tools/vscode/tasks.json). This will provide tasks |
Dan Harrington | b426cf9b | 2020-09-10 19:47:08 | [diff] [blame] | 316 | to do basic things. You might have to adjust the commands to your situation and |
| 317 | needs. To use these settings wholesale, enter the following command into your |
| 318 | terminal: |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 319 | ```bash |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 320 | $ cp tools/vscode/tasks.json .vscode |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 321 | ``` |
| 322 | |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 323 | Before running most of the tasks, you'll need to set `chrome.outputDir`. You can |
| 324 | do this by typing `Ctrl+Shift+P` > "Preferences: Open Folder Settings (JSON)" |
| 325 | and adding something like: |
| 326 | |
| 327 | ```json |
| 328 | { |
| 329 | "chrome.outputDir": "C:\\src\\chrome\\src\\out\\release" |
| 330 | |
| 331 | // more settings here... |
| 332 | } |
| 333 | |
| 334 | ``` |
| 335 | |
| 336 | Now you can run tasks by using `Ctrl+P` and typing "task " and then a number |
| 337 | of your choice. If you select one of the build tasks, the build output will |
| 338 | display in the terminal pane. Jump through build problems quickly using F8 / |
| 339 | Shift-F8. See [task names](#task-names) for more info on running tasks. |
| 340 | |
| 341 | If you have intellisense enabled but do not have include paths set up correctly, |
| 342 | jumping through problems will also try to navigate through all the include files |
| 343 | it cannot locate and add a lot of noise. You can fix your include path or simply |
| 344 | set intellisense to "tag parser" mode by doing the following: |
| 345 | |
| 346 | 1. Open Preferences (`Ctrl+Shift+P` > "Preferences: Open User Settings"). |
| 347 | 2. Type "intellisense engine" in the settings search box. |
| 348 | 3. Select "Tag Parser" as the provider. |
| 349 | |
| 350 | Note: on a Chromebook, use 🔍+<8th button in the top row that's not ESC>. In |
| 351 | most cases, this is the top row button that is the closest to be directly above |
| 352 | the 8 key. |
| 353 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 354 | ### Launch Commands |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 355 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 356 | Launch commands are the equivalent of `F5` in Visual Studio: They launch some |
| 357 | program or a debugger. Optionally, they can run some task defined in |
| 358 | `tasks.json`. Launch commands can be run from the debug view (`Ctrl+Shift+D`). |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 359 | Open the file at [//tools/vscode/launch.json](/tools/vscode/launch.json) and |
Jesse McKenna | 37eceb8 | 2020-06-02 00:03:50 | [diff] [blame] | 360 | adjust the example launch commands to your situation and needs (e.g., the value |
| 361 | of "type" needs adjustment for Windows). To use these settings wholesale, enter |
| 362 | the following command into your terminal: |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 363 | |
| 364 | ```bash |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 365 | $ cp tools/vscode/launch.json .vscode |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 366 | ``` |
| 367 | |
| 368 | ### Key Bindings |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 369 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 370 | To edit key bindings, press `Ctrl+K, Ctrl+S`. You'll see the defaults on the |
| 371 | left and your overrides on the right stored in the file `keybindings.json`. To |
| 372 | change a key binding, copy the corresponding key binding to the right. It's |
| 373 | fairly self-explanatory. |
| 374 | |
| 375 | You can bind any command to a key, even commands specified by extensions like |
| 376 | `CodeSearchOpen`. For instance, to bind `CodeSearchOpen` to `F2` to , simply add |
| 377 | `{ "key": "F2", "command": "cs.open" },`. |
| 378 | Note that the command title `CodeSearchOpen` won't work. You have to get the |
| 379 | actual command name from the [package.json |
| 380 | file](https://github.com/chaopeng/vscode-chromium-codesearch/blob/master/package.json) |
| 381 | of the extension. |
| 382 | |
| 383 | If you are used to other editors, you can also install your favorite keymap. |
| 384 | For instance, to install eclipse keymaps, install the |
| 385 | `vscode-eclipse-keybindings` extension. More keymaps can be found |
| 386 | [in the marketplace](https://marketplace.visualstudio.com/search?target=vscode&category=Keymaps). |
| 387 | |
Darwin Huang | 985c38a | 2018-11-21 19:24:13 | [diff] [blame] | 388 | Some key bindings that are likely to be useful for you are available at |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 389 | [//tools/vscode/keybindings.json](/tools/vscode/keybindings.json). Please |
Darwin Huang | 985c38a | 2018-11-21 19:24:13 | [diff] [blame] | 390 | take a look and adjust them to your situation and needs. To use these settings |
| 391 | wholesale, enter the following command into your terminal: |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 392 | |
| 393 | ```bash |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 394 | $ cp tools/vscode/keybindings.json .vscode |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 395 | ``` |
| 396 | |
Daniel Murphy | d9e88fb | 2020-03-17 19:26:23 | [diff] [blame] | 397 | ### Remote |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 398 | |
| 399 | *** promo |
| 400 | Googlers: See [go/vscode-remote](http://go/vscode-remote). |
| 401 | *** |
| 402 | |
| 403 | VS Code now has a |
Daniel Murphy | d9e88fb | 2020-03-17 19:26:23 | [diff] [blame] | 404 | [Remote](https://code.visualstudio.com/docs/remote/remote-overview) framework |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 405 | that allows you to use VS Code on your laptop while your code is hosted |
Daniel Murphy | d9e88fb | 2020-03-17 19:26:23 | [diff] [blame] | 406 | elsewhere. This really shines when used in conjunction with the vscode-clangd plugin, |
| 407 | which allows clangd to run remotely as well. |
| 408 | |
| 409 | To get this to run, install the Remote pack extension, and then make sure your |
| 410 | ssh config file has your remote connection: |
| 411 | |
| 412 | `~/.ssh/config`: |
| 413 | ``` |
| 414 | Host my-connection |
| 415 | HostName my-remote-host.corp.company.com |
| 416 | ``` |
| 417 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 418 | VS Code will then list this connection in the 'Remote Explorer' section on the |
| 419 | left. To launch VS Code with this connection, click on the '+window' icon next |
Daniel Murphy | d9e88fb | 2020-03-17 19:26:23 | [diff] [blame] | 420 | to the listed hostname. It has you choose a folder - use the 'src' folder root. |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 421 | This will open a new VS Code window in 'Remote' mode. ***Now you can install |
Daniel Murphy | d9e88fb | 2020-03-17 19:26:23 | [diff] [blame] | 422 | extensions specifically for your remote connection, like vscode-clangd, etc.*** |
| 423 | |
Peter Wen | 3ba9120 | 2020-06-17 15:56:54 | [diff] [blame] | 424 | #### Chromebooks |
| 425 | |
| 426 | For Googlers, [here](http://go/vscode/remote_development_via_web) are |
| 427 | Google-specific instructions for setting up remote development on chromebooks |
| 428 | without using Crostini. |
| 429 | |
Daniel Murphy | d9e88fb | 2020-03-17 19:26:23 | [diff] [blame] | 430 | #### Windows & SSH |
Yuwei Huang | 1c4f50c | 2021-08-06 22:41:56 | [diff] [blame] | 431 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 432 | VS Code remote tools requires 'sshd' which isn't installed on Windows by |
| 433 | default. |
Yuwei Huang | 1c4f50c | 2021-08-06 22:41:56 | [diff] [blame] | 434 | |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 435 | For Googlers, sshd should already be installed on your workstation, and VS Code |
Yuwei Huang | 1c4f50c | 2021-08-06 22:41:56 | [diff] [blame] | 436 | should work remotely if you followed the setup instructions at |
| 437 | [go/building-chrome-win](http://go/building-chrome-win). If you are still having |
| 438 | problems, please refer to |
| 439 | [go/vscode-remote#windows](http://go/vscode-remote#windows). |
| 440 | |
| 441 | Non-Googlers may follow may follow Microsoft's instructions for |
| 442 | [installing the OpenSSH server](https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse). |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 443 | VS Code should work remotely after following this step. |
Daniel Murphy | d9e88fb | 2020-03-17 19:26:23 | [diff] [blame] | 444 | |
Dan Harrington | b06ce2f | 2019-04-09 15:35:29 | [diff] [blame] | 445 | ### Snippets |
Yuki Osaki | 0a255c5 | 2021-12-20 05:35:26 | [diff] [blame] | 446 | |
Dan Harrington | b06ce2f | 2019-04-09 15:35:29 | [diff] [blame] | 447 | There are some useful snippets provided in |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 448 | [//tools/vscode/cpp.json](/tools/vscode/cpp.json). |
Dan Harrington | b06ce2f | 2019-04-09 15:35:29 | [diff] [blame] | 449 | |
Mounir Lamouri | 3b9e31d | 2019-07-30 20:14:41 | [diff] [blame] | 450 | You can either install them in your user profile (path may vary depending on the |
| 451 | platform): |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 452 | ```bash |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 453 | $ mkdir -p ~/.config/Code/User/snippets |
| 454 | $ cp tools/vscode/cpp.json ~/.config/Code/User/snippets |
Mounir Lamouri | 3b9e31d | 2019-07-30 20:14:41 | [diff] [blame] | 455 | ``` |
| 456 | |
Yuki Osaki | 0a255c5 | 2021-12-20 05:35:26 | [diff] [blame] | 457 | Or install them as project snippets: |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 458 | ```bash |
Daniel Cheng | 2d4c2d19 | 2022-07-01 01:38:31 | [diff] [blame] | 459 | $ cp tools/vscode/cpp.json .vscode/cpp.code-snippets |
Mounir Lamouri | 3b9e31d | 2019-07-30 20:14:41 | [diff] [blame] | 460 | ``` |
| 461 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 462 | ### Tips |
| 463 | |
| 464 | #### The `out` folder |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 465 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 466 | Automatically generated code is put into a subfolder of out/, which means that |
| 467 | these files are ignored by VS Code (see files.exclude above) and cannot be |
Christian Dullweber | d67c9b3 | 2018-04-03 08:30:42 | [diff] [blame] | 468 | opened e.g. from quick-open (`Ctrl+P`). |
| 469 | As of version 1.21, VS Code does not support negated glob commands, but you can |
| 470 | define a set of exclude pattern to include only out/Debug/gen: |
Christian Dullweber | babb96e1 | 2018-05-28 14:00:14 | [diff] [blame] | 471 | ``` |
Christian Dullweber | d67c9b3 | 2018-04-03 08:30:42 | [diff] [blame] | 472 | "files.exclude": { |
| 473 | // Ignore build output folders. Except out/Debug/gen/ |
| 474 | "out/[^D]*/": true, |
| 475 | "out/Debug/[^g]*": true, |
| 476 | "out/Debug/g[^e]*": true, |
| 477 | "out_*/**": true, |
| 478 | }, |
Christian Dullweber | babb96e1 | 2018-05-28 14:00:14 | [diff] [blame] | 479 | ``` |
Christian Dullweber | d67c9b3 | 2018-04-03 08:30:42 | [diff] [blame] | 480 | |
| 481 | Once it does, you can use |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 482 | ``` |
| 483 | "!out/Debug/gen/**": true |
| 484 | ``` |
| 485 | in files.exclude instead of the symlink. |
| 486 | |
| 487 | #### Using VS Code as git editor |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 488 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 489 | Add `[core] editor = "code --wait"` to your `~/.gitconfig` file in order to use |
| 490 | VS Code as editor for git commit messages etc. Note that the editor starts up |
| 491 | significantly slower than nano or vim. To use VS Code as merge tool, add |
| 492 | `[merge] tool = code`. |
| 493 | |
| 494 | #### Task Names |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 495 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 496 | Note that we named the tasks `1-build_chrome_debug`, `2-build_chrome_release` |
| 497 | etc. This allows you to quickly execute tasks by pressing their number: |
| 498 | Press `Ctrl+P` and enter `task <n>`, where `<n>` is the number of the task. You |
| 499 | can also create a keyboard shortcut for running a task. `File > Preferences > |
| 500 | Keyboard Shortcuts` and add `{ "key": "ctrl+r", "command": |
| 501 | "workbench.action.tasks.runTask", "when": "!inDebugMode" }`. Then it's |
| 502 | sufficient to press `Ctrl+R` and enter `<n>`. |
| 503 | |
| 504 | #### Working on Laptop |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 505 | |
Bartek Nowierski | fa835f8c | 2021-02-24 00:36:02 | [diff] [blame] | 506 | You might want to disable git status autorefresh to save battery. |
chaopeng | ca28511 | 2017-03-02 15:39:04 | [diff] [blame] | 507 | |
| 508 | ``` |
chaopeng | 5c66dfe | 2017-03-22 13:51:45 | [diff] [blame] | 509 | "git.autorefresh": false, |
chaopeng | ca28511 | 2017-03-02 15:39:04 | [diff] [blame] | 510 | ``` |
| 511 | |
Tommy Nyquist | dc2ceaa4 | 2021-03-15 20:29:04 | [diff] [blame] | 512 | #### Editing in multiple Git repositories |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 513 | |
Tommy Nyquist | dc2ceaa4 | 2021-03-15 20:29:04 | [diff] [blame] | 514 | If you frequently work in multiple Git repositories that are part of the Chromium repository, you might find that the built-in tooling does not work as expected for files that exist below folders that are part of a `.gitignore` file checked in to Chromium. |
| 515 | |
| 516 | To work around this, you can add the directories you edit as separate `folders` entries in your workspace configuration, and ensure that the directories that are ignored in Chromium are listed **before** the Chromium `src` path. |
| 517 | |
| 518 | To edit this, go to `Settings` -> Select the `Workspace` tab, and choose to open as JSON (button in the top right), and configure `folders` like this (change paths to match your local setup and usage): |
| 519 | |
| 520 | ``` |
| 521 | { |
| 522 | "folders": [ |
| 523 | { |
| 524 | "path": "chromium/src/third_party/perfetto" |
| 525 | }, |
| 526 | { |
| 527 | "path": "chromium/src" |
| 528 | } |
| 529 | ] |
| 530 | } |
| 531 | ``` |
| 532 | |
Jianpeng Chao | b4048b8 | 2018-08-28 23:40:01 | [diff] [blame] | 533 | ### Unable to open $File resource is not available when debugging Chromium on Linux |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 534 | |
Jianpeng Chao | b4048b8 | 2018-08-28 23:40:01 | [diff] [blame] | 535 | Chromium [recently changed](https://docs.google.com/document/d/1OX4jY_bOCeNK7PNjVRuBQE9s6BQKS8XRNWGK8FEyh-E/edit?usp=sharing) |
| 536 | the file path to be relative to the output dir. Check |
| 537 | `gn args out/$dir --list` if `strip_absolute_paths_from_debug_symbols` is true (which is the default), |
| 538 | set `cwd` to the output dir. otherwise, set `cwd` to `${workspaceRoot}`. |
| 539 | |
chaopeng | ba312ce | 2017-02-12 03:38:25 | [diff] [blame] | 540 | ### More |
Ming-Ying Chung | a7db9dde8 | 2022-07-12 06:31:54 | [diff] [blame^] | 541 | |
ljusten | e262c84 | 2017-04-12 08:29:04 | [diff] [blame] | 542 | More tips and tricks can be found |
sangwoo.ko | 5fe74c73 | 2017-09-01 14:44:56 | [diff] [blame] | 543 | [here](https://github.com/Microsoft/vscode-tips-and-tricks/blob/master/README.md). |