clang-tools  11.0.0
Functions
clang::clangd::remote Namespace Reference

Functions

std::unique_ptr< clangd::SymbolIndexgetClient (llvm::StringRef Address, llvm::StringRef IndexRoot)
 Returns an SymbolIndex client that passes requests to remote index located at Address. More...
 
clangd::FuzzyFindRequest fromProtobuf (const FuzzyFindRequest *Request, llvm::StringRef IndexRoot)
 
llvm::Optional< clangd::SymbolfromProtobuf (const Symbol &Message, llvm::UniqueStringSaver *Strings, llvm::StringRef IndexRoot)
 
llvm::Optional< clangd::ReffromProtobuf (const Ref &Message, llvm::UniqueStringSaver *Strings, llvm::StringRef IndexRoot)
 
LookupRequest toProtobuf (const clangd::LookupRequest &From)
 
FuzzyFindRequest toProtobuf (const clangd::FuzzyFindRequest &From, llvm::StringRef IndexRoot)
 
RefsRequest toProtobuf (const clangd::RefsRequest &From)
 
Symbol toProtobuf (const clangd::Symbol &From, llvm::StringRef IndexRoot)
 
Ref toProtobuf (const clangd::Ref &From, llvm::StringRef IndexRoot)
 
llvm::Optional< std::string > relativePathToURI (llvm::StringRef RelativePath, llvm::StringRef IndexRoot)
 Translates RelativePath into the absolute path and builds URI for the user machine. More...
 
llvm::Optional< std::string > uriToRelativePath (llvm::StringRef URI, llvm::StringRef IndexRoot)
 Translates a URI from the server's backing index to a relative path suitable to send over the wire to the client. More...
 

Function Documentation

◆ fromProtobuf() [1/3]

clangd::FuzzyFindRequest clang::clangd::remote::fromProtobuf ( const FuzzyFindRequest Request,
llvm::StringRef  IndexRoot 
)

Definition at line 126 of file Marshalling.cpp.

◆ fromProtobuf() [2/3]

llvm::Optional< clangd::Ref > clang::clangd::remote::fromProtobuf ( const Ref Message,
llvm::UniqueStringSaver *  Strings,
llvm::StringRef  IndexRoot 
)

◆ fromProtobuf() [3/3]

llvm::Optional< clangd::Symbol > clang::clangd::remote::fromProtobuf ( const Symbol Message,
llvm::UniqueStringSaver *  Strings,
llvm::StringRef  IndexRoot 
)

◆ getClient()

std::unique_ptr< clangd::SymbolIndex > clang::clangd::remote::getClient ( llvm::StringRef  Address,
llvm::StringRef  IndexRoot 
)

Returns an SymbolIndex client that passes requests to remote index located at Address.

The client allows synchronous RPC calls. IndexRoot is an absolute path on the local machine to the source tree described by the remote index. Paths returned by the index will be treated as relative to this directory.

This method attempts to resolve the address and establish the connection.

Returns
nullptr if the address is not resolved during the function call or if the project was compiled without Remote Index support.

Definition at line 115 of file Client.cpp.

◆ relativePathToURI()

llvm::Optional< std::string > clang::clangd::remote::relativePathToURI ( llvm::StringRef  RelativePath,
llvm::StringRef  IndexRoot 
)

Translates RelativePath into the absolute path and builds URI for the user machine.

This translation happens on the client side with the RelativePath received from remote index server and IndexRoot is provided by the client.

Definition at line 289 of file Marshalling.cpp.

References clang::clangd::elog(), and clang::clangd::None.

◆ toProtobuf() [1/5]

FuzzyFindRequest clang::clangd::remote::toProtobuf ( const clangd::FuzzyFindRequest From,
llvm::StringRef  IndexRoot 
)

◆ toProtobuf() [2/5]

LookupRequest clang::clangd::remote::toProtobuf ( const clangd::LookupRequest From)

◆ toProtobuf() [3/5]

Ref clang::clangd::remote::toProtobuf ( const clangd::Ref From,
llvm::StringRef  IndexRoot 
)

Definition at line 280 of file Marshalling.cpp.

◆ toProtobuf() [4/5]

RefsRequest clang::clangd::remote::toProtobuf ( const clangd::RefsRequest From)

Definition at line 236 of file Marshalling.cpp.

◆ toProtobuf() [5/5]

Symbol clang::clangd::remote::toProtobuf ( const clangd::Symbol From,
llvm::StringRef  IndexRoot 
)

Definition at line 246 of file Marshalling.cpp.

◆ uriToRelativePath()

llvm::Optional< std::string > clang::clangd::remote::uriToRelativePath ( llvm::StringRef  URI,
llvm::StringRef  IndexRoot 
)

Translates a URI from the server's backing index to a relative path suitable to send over the wire to the client.

Definition at line 313 of file Marshalling.cpp.

References clang::clangd::elog(), clang::clangd::None, clang::clangd::URI::parse(), and clang::clangd::URI::scheme().