#include "LSPServer.h"
#include "MLIRServer.h"
#include "Protocol.h"
#include "mlir/Tools/lsp-server-support/Logging.h"
#include "mlir/Tools/lsp-server-support/Transport.h"
#include "llvm/ADT/FunctionExtras.h"
#include "llvm/ADT/StringMap.h"
#include <optional>
#define DEBUG_TYPE …
usingnamespacemlir;
usingnamespacemlir::lsp;
namespace {
struct LSPServer { … };
}
void LSPServer::onInitialize(const InitializeParams ¶ms,
Callback<llvm::json::Value> reply) { … }
void LSPServer::onInitialized(const InitializedParams &) { … }
void LSPServer::onShutdown(const NoParams &, Callback<std::nullptr_t> reply) { … }
void LSPServer::onDocumentDidOpen(const DidOpenTextDocumentParams ¶ms) { … }
void LSPServer::onDocumentDidClose(const DidCloseTextDocumentParams ¶ms) { … }
void LSPServer::onDocumentDidChange(const DidChangeTextDocumentParams ¶ms) { … }
void LSPServer::onGoToDefinition(const TextDocumentPositionParams ¶ms,
Callback<std::vector<Location>> reply) { … }
void LSPServer::onReference(const ReferenceParams ¶ms,
Callback<std::vector<Location>> reply) { … }
void LSPServer::onHover(const TextDocumentPositionParams ¶ms,
Callback<std::optional<Hover>> reply) { … }
void LSPServer::onDocumentSymbol(const DocumentSymbolParams ¶ms,
Callback<std::vector<DocumentSymbol>> reply) { … }
void LSPServer::onCompletion(const CompletionParams ¶ms,
Callback<CompletionList> reply) { … }
void LSPServer::onCodeAction(const CodeActionParams ¶ms,
Callback<llvm::json::Value> reply) { … }
void LSPServer::onConvertFromBytecode(
const MLIRConvertBytecodeParams ¶ms,
Callback<MLIRConvertBytecodeResult> reply) { … }
void LSPServer::onConvertToBytecode(const MLIRConvertBytecodeParams ¶ms,
Callback<MLIRConvertBytecodeResult> reply) { … }
LogicalResult lsp::runMlirLSPServer(MLIRServer &server,
JSONTransport &transport) { … }