From d7c48d12d6f1da1cdbf64693777a8d6d9429f085 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 22 Aug 2018 17:40:50 -0700 Subject: [PATCH] Fix VarDef::is_local; default cacheDirectory to ".ccls-cache" --- src/config.h | 5 +++-- src/indexer.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config.h b/src/config.h index 108196b4..63bdc6cb 100644 --- a/src/config.h +++ b/src/config.h @@ -33,8 +33,9 @@ struct Config { std::string compilationDatabaseCommand; // Directory containing compile_commands.json. std::string compilationDatabaseDirectory; - // Cache directory for indexed files. - std::string cacheDirectory; + // Cache directory for indexed files, either absolute or relative to the + // project root. + std::string cacheDirectory = ".ccls-cache"; // Cache serialization format. // // "json" generates `cacheDirectory/.../xxx.json` files which can be pretty diff --git a/src/indexer.h b/src/indexer.h index f3006b23..aab4dffe 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -190,7 +190,7 @@ struct VarDef : NameMixin { uint8_t storage = clang::SC_None; bool is_local() const { - return spell && spell->kind != SymbolKind::File && + return spell && spell->kind == SymbolKind::Func && storage == clang::SC_None; }