[PATCH] D58440: [clangd] Store index in '.clangd/index' instead of '.clangd-index'
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 20 11:08:21 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL354505: [clangd] Store index in '.clangd/index' instead of '.clangd-index' (authored by ibiryukov, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D58440?vs=187627&id=187629#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58440/new/
https://reviews.llvm.org/D58440
Files:
clang-tools-extra/trunk/clangd/index/Background.h
clang-tools-extra/trunk/clangd/index/BackgroundIndexStorage.cpp
clang-tools-extra/trunk/test/clangd/background-index.test
llvm/trunk/.gitignore
Index: llvm/trunk/.gitignore
===================================================================
--- llvm/trunk/.gitignore
+++ llvm/trunk/.gitignore
@@ -72,8 +72,8 @@
# VS2017 and VSCode config files.
.vscode
.vs
-# clangd background index
-.clangd-index
+# clangd index
+.clangd
#==============================================================================#
# Files created in tree by the Go bindings.
Index: clang-tools-extra/trunk/clangd/index/BackgroundIndexStorage.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/index/BackgroundIndexStorage.cpp
+++ clang-tools-extra/trunk/clangd/index/BackgroundIndexStorage.cpp
@@ -63,19 +63,19 @@
}
// 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());
Index: clang-tools-extra/trunk/clangd/index/Background.h
===================================================================
--- clang-tools-extra/trunk/clangd/index/Background.h
+++ clang-tools-extra/trunk/clangd/index/Background.h
@@ -54,7 +54,7 @@
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();
};
Index: clang-tools-extra/trunk/test/clangd/background-index.test
===================================================================
--- clang-tools-extra/trunk/test/clangd/background-index.test
+++ clang-tools-extra/trunk/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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58440.187629.patch
Type: text/x-patch
Size: 3049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190220/84a642ce/attachment.bin>
More information about the cfe-commits
mailing list