{"id":24083,"library":"multilspy","title":"multilspy","description":"multilspy is a language-agnostic LSP (Language Server Protocol) client library for Python, providing a high-level interface to interact with language servers. Current version is 0.1.0 (pre-release), with a stable v0.0.15. It supports Python, Rust, Java, Go, JavaScript, Ruby, C#, Dart, PHP, and Elixir. Development is active, with regular releases.","status":"active","version":"0.0.15","language":"python","source_language":"en","source_url":"https://github.com/microsoft/multilspy","tags":["lsp","language-server","code-analysis","microsoft","multilanguage"],"install":[{"cmd":"pip install multilspy","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Process termination handling on all platforms","package":"psutil","optional":false}],"imports":[{"note":"SyncLanguageServer is an internal class, not the main entry point. Use Multilspy for common usage.","wrong":"from multilspy import SyncLanguageServer","symbol":"Multilspy","correct":"from multilspy import Multilspy"},{"note":"LanguageServer is a module-level class, not a top-level import.","wrong":"import LanguageServer","symbol":"LanguageServer","correct":"from multilspy import LanguageServer"}],"quickstart":{"code":"import os\nfrom multilspy import Multilspy\n\n# Initialize multilspy with a language server (Python in this case)\nlsp = Multilspy(os.environ.get('PYTHON_LSP', 'pylsp'))\n# Start the language server\nlsp.start()\n# Open a Python file\nwith open('example.py', 'w') as f:\n    f.write('import os\\n\\nprint(os.getcwd())')\nlsp.open_document('example.py')\n# Get completions\ncompletions = lsp.request_completions('example.py', line=1, character=0)\nprint(completions)\nlsp.close_document('example.py')\nlsp.stop()","lang":"python","description":"Basic usage: start a language server, open a file, request completions, then stop."},"warnings":[{"fix":"Upgrade to multilspy>=0.0.15","message":"On Windows, multilspy may fail with 'No module named pwd' if the system does not have the pwd module. This was fixed in v0.0.15, but older versions are affected.","severity":"gotcha","affected_versions":"<0.0.15"},{"fix":"Use multilspy>=0.0.15 or catch AssertionError explicitly.","message":"The `request_references` and `request_document_symbols` methods may raise assertion errors without messages in older versions. Debugging is difficult.","severity":"deprecated","affected_versions":"<0.0.15"},{"fix":"Pin to multilspy>=0.0.15,<0.1.0 or test thoroughly with v0.1.0.","message":"In v0.1.0 (pre-release), the API may have changed significantly. The async `LanguageServer` class may replace `Multilspy`. Stick to stable v0.0.15 for now.","severity":"breaking","affected_versions":"0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install multilspy>=0.0.15","cause":"Windows systems do not have the pwd Unix module. multilspy <0.0.15 imported pwd unconditionally.","error":"ModuleNotFoundError: No module named 'pwd'"},{"fix":"Upgrade to multilspy>=0.0.15 where assertions include descriptive messages.","cause":"Assertion failures in `request_references` or `request_document_symbols` without a message, making debugging hard. Seen in versions <0.0.15.","error":"AssertionError: None"},{"fix":"Ensure you pass a valid language server name (e.g., 'pylsp', 'rust-analyzer').","cause":"The `Multilspy` constructor expects a language server identifier (string), but passing None or incorrect type causes this error.","error":"TypeError: 'NoneType' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}