summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Grandi <agrandi@google.com>2022-07-12 09:08:34 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-21 23:12:14 +0000
commit29d0b434269d03b87a6ff55e8818b5a6d8ecfe79 (patch)
tree790d854b4de9043b1ada0600b3e3cb07efbae99e
parent48a837ff006f5c2862932ffe2b9014861302765c (diff)
downloadchrome-ec-29d0b434269d03b87a6ff55e8818b5a6d8ecfe79.tar.gz
docs/ide-support.md: Add instructions for CrOS IDE
Add instructions to manually configure platform/ec with the CrOS IDE extension for VSCode. BRANCH=none BUG=b:236389226 TEST=viewed in gitiles Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: I924d65fdb06cfd8cb931727194987bf9480ae9a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3758783 Reviewed-by: Craig Hesling <hesling@chromium.org> Tested-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Bobby Casey <bobbycasey@google.com> Commit-Queue: Andrea Grandi <agrandi@google.com> Auto-Submit: Andrea Grandi <agrandi@google.com> Reviewed-by: Firas Sammoura <fsammoura@google.com>
-rw-r--r--docs/ide-support.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/ide-support.md b/docs/ide-support.md
index 78704981b0..14be66ce4b 100644
--- a/docs/ide-support.md
+++ b/docs/ide-support.md
@@ -55,3 +55,46 @@ includes selectable sub-configurations for every board/image pair.
```bash
cp .vscode/settings.json.default .vscode/settings.json
```
+
+## VSCode CrOS IDE
+
+CrOS IDE is a VSCode extension to enable code completion and navigation for
+ChromeOS source files.
+
+Support for `platform/ec` is not available out of the box (yet), but can be
+manually enabled following these steps.
+
+### Prerequisites
+
+1. Install CrOS IDE following the [quickstart guide]
+1. Install `bear`, a utility to generate the compilation database
+
+ ```
+ (chroot) $ sudo emerge bear
+ ```
+
+[quickstart guide]: https://chromium.googlesource.com/chromiumos/chromite/+/main/ide_tooling/docs/quickstart.md
+
+### Configure EC Board
+
+1. Build the image and create new compile_commands.json using `bear`
+
+ ```
+ (chroot) $ cd ~/chromiumos/src/platform/ec
+ export BOARD=bloonchipper
+ make clean BOARD=${BOARD}
+ bear make -j BOARD=${BOARD}
+ mv compile_commands.json compile_commands_inside_chroot.json
+ ```
+
+1. Generate the new compile_commands.json (use the absolute path outside chroot
+ as first argument)
+
+ ```bash
+ (chroot) $ cd ~/chromiumos/chromite/ide_tooling/scripts
+ python compdb_no_chroot.py /home/${USER}/chromiumos \
+ < ~/chromiumos/src/platform/ec/compile_commands_inside_chroot.json \
+ > ~/chromiumos/src/platform/ec/compile_commands.json
+ ```
+ The command will overwrite the file `compile_commands.json`, if it already
+ exists.