-
-
Notifications
You must be signed in to change notification settings - Fork 922
Add a command to kill the server behind a workspace #2763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This feature was asked by |
(lsp--warn "Killing %s" (lsp--workspace-print workspace)) | ||
(setf (lsp--workspace-shutdown-action workspace) | ||
(if restart 'restart 'shutdown)) | ||
(kill-process (lsp--workspace-proc workspace))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be lsp--workspace-cmd-proc
for the server process to be killed, else you will just kill the connection in the case of tcp server.
The lsp-workspace-shutdown/restart
is already killing (and restarting) the server process already. Can you elaborate more on why we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lsp-workspace-shutdown
is more graceful, so won't work if a server hangs. lsp-workspace-kill
just kills the server, which will bring it down immediately most of the time (and as such should only be used for debugging).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lsp-workspace-shutdown
is more graceful, so won't work if a server hangs.
IMHO we should make sure that lsp-workspace-shutdown works even with a hanging server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at lsp--shutdown-workspace
, if the server hangs, after the time out we will call lsp--uninitialize-workspace
, which kills the server process too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps lsp-workspace-shutdown
should be async? I don't really have much justification for lsp-workspace-kill
other than "it might be useful as a debugging tool sometime", so feel free to close this PR.
lsp-workspace-kill
will kill the server behind a given workspace usingkill-process
, and optionally restart it. The naming was chosen to beconsistent with
lsp-workspace-restart/shutdown
.