Skip to content

Commit 3043a72

Browse files
committed
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 ------------------------------------------------------------------------ llvm-svn: 354982
1 parent c57a1fc commit 3043a72

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

clang-tools-extra/clangd/index/Background.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class BackgroundIndexStorage {
5555
llvm::unique_function<BackgroundIndexStorage *(llvm::StringRef)>;
5656

5757
// Creates an Index Storage that saves shards into disk. Index storage uses
58-
// CDBDirectory + ".clangd-index/" as the folder to save shards.
58+
// CDBDirectory + ".clangd/index/" as the folder to save shards.
5959
static Factory createDiskBackedStorageFactory();
6060
};
6161

clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@ writeAtomically(llvm::StringRef OutPath,
6464
}
6565

6666
// Uses disk as a storage for index shards. Creates a directory called
67-
// ".clangd-index/" under the path provided during construction.
67+
// ".clangd/index/" under the path provided during construction.
6868
class DiskBackedIndexStorage : public BackgroundIndexStorage {
6969
std::string DiskShardRoot;
7070

7171
public:
72-
// Sets DiskShardRoot to (Directory + ".clangd-index/") which is the base
72+
// Sets DiskShardRoot to (Directory + ".clangd/index/") which is the base
7373
// directory for all shard files.
7474
DiskBackedIndexStorage(llvm::StringRef Directory) {
7575
llvm::SmallString<128> CDBDirectory(Directory);
76-
llvm::sys::path::append(CDBDirectory, ".clangd-index/");
76+
llvm::sys::path::append(CDBDirectory, ".clangd", "index");
7777
DiskShardRoot = CDBDirectory.str();
7878
std::error_code OK;
79-
std::error_code EC = llvm::sys::fs::create_directory(DiskShardRoot);
79+
std::error_code EC = llvm::sys::fs::create_directories(DiskShardRoot);
8080
if (EC != OK) {
8181
elog("Failed to create directory {0} for index storage: {1}",
8282
DiskShardRoot, EC.message());

clang-tools-extra/test/clangd/background-index.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# RUN: clangd -background-index -background-index-rebuild-period=0 -lit-test < %t/definition.jsonrpc | FileCheck %t/definition.jsonrpc
1414

1515
# Test that the index is writing files in the expected location.
16-
# RUN: ls %t/.clangd-index/foo.cpp.*.idx
16+
# RUN: ls %t/.clangd/index/foo.cpp.*.idx
1717

1818
# Test the index is read from disk: delete code and restart clangd.
1919
# RUN: rm %t/foo.cpp

0 commit comments

Comments
 (0)