typescript: Add support for VTSLS (#12606)

You can opt into using VTSLS instead of typescript-language-server by
pasting the following snippet into your settings:
```
  "languages": {
    "TSX": {
      "language_servers": [
        "!typescript-language-server",
        "vtsls-language-server"
      ]
    }
  },
```

Related to: #5166 
Release Notes:

- Added support for using [vtsls](https://github.com/yioneko/vtsls)
language server for Typescript/Javascript.
This commit is contained in:
Piotr Osiewicz 2024-06-03 17:11:28 +02:00 committed by GitHub
parent 2b21c89e3c
commit b1efea1100
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 254 additions and 12 deletions

View file

@ -22,6 +22,7 @@ mod python;
mod rust;
mod tailwind;
mod typescript;
mod vtsls;
mod yaml;
#[derive(RustEmbed)]
@ -137,29 +138,33 @@ pub fn init(
);
language!(
"tsx",
vec![Arc::new(typescript::TypeScriptLspAdapter::new(
node_runtime.clone()
))]
vec![
Arc::new(typescript::TypeScriptLspAdapter::new(node_runtime.clone())),
Arc::new(vtsls::VtslsLspAdapter::new(node_runtime.clone()))
]
);
language!(
"typescript",
vec![Arc::new(typescript::TypeScriptLspAdapter::new(
node_runtime.clone()
))],
vec![
Arc::new(typescript::TypeScriptLspAdapter::new(node_runtime.clone())),
Arc::new(vtsls::VtslsLspAdapter::new(node_runtime.clone()))
],
typescript_task_context()
);
language!(
"javascript",
vec![Arc::new(typescript::TypeScriptLspAdapter::new(
node_runtime.clone()
))],
vec![
Arc::new(typescript::TypeScriptLspAdapter::new(node_runtime.clone())),
Arc::new(vtsls::VtslsLspAdapter::new(node_runtime.clone()))
],
typescript_task_context()
);
language!(
"jsdoc",
vec![Arc::new(typescript::TypeScriptLspAdapter::new(
node_runtime.clone(),
))]
vec![
Arc::new(typescript::TypeScriptLspAdapter::new(node_runtime.clone(),)),
Arc::new(vtsls::VtslsLspAdapter::new(node_runtime.clone()))
]
);
language!("regex");
language!(