Respect user preference for JS/TS on_type formatting (#14536)

Release Notes:

- Fix user preferences for JS/TS on_type formatting not being respected by VTSLS.
([#13733](https://github.com/zed-industries/zed/issues/13733),
[#14499](https://github.com/zed-industries/zed/issues/14499))
This commit is contained in:
Mathias 2024-07-17 11:11:00 +02:00 committed by GitHub
parent 85bc233920
commit bd02f4fe28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 77 deletions

View file

@ -180,8 +180,8 @@ impl LspAdapter for VtslsLspAdapter {
Ok(Some(json!({
"typescript": {
"tsdk": tsdk_path,
"format": {
"enable": true
"suggest": {
"completeFunctionCalls": true
},
"inlayHints": {
"parameterNames": {
@ -206,6 +206,11 @@ impl LspAdapter for VtslsLspAdapter {
}
}
},
"javascript": {
"suggest": {
"completeFunctionCalls": true
}
},
"vtsls": {
"experimental": {
"completion": {
@ -232,49 +237,9 @@ impl LspAdapter for VtslsLspAdapter {
if let Some(options) = override_options {
return Ok(options);
}
let tsdk_path = Self::tsdk_path(&adapter).await;
Ok(json!({
"typescript": {
"suggest": {
"completeFunctionCalls": true
},
"tsdk": tsdk_path,
"format": {
"enable": true
},
"inlayHints": {
"parameterNames": {
"enabled": "all",
"suppressWhenArgumentMatchesName": false,
},
"parameterTypes": {
"enabled": true
},
"variableTypes": {
"enabled": true,
"suppressWhenTypeMatchesName": false,
},
"propertyDeclarationTypes": {
"enabled": true,
},
"functionLikeReturnTypes": {
"enabled": true,
},
"enumMemberValues": {
"enabled": true,
}
}
},
"vtsls": {
"experimental": {
"completion": {
"enableServerSideFuzzyMatch": true,
"entriesLimit": 5000,
}
},
"autoUseWorkspaceTsdk": true
}
}))
self.initialization_options(adapter)
.await
.map(|o| o.unwrap())
}
fn language_ids(&self) -> HashMap<String, String> {