aboutsummaryrefslogtreecommitdiff
path: root/crates/gen_lsp_server/src/msg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/gen_lsp_server/src/msg.rs')
-rw-r--r--crates/gen_lsp_server/src/msg.rs10
1 files changed, 10 insertions, 0 deletions
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 {
120} 120}
121 121
122impl RawNotification { 122impl RawNotification {
123 pub fn new<N>(params: N::Params) -> RawNotification
124 where
125 N: Notification,
126 N::Params: Serialize,
127 {
128 RawNotification {
129 method: N::METHOD.to_string(),
130 params: to_value(&params).unwrap(),
131 }
132 }
123 pub fn cast<N>(self) -> ::std::result::Result<N::Params, RawNotification> 133 pub fn cast<N>(self) -> ::std::result::Result<N::Params, RawNotification>
124 where 134 where
125 N: Notification, 135 N: Notification,