diff options
author | Craig Hesling <hesling@chromium.org> | 2020-03-03 10:42:25 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-12 20:57:22 +0000 |
commit | d9ee9a446f5eccc61efd67b53f9d89847d0b3bd5 (patch) | |
tree | d02c1d3b1265bc426fc82c36205e9e77224566be /docs/ide-support.md | |
parent | f8ed81321862e43ab5beaa0df9f060053dd07605 (diff) | |
download | chrome-ec-d9ee9a446f5eccc61efd67b53f9d89847d0b3bd5.tar.gz |
docs: Add IDE Support
Had to uglify the table content because Gitiles doesn't understand |
inside backticks, in a table.
It also doesn't like < or > inside backticks.
BRANCH=none
BUG=none
TEST=Observe in gitiles
Signed-off-by: Craig Hesling <hesling@chromium.org>
Change-Id: Id6e29899878f1b17c12a475e5e882553d32b712b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2085157
Diffstat (limited to 'docs/ide-support.md')
-rw-r--r-- | docs/ide-support.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/ide-support.md b/docs/ide-support.md new file mode 100644 index 0000000000..1ab807a3d5 --- /dev/null +++ b/docs/ide-support.md @@ -0,0 +1,46 @@ +# IDE Support + +[TOC] + +## Odd File Types + +EC uses a few odd file types/names. Some are included from other header files +and used to generate data structures, thus it is important for your IDE to index +them. + +Patterns | Vague Type +----------------------------------------------------- | ---------- +`README.*` | Text +`Makefile.rules`, `Makefile.toolchain` | Makefile +`gpio.wrap` | C Header +`gpio.inc` | C Header +`*.tasklist`, `*.irqlist`, `*.mocklist`, `*.testlist` | C Header + +## IDE Configuration Primitives + +Due to the way most EC code has been structured, you can typically only safely +inspect a configuration for a single image (RO or RW) for a single board. Thus, +you need to specify the specific board/image pair when requesting defines and +includes. + +Command | Description +-------------------------------------------- | ------------------------------ +`make print-defines BOARD=$BOARD BLD=RW/RO` | List compiler injected defines +`make print-includes BOARD=$BOARD BLD=RW/RO` | List compiler include paths + +## VSCode + +You can use the `ide-config.sh` tool to generate a VSCode configuration that +includes selectable sub-configurations for every board/image pair. + +1. From the root `ec` directory, do the following: + ```bash + mkdir -p .vscode + ./util/ide-config.sh vscode all:RW all:RO | tee .vscode/c_cpp_properties.json + ``` +2. Open VSCode and navigate to some C source file. +3. Run `C/C++ Reset IntelliSense Database` from the `Ctrl-Shift-P` menu +4. Select the config in the bottom right, next to the `Select Language Mode`. + You will only see this option when a C/C++ file is open. Additionally, you + can select a configuration by pressing `Ctrl-Shift-P` and selecting the + `C/C++ Select a Configuration...` option. |