mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Add default settings to display Svelte inlay hints (#7943)
Fixes: #7913. Release Notes: - Added default settings for Svelte language server to display inlay hints ([#7913](https://github.com/zed-industries/zed/issues/7913)).
This commit is contained in:
parent
3cbc18895a
commit
43a845cbbf
@ -91,8 +91,37 @@ impl LspAdapter for SvelteLspAdapter {
|
||||
}
|
||||
|
||||
fn initialization_options(&self) -> Option<serde_json::Value> {
|
||||
let config = json!({
|
||||
"inlayHints": {
|
||||
"parameterNames": {
|
||||
"enabled": "all",
|
||||
"suppressWhenArgumentMatchesName": false
|
||||
},
|
||||
"parameterTypes": {
|
||||
"enabled": true
|
||||
},
|
||||
"variableTypes": {
|
||||
"enabled": true,
|
||||
"suppressWhenTypeMatchesName": false
|
||||
},
|
||||
"propertyDeclarationTypes": {
|
||||
"enabled": true
|
||||
},
|
||||
"functionLikeReturnType": {
|
||||
"enabled": true
|
||||
},
|
||||
"enumMemberValues": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Some(json!({
|
||||
"provideFormatter": true
|
||||
"provideFormatter": true,
|
||||
"configuration": {
|
||||
"typescript": config,
|
||||
"javascript": config
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
@ -2,3 +2,56 @@
|
||||
|
||||
- Tree Sitter: [tree-sitter-svelte](https://github.com/Himujjal/tree-sitter-svelte)
|
||||
- Language Server: [svelte](https://github.com/sveltejs/language-tools/tree/master/packages/language-server)
|
||||
|
||||
## Inlay Hints
|
||||
|
||||
Zed sets the following initialization options for inlay Hints:
|
||||
|
||||
```json
|
||||
"inlayHints": {
|
||||
"parameterNames": {
|
||||
"enabled": "all",
|
||||
"suppressWhenArgumentMatchesName": false
|
||||
},
|
||||
"parameterTypes": {
|
||||
"enabled": true
|
||||
},
|
||||
"variableTypes": {
|
||||
"enabled": true,
|
||||
"suppressWhenTypeMatchesName": false
|
||||
},
|
||||
"propertyDeclarationTypes": {
|
||||
"enabled": true
|
||||
},
|
||||
"functionLikeReturnType": {
|
||||
"enabled": true
|
||||
},
|
||||
"enumMemberValues": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
to make the language server send back inlay hints when Zed has them enabled in the settings.
|
||||
|
||||
Use
|
||||
|
||||
```json
|
||||
"lsp": {
|
||||
"$LANGUAGE_SERVER_NAME": {
|
||||
"initialization_options": {
|
||||
"configuration": {
|
||||
"typescript": {
|
||||
......
|
||||
},
|
||||
"javascript": {
|
||||
......
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
to override these settings.
|
||||
|
||||
See https://github.com/microsoft/vscode/blob/main/extensions/typescript-language-features/package.json for more information.
|
||||
|
Loading…
Reference in New Issue
Block a user