Skip to content

Add psutil dependency and enhance process termination handling #67

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

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ classifiers = [
dependencies = [
"jedi-language-server==0.41.1",
"requests==2.32.3",
"typing-extensions>=4.2.0"
"typing-extensions>=4.2.0",
"psutil (>=7.0.0,<8.0.0)"
]

[project.urls]
Expand Down
5 changes: 5 additions & 0 deletions src/multilspy/lsp_protocol_handler/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import dataclasses
import json
import os
import psutil
from typing import Any, Dict, List, Optional, Union

from .lsp_requests import LspNotification, LspRequest
Expand Down Expand Up @@ -241,6 +242,10 @@ async def stop(self) -> None:
except asyncio.TimeoutError:
process.kill()

for child in psutil.Process(process.pid).children(recursive=True):
child.kill()


async def shutdown(self) -> None:
"""
Perform the shutdown sequence for the client, including sending the shutdown request to the server and notifying it of exit
Expand Down
Loading