python: Register LSP adapters directly to the LanguageRegistry (#50662)

The purpose of `register_available_lsp_adapter()` is to allow language
servers to be reused across multiple languages. Since adapters like
`ty`, `pylsp`, and `pyright` are specific to Python, there is no need to
register them for other languages. Additionally, registering them
directly to the global `LanguageRegistry` results in negligible resource
consumption.

We can then use the default settings to control the default language
server for Python, as referenced here:


https://github.com/zed-industries/zed/blob/2cc3d382bb669629471886c2ea9b43311c525099/assets/settings/default.json#L2119-L2130

Additionally, the documentation for Python has been updated to clarify
that the `"..."` syntax does not mean "keep the rest at default," but
rather "include all other available servers."

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing (no sure how to add test for this)
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Xin Zhao authored and GitHub committed 2026-03-04 07:31:27 +00:00
1 parent 0b39e529e4
commit f0ee8bfee6
2 files changed
+9 -6

No files matched your search

+2 -2
View File
@@ -89,8 +89,8 @@ Configure language servers in Settings ({#kb zed::OpenSettings}) under Languages
"languages": {
"Python": {
"language_servers": [
// Disable basedpyright and enable ty, and otherwise
// use the default configuration.
// Disable basedpyright and enable ty, and include all
// other registered language servers (ruff, pylsp, pyright).
"ty",
"!basedpyright",
"..."