clang-tools 20.0.0git
|
#include <Protocol.h>
Public Member Functions | |
URIForFile ()=default | |
llvm::StringRef | file () const |
Retrieves absolute path to the file. | |
operator bool () const | |
std::string | uri () const |
Static Public Member Functions | |
static URIForFile | canonicalize (llvm::StringRef AbsPath, llvm::StringRef TUPath) |
Canonicalizes AbsPath via URI. | |
static llvm::Expected< URIForFile > | fromURI (const URI &U, llvm::StringRef HintPath) |
Friends | |
bool | operator== (const URIForFile &LHS, const URIForFile &RHS) |
bool | operator!= (const URIForFile &LHS, const URIForFile &RHS) |
bool | operator< (const URIForFile &LHS, const URIForFile &RHS) |
Definition at line 84 of file Protocol.h.
|
default |
Referenced by canonicalize(), and fromURI().
|
static |
Canonicalizes AbsPath
via URI.
File paths in URIForFile can come from index or local AST. Path from index goes through URI transformation, and the final path is resolved by URI scheme and could potentially be different from the original path. Hence, we do the same transformation for all paths.
Files can be referred to by several paths (e.g. in the presence of links). Which one we prefer may depend on where we're coming from. TUPath
is a hint, and should usually be the main entrypoint file we're processing.
Definition at line 46 of file Protocol.cpp.
References clang::clangd::elog(), clang::clangd::URI::resolvePath(), and URIForFile().
Referenced by clang::clangd::getDocumentLinks(), clang::clangd::getHover(), clang::clangd::indexToLSPLocation(), clang::clangd::toLSPDiags(), and clang::clangd::LSPClient::uri().
|
inline |
Retrieves absolute path to the file.
Definition at line 104 of file Protocol.h.
Referenced by clang::clangd::getHover(), clang::clangd::getToggle(), clang::clangd::incomingCalls(), clang::clangd::resolveTypeHierarchy(), clang::clangd::subTypes(), and clang::clangd::superTypes().
|
static |
Definition at line 59 of file Protocol.cpp.
References clang::clangd::URI::resolve(), and URIForFile().
Referenced by clang::clangd::fromJSON().
|
inlineexplicit |
Definition at line 106 of file Protocol.h.
|
inline |
Definition at line 107 of file Protocol.h.
References clang::clangd::URI::createFile(), and clang::clangd::URI::toString().
Referenced by clang::clangd::operator<<(), and clang::clangd::toJSON().
|
friend |
Definition at line 113 of file Protocol.h.
|
friend |
Definition at line 117 of file Protocol.h.
|
friend |
Definition at line 109 of file Protocol.h.