aboutsummaryrefslogtreecommitdiff
path: root/crates/gen_lsp_server/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/gen_lsp_server/src')
-rw-r--r--crates/gen_lsp_server/src/lib.rs6
-rw-r--r--crates/gen_lsp_server/src/msg.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/gen_lsp_server/src/lib.rs b/crates/gen_lsp_server/src/lib.rs
index b20652928..16ac799ac 100644
--- a/crates/gen_lsp_server/src/lib.rs
+++ b/crates/gen_lsp_server/src/lib.rs
@@ -78,10 +78,10 @@ pub use crate::{
78}; 78};
79 79
80/// Main entry point: runs the server from initialization to shutdown. 80/// Main entry point: runs the server from initialization to shutdown.
81/// To attach server to standard input/output streams, use `stdio_transport` 81/// To attach server to standard input/output streams, use the `stdio_transport`
82/// function to create corresponding `sender` and `receiver` pair. 82/// function to create corresponding `sender` and `receiver` pair.
83/// 83///
84///`server` should use `handle_shutdown` function to handle the `Shutdown` 84/// `server` should use the `handle_shutdown` function to handle the `Shutdown`
85/// request. 85/// request.
86pub fn run_server( 86pub fn run_server(
87 caps: ServerCapabilities, 87 caps: ServerCapabilities,
@@ -104,7 +104,7 @@ pub fn run_server(
104 Ok(()) 104 Ok(())
105} 105}
106 106
107/// if `req` is `Shutdown`, respond to it and return `None`, otherwise return `Some(req)` 107/// If `req` is `Shutdown`, respond to it and return `None`, otherwise return `Some(req)`
108pub fn handle_shutdown(req: RawRequest, sender: &Sender<RawMessage>) -> Option<RawRequest> { 108pub fn handle_shutdown(req: RawRequest, sender: &Sender<RawMessage>) -> Option<RawRequest> {
109 match req.cast::<Shutdown>() { 109 match req.cast::<Shutdown>() {
110 Ok((id, ())) => { 110 Ok((id, ())) => {
diff --git a/crates/gen_lsp_server/src/msg.rs b/crates/gen_lsp_server/src/msg.rs
index f68cbc541..94bef374c 100644
--- a/crates/gen_lsp_server/src/msg.rs
+++ b/crates/gen_lsp_server/src/msg.rs
@@ -54,7 +54,7 @@ pub enum ErrorCode {
54 ServerErrorEnd = -32000, 54 ServerErrorEnd = -32000,
55 ServerNotInitialized = -32002, 55 ServerNotInitialized = -32002,
56 UnknownErrorCode = -32001, 56 UnknownErrorCode = -32001,
57 RequestCancelled = -32800, 57 RequestCanceled = -32800,
58 ContentModified = -32801, 58 ContentModified = -32801,
59} 59}
60 60