MLIR
20.0.0git
|
URI in "file" scheme for a file. More...
#include "mlir/Tools/lsp-server-support/Protocol.h"
Public Member Functions | |
URIForFile ()=default | |
StringRef | file () const |
Returns the absolute path to the file. More... | |
StringRef | uri () const |
Returns the original uri of the file. More... | |
StringRef | scheme () const |
Return the scheme of the uri. More... | |
operator bool () const | |
Static Public Member Functions | |
static llvm::Expected< URIForFile > | fromURI (StringRef uri) |
Try to build a URIForFile from the given URI string. More... | |
static llvm::Expected< URIForFile > | fromFile (StringRef absoluteFilepath, StringRef scheme="file") |
Try to build a URIForFile from the given absolute file path and optional scheme. More... | |
static void | registerSupportedScheme (StringRef scheme) |
Register a supported URI scheme. More... | |
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) |
URI in "file" scheme for a file.
Definition at line 97 of file Protocol.h.
|
default |
Referenced by fromURI().
|
inline |
Returns the absolute path to the file.
Definition at line 110 of file Protocol.h.
Referenced by mlir::lsp::PDLLServer::addDocument(), mlir::lsp::TableGenServer::addDocument(), mlir::lsp::MLIRServer::addOrUpdateDocument(), mlir::lsp::SourceMgrInclude::buildHover(), mlir::lsp::MLIRServer::convertFromBytecode(), mlir::lsp::MLIRServer::convertToBytecode(), mlir::lsp::MLIRServer::findDocumentSymbols(), mlir::lsp::PDLLServer::findDocumentSymbols(), mlir::lsp::MLIRServer::findHover(), mlir::lsp::PDLLServer::findHover(), mlir::lsp::TableGenServer::findHover(), mlir::lsp::MLIRServer::findReferencesOf(), mlir::lsp::PDLLServer::findReferencesOf(), mlir::lsp::TableGenServer::findReferencesOf(), mlir::lsp::MLIRServer::getCodeActions(), mlir::lsp::MLIRServer::getCodeCompletion(), mlir::lsp::PDLLServer::getCodeCompletion(), mlir::lsp::PDLLServer::getDocumentLinks(), mlir::lsp::TableGenServer::getDocumentLinks(), mlir::lsp::PDLLServer::getInlayHints(), mlir::lsp::MLIRServer::getLocationsOf(), mlir::lsp::PDLLServer::getLocationsOf(), mlir::lsp::TableGenServer::getLocationsOf(), mlir::lsp::PDLLServer::getSignatureHelp(), mlir::lsp::MLIRServer::removeDocument(), mlir::lsp::PDLLServer::removeDocument(), mlir::lsp::TableGenServer::removeDocument(), mlir::lsp::PDLLServer::updateDocument(), and mlir::lsp::TableGenServer::updateDocument().
|
static |
Try to build a URIForFile from the given absolute file path and optional scheme.
Definition at line 232 of file Protocol.cpp.
References fromURI(), scheme(), uri(), and uriFromAbsolutePath().
Referenced by mlir::lsp::gatherIncludeFiles(), getLocationFromLoc(), getURIFromLoc(), and llvm::yaml::MappingTraits< YamlFileInfo >::mapping().
|
static |
Try to build a URIForFile from the given URI string.
Definition at line 225 of file Protocol.cpp.
References parseFilePathFromURI(), uri(), and URIForFile().
Referenced by fromFile(), and mlir::lsp::fromJSON().
|
inlineexplicit |
Definition at line 118 of file Protocol.h.
|
static |
Register a supported URI scheme.
The protocol supports file
by default, so this is only necessary for any additional schemes that a server wants to support.
Definition at line 243 of file Protocol.cpp.
References getSupportedSchemes(), and scheme().
Referenced by mlir::MlirLspServerMain().
StringRef URIForFile::scheme | ( | ) | const |
Return the scheme of the uri.
Definition at line 241 of file Protocol.cpp.
References uri().
Referenced by collectLocationsFromLoc(), fromFile(), getLspDiagnoticFromDiag(), and registerSupportedScheme().
|
inline |
Returns the original uri of the file.
Definition at line 113 of file Protocol.h.
Referenced by fromFile(), fromURI(), mlir::lsp::operator<<(), scheme(), and mlir::lsp::toJSON().
|
friend |
Definition at line 123 of file Protocol.h.
|
friend |
Definition at line 126 of file Protocol.h.
|
friend |
Definition at line 120 of file Protocol.h.