From 8f1ce8275347e915b1cc824567e96369875cefd4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 1 Sep 2018 17:40:45 +0300 Subject: move to gen-server impl --- crates/gen_lsp_server/src/msg.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/gen_lsp_server/src/msg.rs') diff --git a/crates/gen_lsp_server/src/msg.rs b/crates/gen_lsp_server/src/msg.rs index 9426e98ec..533d7da3e 100644 --- a/crates/gen_lsp_server/src/msg.rs +++ b/crates/gen_lsp_server/src/msg.rs @@ -120,6 +120,16 @@ impl RawResponse { } impl RawNotification { + pub fn new(params: N::Params) -> RawNotification + where + N: Notification, + N::Params: Serialize, + { + RawNotification { + method: N::METHOD.to_string(), + params: to_value(¶ms).unwrap(), + } + } pub fn cast(self) -> ::std::result::Result where N: Notification, -- cgit v1.2.3