Changeset View
Changeset View
Standalone View
Standalone View
clang-tools-extra/clangd/index/remote/server/Server.cpp
//===--- Server.cpp - gRPC-based Remote Index Server ---------------------===// | //===--- Server.cpp - gRPC-based Remote Index Server ---------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#include "Index.pb.h" | #include "Index.pb.h" | ||||
Lint: Pre-merge checks: clang-tidy: error: 'Index.pb.h' file not found [clang-diagnostic-error]
[[https://github. | |||||
#include "Service.grpc.pb.h" | #include "Service.grpc.pb.h" | ||||
#include "index/Index.h" | #include "index/Index.h" | ||||
#include "index/Serialization.h" | #include "index/Serialization.h" | ||||
#include "index/Symbol.h" | #include "index/Symbol.h" | ||||
#include "index/remote/marshalling/Marshalling.h" | #include "index/remote/marshalling/Marshalling.h" | ||||
#include "support/Logger.h" | #include "support/Logger.h" | ||||
#include "support/Shutdown.h" | #include "support/Shutdown.h" | ||||
#include "support/ThreadsafeFS.h" | #include "support/ThreadsafeFS.h" | ||||
▲ Show 20 Lines • Show All 307 Lines • ▼ Show 20 Lines | int main(int argc, char *argv[]) { | ||||
if (!Index) { | if (!Index) { | ||||
llvm::errs() << "Failed to open the index.\n"; | llvm::errs() << "Failed to open the index.\n"; | ||||
return -1; | return -1; | ||||
} | } | ||||
std::thread HotReloadThread([&Index, &Status, &FS]() { | std::thread HotReloadThread([&Index, &Status, &FS]() { | ||||
llvm::vfs::Status LastStatus = *Status; | llvm::vfs::Status LastStatus = *Status; | ||||
static constexpr auto RefreshFrequency = std::chrono::seconds(90); | static constexpr auto RefreshFrequency = std::chrono::seconds(30); | ||||
while (!clang::clangd::shutdownRequested()) { | while (!clang::clangd::shutdownRequested()) { | ||||
hotReload(*Index, llvm::StringRef(IndexPath), LastStatus, FS); | hotReload(*Index, llvm::StringRef(IndexPath), LastStatus, FS); | ||||
std::this_thread::sleep_for(RefreshFrequency); | std::this_thread::sleep_for(RefreshFrequency); | ||||
} | } | ||||
}); | }); | ||||
runServerAndWait(*Index, ServerAddress, IndexPath); | runServerAndWait(*Index, ServerAddress, IndexPath); | ||||
HotReloadThread.join(); | HotReloadThread.join(); | ||||
} | } |
clang-tidy: error: 'Index.pb.h' file not found [clang-diagnostic-error]
not useful