pylsp: Tweak default user settings (#21025)
I've also looked into not creating temp dirs in project directories and succeeded at that for Mypy; no dice for rope though, I'll have to send a patch to pylsp to fix that. Closes #20646 Release Notes: - Python: tweaked default pylsp settings to be less noisy (mypy and pycodestyle are no longer enabled by default).
This commit is contained in:
parent
9d95da56c3
commit
0663bf2a53
1 changed files with 15 additions and 12 deletions
|
@ -917,13 +917,17 @@ impl LspAdapter for PyLspAdapter {
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
json!({
|
json!({
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"rope_autoimport": {"enabled": true},
|
"pycodestyle": {"enabled": false},
|
||||||
"mypy": {"enabled": true}
|
"rope_autoimport": {"enabled": true, "memory": true},
|
||||||
}
|
"mypy": {"enabled": false}
|
||||||
|
},
|
||||||
|
"rope": {
|
||||||
|
"ropeFolder": null
|
||||||
|
},
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
// If python.pythonPath is not set in user config, do so using our toolchain picker.
|
// If user did not explicitly modify their python venv, use one from picker.
|
||||||
if let Some(toolchain) = toolchain {
|
if let Some(toolchain) = toolchain {
|
||||||
if user_settings.is_null() {
|
if user_settings.is_null() {
|
||||||
user_settings = Value::Object(serde_json::Map::default());
|
user_settings = Value::Object(serde_json::Map::default());
|
||||||
|
@ -939,23 +943,22 @@ impl LspAdapter for PyLspAdapter {
|
||||||
.or_insert(Value::Object(serde_json::Map::default()))
|
.or_insert(Value::Object(serde_json::Map::default()))
|
||||||
.as_object_mut()
|
.as_object_mut()
|
||||||
{
|
{
|
||||||
jedi.insert(
|
jedi.entry("environment".to_string())
|
||||||
"environment".to_string(),
|
.or_insert_with(|| Value::String(toolchain.path.clone().into()));
|
||||||
Value::String(toolchain.path.clone().into()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if let Some(pylint) = python
|
if let Some(pylint) = python
|
||||||
.entry("mypy")
|
.entry("mypy")
|
||||||
.or_insert(Value::Object(serde_json::Map::default()))
|
.or_insert(Value::Object(serde_json::Map::default()))
|
||||||
.as_object_mut()
|
.as_object_mut()
|
||||||
{
|
{
|
||||||
pylint.insert(
|
pylint.entry("overrides".to_string()).or_insert_with(|| {
|
||||||
"overrides".to_string(),
|
|
||||||
Value::Array(vec![
|
Value::Array(vec![
|
||||||
Value::String("--python-executable".into()),
|
Value::String("--python-executable".into()),
|
||||||
Value::String(toolchain.path.into()),
|
Value::String(toolchain.path.into()),
|
||||||
]),
|
Value::String("--cache-dir=/dev/null".into()),
|
||||||
);
|
Value::Bool(true),
|
||||||
|
])
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue