kadircet added inline comments.

================
Comment at: clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp:58
+    if (CreatingNewDirectory) {
+      llvm::Error error = addGitignore(DiskShardRoot);
+      if (error) {
----------------
nit:
```
if(llvm::Error E = addGitignore(..)) {
 elog(".."), std::move(E));
}
```

`std::move` is actually important, otherwise destruction of Error on failure 
state will trigger a crash.


================
Comment at: clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp:94
+  llvm::Error addGitignore(llvm::StringRef Directory) {
+    auto FilePath = getGitignorePathForShardRoot(DiskShardRoot);
+    return llvm::writeFileAtomically(
----------------
we're passing in `Directory` but using `DiskShardRoot` here. can you actually 
make `addGitignore` a free-function (same as `getGitignorePathForShardRoot`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130863/new/

https://reviews.llvm.org/D130863

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D130863: [clangd] ... Kadir Cetinkaya via Phabricator via cfe-commits
    • [PATCH] D130863: [cla... Kadir Cetinkaya via Phabricator via cfe-commits

Reply via email to