|
static llvm::Expected< URI > | create (llvm::StringRef AbsolutePath, llvm::StringRef Scheme) |
|
static URI | create (llvm::StringRef AbsolutePath) |
|
static URI | createFile (llvm::StringRef AbsolutePath) |
| This creates a file:// URI for AbsolutePath . The path must be absolute.
|
|
static llvm::Expected< URI > | parse (llvm::StringRef Uri) |
|
static llvm::Expected< std::string > | resolve (const URI &U, llvm::StringRef HintPath="") |
|
static llvm::Expected< std::string > | resolve (llvm::StringRef FileURI, llvm::StringRef HintPath="") |
| Same as above, in addition it parses the FileURI using URI::parse.
|
|
static llvm::Expected< std::string > | resolvePath (llvm::StringRef AbsPath, llvm::StringRef HintPath="") |
|
static llvm::Expected< std::string > | includeSpelling (const URI &U) |
|
A URI describes the location of a source file. In the simplest case, this is a "file" URI that directly encodes the absolute path to a file. More abstract cases are possible: a shared index service might expose repo:// URIs that are relative to the source control root.
Clangd handles URIs of the form <scheme>:[//<authority>]<body>. It doesn't further split the authority or body into constituent parts (e.g. query strings is included in the body).
Definition at line 18 of file URI.h.
llvm::Expected< std::string > lspserver::URI::includeSpelling |
( |
const URI & | U | ) |
|
|
static |
Gets the preferred spelling of this file for #include, if there is one, e.g. <system_header.h>, "path/to/x.h".
This allows URI schemas to provide their customized include paths.
Returns an empty string if normal include-shortening based on the absolute path should be used. Fails if the URI is not valid in the schema.
Definition at line 270 of file URI.cpp.
llvm::Expected< std::string > lspserver::URI::resolve |
( |
const URI & | U, |
|
|
llvm::StringRef | HintPath = "" ) |
|
static |
Resolves the absolute path of U
. If there is no matching scheme, or the URI is invalid in the scheme, this returns an error.
HintPath
A related path, such as the current file or working directory, which can help disambiguate when the same file exists in many workspaces.
Definition at line 242 of file URI.cpp.
Referenced by lspserver::URIForFile::fromURI(), and resolve().