typescript: Make VTSLS the default language server for Typescript (#13140)

Additionally, limit # of returned completion items + use fuzzy filtering
on VTSLS side. Prime LSP handler for response handling.


Release Notes:

- VTSLS is now a default language server for TypeScript, TSX, and
JavaScript.
This commit is contained in:
Piotr Osiewicz 2024-06-18 20:16:03 +02:00 committed by GitHub
parent 39edbe1c50
commit 8af8493da6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 71 additions and 17 deletions

View file

@ -174,8 +174,60 @@ impl LspAdapter for VtslsLspAdapter {
"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,
}
}
}
})))
}
async fn workspace_configuration(
self: Arc<Self>,
_: &Arc<dyn LspAdapterDelegate>,
_cx: &mut AsyncAppContext,
) -> Result<Value> {
Ok(json!({
"typescript": {
"suggest": {
"completeFunctionCalls": true
},
"tsdk": "node_modules/typescript/lib",
"format": {
"enable": true
},
"inlayHints":{
"parameterNames":
{
"enabled": "all",
"suppressWhenArgumentMatchesName": false,
},
"parameterTypes":
{
"enabled": true
@ -194,20 +246,15 @@ impl LspAdapter for VtslsLspAdapter {
"enabled": true,
}
}
})))
}
async fn workspace_configuration(
self: Arc<Self>,
_: &Arc<dyn LspAdapterDelegate>,
_cx: &mut AsyncAppContext,
) -> Result<Value> {
Ok(json!({
"typescript": {
"suggest": {
"completeFunctionCalls": true
},
"vtsls":
{"experimental": {
"completion": {
"enableServerSideFuzzyMatch": true,
"entriesLimit": 5000,
}
}
}
}))
}