mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 05:51:14 +00:00
python: Fix user settings not getting passed on for Ty (#39174)
Closes #39144 Release Notes: - python: Fixed user settings not being respected with Ty language server.
This commit is contained in:
parent
6af385235d
commit
bf9dd6bbef
1 changed files with 11 additions and 8 deletions
|
|
@ -154,11 +154,16 @@ impl LspAdapter for TyLspAdapter {
|
|||
|
||||
async fn workspace_configuration(
|
||||
self: Arc<Self>,
|
||||
_: &Arc<dyn LspAdapterDelegate>,
|
||||
delegate: &Arc<dyn LspAdapterDelegate>,
|
||||
toolchain: Option<Toolchain>,
|
||||
_cx: &mut AsyncApp,
|
||||
cx: &mut AsyncApp,
|
||||
) -> Result<Value> {
|
||||
let mut ret = json!({});
|
||||
let mut ret = cx
|
||||
.update(|cx| {
|
||||
language_server_settings(delegate.as_ref(), &self.name(), cx)
|
||||
.and_then(|s| s.settings.clone())
|
||||
})?
|
||||
.unwrap_or_else(|| json!({}));
|
||||
if let Some(toolchain) = toolchain.and_then(|toolchain| {
|
||||
serde_json::from_value::<PythonEnvironment>(toolchain.as_json).ok()
|
||||
}) {
|
||||
|
|
@ -171,10 +176,9 @@ impl LspAdapter for TyLspAdapter {
|
|||
"sysPrefix": sys_prefix
|
||||
}
|
||||
});
|
||||
ret.as_object_mut()?.insert(
|
||||
"pythonExtension".into(),
|
||||
json!({ "activeEnvironment": environment }),
|
||||
);
|
||||
ret.as_object_mut()?
|
||||
.entry("pythonExtension")
|
||||
.or_insert_with(|| json!({ "activeEnvironment": environment }));
|
||||
Some(())
|
||||
});
|
||||
}
|
||||
|
|
@ -463,7 +467,6 @@ impl LspAdapter for PyrightLspAdapter {
|
|||
|
||||
async fn workspace_configuration(
|
||||
self: Arc<Self>,
|
||||
|
||||
adapter: &Arc<dyn LspAdapterDelegate>,
|
||||
toolchain: Option<Toolchain>,
|
||||
cx: &mut AsyncApp,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue