Skip to content

Conversation

dlax
Copy link
Contributor

@dlax dlax commented Aug 18, 2025

This allows plugins to perform some operations (e.g. terminating a daemon process or cleaning temporary resources) upon LSP server shutdown.


For instance, this could be useful for pylsp-mypy which currently already does some temporary file cleanup through an atexit hook but would also need to terminate mypy daemon when LSP exits in order to avoid dangling processes. See python-lsp/pylsp-mypy#88

This allows plugins to perform some operations (e.g. terminating
a daemon process or cleaning temporary resources) upon LSP server
shutdown.
@ccordoba12 ccordoba12 changed the title Expose a pylsp_shutdown() hook Expose a shutdown hook Aug 25, 2025
@ccordoba12 ccordoba12 added the enhancement New feature or request label Aug 25, 2025
@ccordoba12 ccordoba12 added this to the v1.13.1 milestone Aug 25, 2025
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @dlax!

@ccordoba12 ccordoba12 merged commit 3b1c895 into python-lsp:develop Aug 25, 2025
10 checks passed
@dlax dlax deleted the shutdown-hook branch August 26, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants