python: Replace pyright with basedpyright (#35362)

Follow-up to #35250. Let's experiment with having this by default on
nightly.

Release Notes:

- Added built-in support for the basedpyright language server for Python
code. basedpyright is now enabled by default, and pyright (previously
the primary Python language server) remains available but is disabled by
default. This supersedes the basedpyright extension, which can be
uninstalled. Advantages of basedpyright over pyright include support for
inlay hints, semantic highlighting, auto-import code actions, and
stricter type checking. To switch back to pyright, add the following
configuration to settings.json:

```json
{
  "languages": {
    "Python": {
      "language_servers": ["pyright", "pylsp", "!basedpyright"]
    }
  }
}
```

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
This commit is contained in:
Cole Miller
2025-09-08 19:15:17 +00:00
committed by GitHub
co-authored by Piotr Osiewicz Lukas Wirth
parent 99102a84fa
commit fa0df6da1c
14 changed files with 233 additions and 67 deletions
+6
View File
@@ -166,6 +166,12 @@ impl<'a> From<&'a str> for LanguageServerName {
}
}
impl PartialEq<str> for LanguageServerName {
fn eq(&self, other: &str) -> bool {
self.0 == other
}
}
/// Handle to a language server RPC activity subscription.
pub enum Subscription {
Notification {