Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

languages: Fix Pyright ignoring toolchain when LSP settings are configured (#59990)

Xin Zhaoc28e37687d56
diff --git a/crates/languages/src/python.rs b/crates/languages/src/python.rs
index becefed29ef..7764f8f2403 100644
--- a/crates/languages/src/python.rs
+++ b/crates/languages/src/python.rs
@@ -669,7 +669,7 @@ impl LspAdapter for PyrightLspAdapter {
// If we have a detected toolchain, configure Pyright to use it - unless the user sets it themselves.
let should_insert_toolchain = || {
user_settings.as_object().is_none_or(|object| {
- [
+ ![
"venvPath",
"venv",
"python",
@@ -2112,10 +2112,10 @@ impl LspAdapter for BasedPyrightLspAdapter {
.and_then(|s| s.settings.clone())
.unwrap_or_default();
- // If we have a detected toolchain, configure Pyright to use it
+ // If we have a detected toolchain, configure BasedPyright to use it - unless the user sets it themselves.
let should_insert_toolchain = || {
user_settings.as_object().is_none_or(|object| {
- [
+ ![
"venvPath",
"venv",
"python",