1 //===--- Client.h - Connect to a remote index via gRPC -----------*- C++-*-===//
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
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"
19 /// Returns an SymbolIndex client that passes requests to remote index located
20 /// at \p Address. The client allows synchronous RPC calls.
21 /// \p IndexRoot is an absolute path on the local machine to the source tree
22 /// described by the remote index. Paths returned by the index will be treated
23 /// as relative to this directory.
25 /// This method attempts to resolve the address and establish the connection.
27 /// \returns nullptr if the address is not resolved during the function call or
28 /// if the project was compiled without Remote Index support.
29 std::unique_ptr
<clangd::SymbolIndex
> getClient(llvm::StringRef Address
,
30 llvm::StringRef IndexRoot
);
36 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H