index stl declarations

This commit is contained in:
Jacob Dufault 2017-04-12 00:57:12 -07:00
parent abbc6380f4
commit 94090b7b50

View File

@ -8,6 +8,8 @@
namespace { namespace {
const bool kIndexStdDeclarations = true;
void AddFuncRef(std::vector<IndexFuncRef>* result, IndexFuncRef ref) { void AddFuncRef(std::vector<IndexFuncRef>* result, IndexFuncRef ref) {
if (!result->empty() && (*result)[result->size() - 1] == ref) if (!result->empty() && (*result)[result->size() - 1] == ref)
return; return;
@ -710,7 +712,7 @@ bool AreEqualLocations(CXIdxLoc loc, CXCursor cursor) {
void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// TODO: allow user to configure if they want STL index. // TODO: allow user to configure if they want STL index.
if (clang_Location_isInSystemHeader(clang_indexLoc_getCXSourceLocation(decl->loc))) if (!kIndexStdDeclarations && clang_Location_isInSystemHeader(clang_indexLoc_getCXSourceLocation(decl->loc)))
return; return;
assert(AreEqualLocations(decl->loc, decl->cursor)); assert(AreEqualLocations(decl->loc, decl->cursor));