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/9c9337a8021f74511625517c3f4fa021106609eb/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:
1 parent
9a6046cc57
commit
cdb34c30c9
2 files changed
+9
-6
No files matched your search
@@ -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",
|
||||
"..."
|
||||
|
||||
Reference in new issue
Block a user