Build YCMD

git clone
cd ycmd
git submodule update --init --recursive
python --clang-completer

Visual Studio Code config sample

The extension:

Minimal config:

    "ycmd.path": "/Users/notsowise/pathto/ycmd",

Optional config in case you have multiple python versions:

    "ycmd.python": "/usr/bin/python"

Generate completion database

Pass -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to cmake on invocation. You might have to copy the compile_commands.json into the source tree.

Something like this:

mkdir build
cd build
cp compile_commands.json ../src
cd ../src
code .