xavierd / clang_complete

Vim plugin that use clang for completing C/C++ code.
http://www.vim.org/scripts/script.php?script_id=3302
1.96k stars 308 forks source link

Try to jump to definition before trying to go to the declaration in project #481

Closed jcppkkk closed 5 years ago

jcppkkk commented 8 years ago

An advanced case driven from #311 Consider the following example:

main.c

#include "a.h"
int main(void)
{
    a(42);
}

a.h

static void a(int b);

a.c

static void a (int b) { }

We jumps to a.h now. Could we jumps to a.c instead?

(Possible duplicate to #134 )

xaizek commented 8 years ago

I don't think so. While in compilation-unit main.c, clang_complete knows nothing about a.c and can't navigate there. It needs a cross-unit database of symbols to be able to do that.

jcppkkk commented 5 years ago

@xaizek agree