title: Configure VIM YouCompleteMe for special project structure
body: <p>My C project has following structures. This is the structure for a large project, I can't change the structure. I want to use YouCompleteMe for semantic code completion for this project.</p>
  
  <pre><code>main/                     // folder for C file to be compiled
    |- module1.c            // module main C file.
    |- module2.c
    |- .....
  module1/
    |- mod1_func1.c         // function file to be included in main module C file.
    |- mod1_func2.c
    |- mod2_func3.c
  module2/
    |- mod2_func1.c
    |- mod2_func2.c
    |- mod2_func3.c
  </code></pre>
  
  <p>Content for <code>moduleX.c</code>, this will include all related header files and module related C files.</p>
  
  <pre><code>#include "header1.h"
  #include "header2.h"
  ...
  #include "modX_func1.c"
  #include "modX_func2.c"
  </code></pre>
  
  <p>Content for <code>modX_funcX.c</code> has one or few function definitions. Doesn't have header included</p>
  
  <pre><code>// no header file included here
  int modX_funcX(void) {.....}
  </code></pre>
  
  <p>Because there is not related header included, <code>clang</code> must parse <code>moduleX.c</code> in order to do code completion on <code>modX_funcX.c</code>,  I have tried <code>clang</code> code completion from command line. Command below works</p>
  
  <pre><code>clang -x c -fsyntax-only -code-completion-at mod1_func1.c:4:11 module1.c 
  </code></pre>
  
  <p>So my question: how to configure YouCompleteMe to do code completion when I edit the <code>modX_funcX.c</code> file? </p>
  
  <p>I guess modification to YouCompleteMe source might required to do this job. My current idea is to add a file mapping database with format:</p>
  
  <pre><code>path_of_file_to_complete:path_of_file_for_clang_to_parse
  </code></pre>
  
  <p>So before send the code completion request, get <code>path_of_file_for_clang_to_parse</code> from database based on current buffer name, pass this file name to <code>libclang</code>. </p>
  
  <p>Is my idea workable? If Yes, where is exactly place to add this file mapping function? </p>