|
MLIR 22.0.0git
|
This class implements all of the MLIR related functionality necessary for a language server. More...
#include "Tools/mlir-lsp-server/MLIRServer.h"
Classes | |
| struct | Impl |
Public Member Functions | |
| MLIRServer (DialectRegistryFn registry_fn) | |
| Construct a new server with the given dialect registry function. | |
| ~MLIRServer () | |
| void | addOrUpdateDocument (const URIForFile &uri, StringRef contents, int64_t version, std::vector< Diagnostic > &diagnostics) |
| Add or update the document, with the provided version, at the given URI. | |
| std::optional< int64_t > | removeDocument (const URIForFile &uri) |
| Remove the document with the given uri. | |
| void | getLocationsOf (const URIForFile &uri, const Position &defPos, std::vector< Location > &locations) |
| Return the locations of the object pointed at by the given position. | |
| void | findReferencesOf (const URIForFile &uri, const Position &pos, std::vector< Location > &references) |
| Find all references of the object pointed at by the given position. | |
| 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. | |
| void | findDocumentSymbols (const URIForFile &uri, std::vector< DocumentSymbol > &symbols) |
| Find all of the document symbols within the given file. | |
| CompletionList | getCodeCompletion (const URIForFile &uri, const Position &completePos) |
| Get the code completion list for the position within the given file. | |
| void | getCodeActions (const URIForFile &uri, const Range &pos, const CodeActionContext &context, std::vector< CodeAction > &actions) |
| Get the set of code actions within the file. | |
| llvm::Expected< MLIRConvertBytecodeResult > | convertFromBytecode (const URIForFile &uri) |
| Convert the given bytecode file to the textual format. | |
| llvm::Expected< MLIRConvertBytecodeResult > | convertToBytecode (const URIForFile &uri) |
| Convert the given textual file to the bytecode format. | |
This class implements all of the MLIR related functionality necessary for a language server.
This class allows for keeping the MLIR specific logic separate from the logic that involves LSP server/client communication.
Definition at line 38 of file MLIRServer.h.
| lsp::MLIRServer::MLIRServer | ( | lsp::DialectRegistryFn | registry_fn | ) |
Construct a new server with the given dialect registry function.
Definition at line 1285 of file MLIRServer.cpp.
|
default |
| void lsp::MLIRServer::addOrUpdateDocument | ( | const URIForFile & | uri, |
| StringRef | contents, | ||
| int64_t | version, | ||
| std::vector< Diagnostic > & | diagnostics ) |
Add or 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 1289 of file MLIRServer.cpp.
| llvm::Expected< lsp::MLIRConvertBytecodeResult > lsp::MLIRServer::convertFromBytecode | ( | const URIForFile & | uri | ) |
Convert the given bytecode file to the textual format.
Definition at line 1355 of file MLIRServer.cpp.
References mlir::MLIRContext::allowUnregisteredDialects(), diag(), mlir::Block::front(), mlir::parseSourceFile(), and result.
| llvm::Expected< lsp::MLIRConvertBytecodeResult > lsp::MLIRServer::convertToBytecode | ( | const URIForFile & | uri | ) |
Convert the given textual file to the bytecode format.
Definition at line 1406 of file MLIRServer.cpp.
| void lsp::MLIRServer::findDocumentSymbols | ( | const URIForFile & | uri, |
| std::vector< DocumentSymbol > & | symbols ) |
Find all of the document symbols within the given file.
Definition at line 1330 of file MLIRServer.cpp.
| std::optional< lsp::Hover > lsp::MLIRServer::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 1322 of file MLIRServer.cpp.
| void lsp::MLIRServer::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 1314 of file MLIRServer.cpp.
| void lsp::MLIRServer::getCodeActions | ( | const URIForFile & | uri, |
| const Range & | pos, | ||
| const CodeActionContext & | context, | ||
| std::vector< CodeAction > & | actions ) |
Get the set of code actions within the file.
Definition at line 1346 of file MLIRServer.cpp.
| lsp::CompletionList lsp::MLIRServer::getCodeCompletion | ( | const URIForFile & | uri, |
| const Position & | completePos ) |
Get the code completion list for the position within the given file.
Definition at line 1338 of file MLIRServer.cpp.
| void lsp::MLIRServer::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 1306 of file MLIRServer.cpp.
| std::optional< int64_t > lsp::MLIRServer::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 1296 of file MLIRServer.cpp.