vtsls: Enable Inlay Hints by default for JavaScript #17232 (#17334)

Closes #17232

Release Notes:

- Fixed inlay hints not being enabled for JavaScript when using the
`vtsls` language server. (They were enabled by default for TypeScript)
This commit is contained in:
Mathias 2024-09-04 08:58:16 +02:00 committed by GitHub
parent 3cffcacf52
commit be21169a95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -221,8 +221,7 @@ impl LspAdapter for VtslsLspAdapter {
adapter: &Arc<dyn LspAdapterDelegate>, adapter: &Arc<dyn LspAdapterDelegate>,
) -> Result<Option<serde_json::Value>> { ) -> Result<Option<serde_json::Value>> {
let tsdk_path = Self::tsdk_path(&adapter).await; let tsdk_path = Self::tsdk_path(&adapter).await;
Ok(Some(json!({ let config = serde_json::json!({
"typescript": {
"tsdk": tsdk_path, "tsdk": tsdk_path,
"suggest": { "suggest": {
"completeFunctionCalls": true "completeFunctionCalls": true
@ -230,31 +229,30 @@ impl LspAdapter for VtslsLspAdapter {
"inlayHints": { "inlayHints": {
"parameterNames": { "parameterNames": {
"enabled": "all", "enabled": "all",
"suppressWhenArgumentMatchesName": false, "suppressWhenArgumentMatchesName": false
}, },
"parameterTypes": { "parameterTypes": {
"enabled": true "enabled": true
}, },
"variableTypes": { "variableTypes": {
"enabled": true, "enabled": true,
"suppressWhenTypeMatchesName": false, "suppressWhenTypeMatchesName": false
}, },
"propertyDeclarationTypes": { "propertyDeclarationTypes": {
"enabled": true, "enabled": true
}, },
"functionLikeReturnTypes": { "functionLikeReturnTypes": {
"enabled": true, "enabled": true
}, },
"enumMemberValues": { "enumMemberValues": {
"enabled": true, "enabled": true
} }
} }
}, });
"javascript": {
"suggest": { Ok(Some(json!({
"completeFunctionCalls": true "typescript": config,
} "javascript": config,
},
"vtsls": { "vtsls": {
"experimental": { "experimental": {
"completion": { "completion": {