summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-02-27 14:56:39 +0000
committerHans Wennborg <hans@hanshq.net>2019-02-27 14:56:39 +0000
commit2d4592a2719499f438ef618b80d8a21cd30a8c11 (patch)
tree9ab058e17556c62d5cb9d9b9eac01c3926839e07
parent04e2ae0678f5d620983133f050452e7a7a44d0a8 (diff)
Merging r354505:
------------------------------------------------------------------------ r354505 | ibiryukov | 2019-02-20 20:08:06 +0100 (Wed, 20 Feb 2019) | 13 lines [clangd] Store index in '.clangd/index' instead of '.clangd-index' Summary: To take up the .clangd folder for other potential uses in the future. Reviewers: kadircet, sammccall Reviewed By: kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58440 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_80@354982 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--clangd/index/Background.h2
-rw-r--r--clangd/index/BackgroundIndexStorage.cpp8
-rw-r--r--test/clangd/background-index.test2
3 files changed, 6 insertions, 6 deletions
diff --git a/clangd/index/Background.h b/clangd/index/Background.h
index ffa83e60..4978ccb7 100644
--- a/clangd/index/Background.h
+++ b/clangd/index/Background.h
@@ -55,7 +55,7 @@ public:
llvm::unique_function<BackgroundIndexStorage *(llvm::StringRef)>;
// Creates an Index Storage that saves shards into disk. Index storage uses
- // CDBDirectory + ".clangd-index/" as the folder to save shards.
+ // CDBDirectory + ".clangd/index/" as the folder to save shards.
static Factory createDiskBackedStorageFactory();
};
diff --git a/clangd/index/BackgroundIndexStorage.cpp b/clangd/index/BackgroundIndexStorage.cpp
index a83bec6f..b7594478 100644
--- a/clangd/index/BackgroundIndexStorage.cpp
+++ b/clangd/index/BackgroundIndexStorage.cpp
@@ -64,19 +64,19 @@ writeAtomically(llvm::StringRef OutPath,
}
// Uses disk as a storage for index shards. Creates a directory called
-// ".clangd-index/" under the path provided during construction.
+// ".clangd/index/" under the path provided during construction.
class DiskBackedIndexStorage : public BackgroundIndexStorage {
std::string DiskShardRoot;
public:
- // Sets DiskShardRoot to (Directory + ".clangd-index/") which is the base
+ // Sets DiskShardRoot to (Directory + ".clangd/index/") which is the base
// directory for all shard files.
DiskBackedIndexStorage(llvm::StringRef Directory) {
llvm::SmallString<128> CDBDirectory(Directory);
- llvm::sys::path::append(CDBDirectory, ".clangd-index/");
+ llvm::sys::path::append(CDBDirectory, ".clangd", "index");
DiskShardRoot = CDBDirectory.str();
std::error_code OK;
- std::error_code EC = llvm::sys::fs::create_directory(DiskShardRoot);
+ std::error_code EC = llvm::sys::fs::create_directories(DiskShardRoot);
if (EC != OK) {
elog("Failed to create directory {0} for index storage: {1}",
DiskShardRoot, EC.message());
diff --git a/test/clangd/background-index.test b/test/clangd/background-index.test
index 34c419ac..1d11736d 100644
--- a/test/clangd/background-index.test
+++ b/test/clangd/background-index.test
@@ -13,7 +13,7 @@
# RUN: clangd -background-index -background-index-rebuild-period=0 -lit-test < %t/definition.jsonrpc | FileCheck %t/definition.jsonrpc
# Test that the index is writing files in the expected location.
-# RUN: ls %t/.clangd-index/foo.cpp.*.idx
+# RUN: ls %t/.clangd/index/foo.cpp.*.idx
# Test the index is read from disk: delete code and restart clangd.
# RUN: rm %t/foo.cpp