YouCompleteMe is a semantic code-completion engine. YouCompleteMe works natively with Vim but it can also be integrated with other editors through ycmd.
Install YouCompleteMe in your editor
See the installation guide.
Generate compilation database
YouCompleteMe (and other tools like clang-tidy) require a JSON compilation
database that
specifies how each file is compiled. This database is normally stored in a file
called compile_commands.json
. You can build a compilation database with fx compdb
,
or fx -i compdb
if you want it rebuilt automatically as you edit files.
If this database is not present, then Vim can be configured to fall back to the configuration in /scripts/youcompleteme/ycm_extra_conf.py. See Vim configuration for how to set this up.
Use it
YouCompleteMe will use compile_commands.json
to do code completion and find
symbol definitions/declarations. See your editor's YouCompleteMe docs for
details. The editor should pick up compile_commands.json
file automatically.
See Vim setup for instructions on configuring Vim for Fuchsia development.
Other editors (ycmd)
You'll need to set the ycmd config option global_ycm_extra_conf
to point to
${FUCHSIA_DIR}/scripts/youcompleteme/ycm_extra_conf.py
.
Note you may need to manually replace ${FUCHSIA_DIR}
with the correct path.
Alternatively, you can create a .ycm_extra_conf.py
symbolic link to let YCM
automatically find the config for any fuchsia repository:
ln -s $FUCHSIA_DIR/scripts/youcompleteme/ycm_extra_conf.py $FUCHSIA_DIR/.ycm_extra_conf.py
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.