Skip to content

Commit e6b4456

Browse files
GaweringoSchottkyc137
authored andcommitted
fix handling of shutdown request and exit notification
vhdl_ls did not quit/exit after receiving the shutdown request and exit notification, because the lsp_server handle_shutdown request already waits for the exit notification and only returns true, if it is received. With the old setup the handler for the exit notification was never called, because handle_shutdown consumed the notification. fixes #142
1 parent 4f20cbd commit e6b4456

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

vhdl_ls/src/stdio_server.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ impl ConnectionRpcChannel {
8888
match message {
8989
lsp_server::Message::Request(request) => {
9090
match self.connection.handle_shutdown(&request) {
91-
Ok(shutdown) => {
92-
if shutdown {
91+
Ok(should_exit) => {
92+
if should_exit {
9393
server.shutdown_server();
94+
server.exit_notification();
9495
} else {
9596
self.handle_request(&mut server, request)
9697
}
@@ -272,11 +273,6 @@ impl ConnectionRpcChannel {
272273
Ok(params) => return server.workspace_did_change_watched_files(&params),
273274
Err(notification) => notification,
274275
};
275-
// exit
276-
let notification = match extract::<notification::Exit>(notification) {
277-
Ok(_params) => return server.exit_notification(),
278-
Err(notification) => notification,
279-
};
280276

281277
if !notification.method.starts_with("$/") {
282278
debug!("Unhandled notification: {notification:?}");

0 commit comments

Comments
 (0)