brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 9004012 Raw
40 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H10#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H11 12#include "index/Index.h"13#include "llvm/ADT/StringRef.h"14 15#include <memory>16 17namespace clang {18namespace clangd {19 20namespace remote {21 22/// Returns an SymbolIndex client that passes requests to remote index located23/// at \p Address. The client allows synchronous RPC calls.24/// \p IndexRoot is an absolute path on the local machine to the source tree25/// described by the remote index. Paths returned by the index will be treated26/// 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 or31/// if the project was compiled without Remote Index support.32std::unique_ptr<clangd::SymbolIndex> getClient(llvm::StringRef Address,33                                               llvm::StringRef IndexRoot);34 35} // namespace remote36} // namespace clangd37} // namespace clang38 39#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H40