Fix VarDef::is_local; default cacheDirectory to ".ccls-cache"

This commit is contained in:
Fangrui Song 2018-08-22 17:40:50 -07:00
parent 27a5b24b59
commit d7c48d12d6
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -190,7 +190,7 @@ struct VarDef : NameMixin<VarDef> {
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;
}