[PATCH] D87450: [clangd] Implement hot index reloading for clangd-index-server

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 14 01:29:19 PDT 2020


kbobyrev added inline comments.


================
Comment at: clang-tools-extra/clangd/index/remote/server/Server.cpp:226
+  llvm::sys::TimePoint<> LastModificationTime =
+      std::chrono::system_clock::now();
+  for (;; std::this_thread::sleep_for(std::chrono::seconds(90))) {
----------------
kadircet wrote:
> i think we should rather store the file_status from the original file in here. as we want to reload whenever files size/modification_time has changed.
> it doesn't have to be moving forward let alone share the same timezone restrictions and such provided by system_clock::now.
> 
> Also it would be nice to use a VFS in here, that way we can move this logic into a helper in the future if other components need similar logic.
Can you elaborate more on VFS usage? I'm not sure how this would improve existing and potential future code over plain `llvm::sys::*` calls.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87450



More information about the cfe-commits mailing list