Fix textDocument/definition on #include lines

This commit is contained in:
Fangrui Song 2018-01-17 12:52:37 -08:00
parent 6746883a3b
commit b5761b5980

View File

@ -637,6 +637,7 @@ CXIdxClientFile OnIndexIncludedFile(CXClientData client_data,
CXFile cx_file; CXFile cx_file;
unsigned int line; unsigned int line;
clang_getSpellingLocation(hash_loc, &cx_file, &line, nullptr, nullptr); clang_getSpellingLocation(hash_loc, &cx_file, &line, nullptr, nullptr);
line--;
IndexFile* db = ConsumeFile(param, cx_file); IndexFile* db = ConsumeFile(param, cx_file);
if (!db) if (!db)