nixd
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
lspserver::URIForFile Struct Reference

#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)
 
static llvm::Expected< URIForFilefromURI (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)
 

Detailed Description

Definition at line 56 of file lspserver/include/lspserver/Protocol.h.

Constructor & Destructor Documentation

◆ URIForFile()

lspserver::URIForFile::URIForFile ( )
default

Referenced by canonicalize(), and fromURI().

Member Function Documentation

◆ canonicalize()

URIForFile lspserver::URIForFile::canonicalize ( llvm::StringRef AbsPath,
llvm::StringRef TUPath )
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 42 of file lspserver/src/Protocol.cpp.

References lspserver::elog(), lspserver::fromJSON(), lspserver::URI::resolvePath(), and URIForFile().

◆ file()

llvm::StringRef lspserver::URIForFile::file ( ) const
inline

Retrieves absolute path to the file.

Definition at line 76 of file lspserver/include/lspserver/Protocol.h.

◆ fromURI()

llvm::Expected< URIForFile > lspserver::URIForFile::fromURI ( const URI & U,
llvm::StringRef HintPath )
static

◆ operator bool()

lspserver::URIForFile::operator bool ( ) const
inlineexplicit

Definition at line 78 of file lspserver/include/lspserver/Protocol.h.

◆ uri()

std::string lspserver::URIForFile::uri ( ) const
inline

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const URIForFile & LHS,
const URIForFile & RHS )
friend

Definition at line 85 of file lspserver/include/lspserver/Protocol.h.

◆ operator<

bool operator< ( const URIForFile & LHS,
const URIForFile & RHS )
friend

Definition at line 89 of file lspserver/include/lspserver/Protocol.h.

◆ operator==

bool operator== ( const URIForFile & LHS,
const URIForFile & RHS )
friend

Definition at line 81 of file lspserver/include/lspserver/Protocol.h.


The documentation for this struct was generated from the following files: