MLIR
20.0.0git
|
This class implements all of the PDLL related functionality necessary for a language server. More...
#include "Tools/mlir-pdll-lsp-server/PDLLServer.h"
Classes | |
struct | Impl |
struct | Options |
Public Member Functions | |
PDLLServer (const Options &options) | |
~PDLLServer () | |
void | addDocument (const URIForFile &uri, StringRef contents, int64_t version, std::vector< Diagnostic > &diagnostics) |
Add the document, with the provided version , at the given URI. More... | |
void | updateDocument (const URIForFile &uri, ArrayRef< TextDocumentContentChangeEvent > changes, int64_t version, std::vector< Diagnostic > &diagnostics) |
Update the document, with the provided version , at the given URI. More... | |
std::optional< int64_t > | removeDocument (const URIForFile &uri) |
Remove the document with the given uri. More... | |
void | getLocationsOf (const URIForFile &uri, const Position &defPos, std::vector< Location > &locations) |
Return the locations of the object pointed at by the given position. More... | |
void | findReferencesOf (const URIForFile &uri, const Position &pos, std::vector< Location > &references) |
Find all references of the object pointed at by the given position. More... | |
void | getDocumentLinks (const URIForFile &uri, std::vector< DocumentLink > &documentLinks) |
Return the document links referenced by the given file. More... | |
std::optional< Hover > | findHover (const URIForFile &uri, const Position &hoverPos) |
Find a hover description for the given hover position, or std::nullopt if one couldn't be found. More... | |
void | findDocumentSymbols (const URIForFile &uri, std::vector< DocumentSymbol > &symbols) |
Find all of the document symbols within the given file. More... | |
CompletionList | getCodeCompletion (const URIForFile &uri, const Position &completePos) |
Get the code completion list for the position within the given file. More... | |
SignatureHelp | getSignatureHelp (const URIForFile &uri, const Position &helpPos) |
Get the signature help for the position within the given file. More... | |
void | getInlayHints (const URIForFile &uri, const Range &range, std::vector< InlayHint > &inlayHints) |
Get the inlay hints for the range within the given file. More... | |
std::optional< PDLLViewOutputResult > | getPDLLViewOutput (const URIForFile &uri, PDLLViewOutputKind kind) |
Get the output of the given PDLL file, or std::nullopt if there is no valid output. More... | |
This class implements all of the PDLL related functionality necessary for a language server.
This class allows for keeping the PDLL specific logic separate from the logic that involves LSP server/client communication.
Definition at line 40 of file PDLLServer.h.
lsp::PDLLServer::PDLLServer | ( | const Options & | options | ) |
Definition at line 1707 of file PDLLServer.cpp.
|
default |
void lsp::PDLLServer::addDocument | ( | const URIForFile & | uri, |
StringRef | contents, | ||
int64_t | version, | ||
std::vector< Diagnostic > & | diagnostics | ||
) |
Add the document, with the provided version
, at the given URI.
Any diagnostics emitted for this document should be added to diagnostics
.
Definition at line 1711 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
void lsp::PDLLServer::findDocumentSymbols | ( | const URIForFile & | uri, |
std::vector< DocumentSymbol > & | symbols | ||
) |
Find all of the document symbols within the given file.
Definition at line 1778 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
std::optional< lsp::Hover > lsp::PDLLServer::findHover | ( | const URIForFile & | uri, |
const Position & | hoverPos | ||
) |
Find a hover description for the given hover position, or std::nullopt if one couldn't be found.
Definition at line 1770 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
void lsp::PDLLServer::findReferencesOf | ( | const URIForFile & | uri, |
const Position & | pos, | ||
std::vector< Location > & | references | ||
) |
Find all references of the object pointed at by the given position.
Definition at line 1755 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
lsp::CompletionList lsp::PDLLServer::getCodeCompletion | ( | const URIForFile & | uri, |
const Position & | completePos | ||
) |
Get the code completion list for the position within the given file.
Definition at line 1786 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
void lsp::PDLLServer::getDocumentLinks | ( | const URIForFile & | uri, |
std::vector< DocumentLink > & | documentLinks | ||
) |
Return the document links referenced by the given file.
Definition at line 1763 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
void lsp::PDLLServer::getInlayHints | ( | const URIForFile & | uri, |
const Range & | range, | ||
std::vector< InlayHint > & | inlayHints | ||
) |
Get the inlay hints for the range within the given file.
Definition at line 1802 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
void lsp::PDLLServer::getLocationsOf | ( | const URIForFile & | uri, |
const Position & | defPos, | ||
std::vector< Location > & | locations | ||
) |
Return the locations of the object pointed at by the given position.
Definition at line 1747 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
std::optional< lsp::PDLLViewOutputResult > lsp::PDLLServer::getPDLLViewOutput | ( | const URIForFile & | uri, |
PDLLViewOutputKind | kind | ||
) |
Get the output of the given PDLL file, or std::nullopt if there is no valid output.
Definition at line 1815 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
lsp::SignatureHelp lsp::PDLLServer::getSignatureHelp | ( | const URIForFile & | uri, |
const Position & | helpPos | ||
) |
Get the signature help for the position within the given file.
Definition at line 1794 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
std::optional< int64_t > lsp::PDLLServer::removeDocument | ( | const URIForFile & | uri | ) |
Remove the document with the given uri.
Returns the version of the removed document, or std::nullopt if the uri did not have a corresponding document within the server.
Definition at line 1737 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().
void lsp::PDLLServer::updateDocument | ( | const URIForFile & | uri, |
ArrayRef< TextDocumentContentChangeEvent > | changes, | ||
int64_t | version, | ||
std::vector< Diagnostic > & | diagnostics | ||
) |
Update the document, with the provided version
, at the given URI.
Any diagnostics emitted for this document should be added to diagnostics
.
Definition at line 1723 of file PDLLServer.cpp.
References mlir::lsp::URIForFile::file().