From ec2b893ee4a3a2d90a5458cc6bdc6a2c7379219f 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 d88ae7d5..ab5eb5eb 100644 --- a/src/config.h +++ b/src/config.h @@ -45,8 +45,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 8a5c399d..151bb0b0 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -202,7 +202,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; }