nixd
|
#include <LSPBinder.h>
Public Types | |
using | JSON = llvm::json::Value |
template<typename HandlerT > | |
using | HandlerMap = llvm::StringMap<llvm::unique_function<HandlerT>> |
Public Member Functions | |
template<typename Param , typename Result , typename ThisT > | |
void | addMethod (llvm::StringRef Method, ThisT *This, void(ThisT::*Handler)(const Param &, Callback< Result >)) |
template<typename Param , typename ThisT > | |
void | addNotification (llvm::StringLiteral Method, ThisT *This, void(ThisT::*Handler)(const Param &)) |
template<typename Param , typename Result , typename ThisT > | |
void | addCommand (llvm::StringLiteral Command, ThisT *This, void(ThisT::*Handler)(const Param &, Callback< Result >)) |
Public Attributes | |
HandlerMap< void(JSON)> | NotificationHandlers |
HandlerMap< void(JSON, Callback< JSON >)> | MethodHandlers |
HandlerMap< void(JSON, Callback< JSON >)> | CommandHandlers |
Definition at line 42 of file LSPBinder.h.
using lspserver::HandlerRegistry::HandlerMap = llvm::StringMap<llvm::unique_function<HandlerT>> |
Definition at line 45 of file LSPBinder.h.
using lspserver::HandlerRegistry::JSON = llvm::json::Value |
Definition at line 43 of file LSPBinder.h.
|
inline |
Bind a handler for an LSP command. e.g. command("load", this, &ThisModule::load); Handler should be e.g. void load(const LoadParams&, Callback<LoadResult>); LoadParams must be JSON-parseable and LoadResult must be serializable.
Definition at line 88 of file LSPBinder.h.
References CommandHandlers, and lspserver::parseParam().
|
inline |
Bind a handler for an LSP method. e.g. method("peek", this, &ThisModule::peek); Handler should be e.g. void peek(const PeekParams&, Callback<PeekResult>); PeekParams must be JSON-parseable and PeekResult must be serializable.
Definition at line 57 of file LSPBinder.h.
References lspserver::Method, MethodHandlers, and lspserver::parseParam().
Referenced by nixd::Controller::Controller().
|
inline |
Bind a handler for an LSP notification. e.g. notification("poke", this, &ThisModule::poke); Handler should be e.g. void poke(const PokeParams&); PokeParams must be JSON-parseable.
Definition at line 73 of file LSPBinder.h.
References lspserver::Method, NotificationHandlers, and lspserver::parseParam().
Referenced by nixd::Controller::Controller().
HandlerMap<void(JSON, Callback<JSON>)> lspserver::HandlerRegistry::CommandHandlers |
Definition at line 49 of file LSPBinder.h.
Referenced by addCommand().
HandlerMap<void(JSON, Callback<JSON>)> lspserver::HandlerRegistry::MethodHandlers |
Definition at line 48 of file LSPBinder.h.
Referenced by addMethod().
HandlerMap<void(JSON)> lspserver::HandlerRegistry::NotificationHandlers |
Definition at line 47 of file LSPBinder.h.
Referenced by addNotification().