From 64b474a8211234b25ac6282feabf9f4244845f0e Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Fri, 21 Apr 2017 16:47:02 +0200 Subject: [PATCH] Add YouCompleteMe support YouCompleteMe[1] is a vim plugin that implements semantic code completion using libclang. For non-trivial projects such as libvirt, the plugin needs some help figuring out where to find the various header files: generate its configuration file at configure time so that the plugin works out of the box. [1] http://valloric.github.io/YouCompleteMe/ --- .gitignore | 1 + .ycm_extra_conf.py.in | 45 +++++++++++++++++++++++++++++++++++++++++++ configure.ac | 1 + 3 files changed, 47 insertions(+) create mode 100644 .ycm_extra_conf.py.in diff --git a/.gitignore b/.gitignore index e690c9901b..e2eaff1724 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ .lvimrc .memdump .sc-start-sc_* +.ycm_extra_conf.py /ABOUT-NLS /AUTHORS /ChangeLog diff --git a/.ycm_extra_conf.py.in b/.ycm_extra_conf.py.in new file mode 100644 index 0000000000..96c8a4724e --- /dev/null +++ b/.ycm_extra_conf.py.in @@ -0,0 +1,45 @@ +flags = [ + '-I@abs_top_builddir@', + '-I@abs_top_srcdir@', + '-I@abs_top_builddir@/gnulib/lib', + '-I@abs_top_srcdir@/gnulib/lib', + '-I@abs_top_builddir@/include', + '-I@abs_top_srcdir@/include', + '-I@abs_top_builddir@/src', + '-I@abs_top_srcdir@/src', + '-I@abs_top_builddir@/src/access', + '-I@abs_top_srcdir@/src/access', + '-I@abs_top_builddir@/src/admin', + '-I@abs_top_srcdir@/src/admin', + '-I@abs_top_builddir@/src/bhyve', + '-I@abs_top_srcdir@/src/bhyve', + '-I@abs_top_builddir@/src/conf', + '-I@abs_top_srcdir@/src/conf', + '-I@abs_top_builddir@/src/libxl', + '-I@abs_top_srcdir@/src/libxl', + '-I@abs_top_builddir@/src/locking', + '-I@abs_top_srcdir@/src/locking', + '-I@abs_top_builddir@/src/logging', + '-I@abs_top_srcdir@/src/logging', + '-I@abs_top_builddir@/src/lxc', + '-I@abs_top_srcdir@/src/lxc', + '-I@abs_top_builddir@/src/qemu', + '-I@abs_top_srcdir@/src/qemu', + '-I@abs_top_builddir@/src/remote', + '-I@abs_top_srcdir@/src/remote', + '-I@abs_top_builddir@/src/rpc', + '-I@abs_top_srcdir@/src/rpc', + '-I@abs_top_builddir@/src/secret', + '-I@abs_top_srcdir@/src/secret', + '-I@abs_top_builddir@/src/security', + '-I@abs_top_srcdir@/src/security', + '-I@abs_top_builddir@/src/util', + '-I@abs_top_srcdir@/src/util', + '-I@abs_top_builddir@/src/vmx', + '-I@abs_top_srcdir@/src/vmx', + '-I@abs_top_builddir@/src/xenconfig', + '-I@abs_top_srcdir@/src/xenconfig', +] + +def FlagsForFile(filename, **kwargs): + return { 'flags': flags, 'do_cache': True } diff --git a/configure.ac b/configure.ac index c607fa5b3d..f20b9ea4d0 100644 --- a/configure.ac +++ b/configure.ac @@ -883,6 +883,7 @@ AC_CONFIG_FILES([\ gnulib/lib/Makefile \ gnulib/tests/Makefile \ .color_coded \ + .ycm_extra_conf.py \ libvirt.pc \ libvirt-qemu.pc \ libvirt-lxc.pc \