default to typeCheckingMode=standard

This commit is contained in:
Cole Miller 2025-08-01 15:33:52 -04:00
parent 182e16d3b3
commit 80d7fdb251

View file

@ -1599,15 +1599,12 @@ impl LspAdapter for BasedPyrightLspAdapter {
} }
} }
// Always set the python interpreter path // Set both pythonPath and defaultInterpreterPath for compatibility
// Get or create the python section if let Some(python) = object
let python = object
.entry("python") .entry("python")
.or_insert(Value::Object(serde_json::Map::default())) .or_insert(Value::Object(serde_json::Map::default()))
.as_object_mut() .as_object_mut()
.unwrap(); {
// Set both pythonPath and defaultInterpreterPath for compatibility
python.insert( python.insert(
"pythonPath".to_owned(), "pythonPath".to_owned(),
Value::String(interpreter_path.clone()), Value::String(interpreter_path.clone()),
@ -1618,6 +1615,18 @@ impl LspAdapter for BasedPyrightLspAdapter {
); );
} }
if !object.contains_key("typeCheckingMode")
&& let Some(analysis) = object
.entry("basedpyright.analysis")
.or_insert(Value::Object(serde_json::Map::default()))
.as_object_mut()
{
analysis
.entry("typeCheckingMode")
.or_insert("standard".into());
}
}
user_settings user_settings
}) })
} }