[TargetVersion] Only enable on RISC-V and AArch64 (#115991)
[llvm-project.git] / clang-tools-extra / clangd / index / remote / Client.h
blob9004012f066ae2ecb89159b361ceda83a4d367a7
1 //===--- Client.h - Connect to a remote index via gRPC -----------*- C++-*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H
12 #include "index/Index.h"
13 #include "llvm/ADT/StringRef.h"
15 #include <memory>
17 namespace clang {
18 namespace clangd {
20 namespace remote {
22 /// Returns an SymbolIndex client that passes requests to remote index located
23 /// at \p Address. The client allows synchronous RPC calls.
24 /// \p IndexRoot is an absolute path on the local machine to the source tree
25 /// described by the remote index. Paths returned by the index will be treated
26 /// as relative to this directory.
27 ///
28 /// This method attempts to resolve the address and establish the connection.
29 ///
30 /// \returns nullptr if the address is not resolved during the function call or
31 /// if the project was compiled without Remote Index support.
32 std::unique_ptr<clangd::SymbolIndex> getClient(llvm::StringRef Address,
33 llvm::StringRef IndexRoot);
35 } // namespace remote
36 } // namespace clangd
37 } // namespace clang
39 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H