Skip to content

Commit

Permalink
Merge pull request #1039 from fredrikekre/fe/exit
Browse files Browse the repository at this point in the history
Handle exit notification message correctly
  • Loading branch information
pfitzseb authored Mar 23, 2022
2 parents 626d97d + a91163c commit 0cbf628
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/languageserverinstance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ function Base.run(server::LanguageServerInstance)
msg_dispatcher[initialize_request_type] = request_wrapper(initialize_request, server)
msg_dispatcher[initialized_notification_type] = request_wrapper(initialized_notification, server)
msg_dispatcher[shutdown_request_type] = request_wrapper(shutdown_request, server)
msg_dispatcher[exit_notification_type] = request_wrapper(exit_notification, server)
msg_dispatcher[cancel_notification_type] = request_wrapper(cancel_notification, server)
msg_dispatcher[setTrace_notification_type] = request_wrapper(setTrace_notification, server)
msg_dispatcher[setTraceNotification_notification_type] = request_wrapper(setTraceNotification_notification, server)
Expand All @@ -353,6 +352,11 @@ function Base.run(server::LanguageServerInstance)
msg_dispatcher[julia_getDocFromWord_request_type] = request_wrapper(julia_getDocFromWord_request, server)
msg_dispatcher[textDocument_selectionRange_request_type] = request_wrapper(textDocument_selectionRange_request, server)

# The exit notification message should not be wrapped in request_wrapper (which checks
# if the server have been requested to be shut down). Instead, this message needs to be
# handled directly.
msg_dispatcher[exit_notification_type] = (conn, params) -> exit_notification(params, server, conn)

@debug "starting main loop"
@debug "Starting event listener loop at $(round(Int, time()))"
while true
Expand Down

0 comments on commit 0cbf628

Please sign in to comment.