feat(lang): add ts_ls to lsp config (#4406)

## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

In this [PR](https://github.com/neovim/nvim-lspconfig/pull/3232),
tsserver is renamed to ts_ls, but it hasn't been released yet.

Therefore, ts_ls is added to the LSP configuration in case the user
updates their plugins locally.

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->
N/A!

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
N/A!

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Arthur 2024-10-02 15:32:17 +08:00 committed by GitHub
parent 9b1767205c
commit 34f0e568d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,9 +19,14 @@ return {
opts = {
-- make sure mason installs the server
servers = {
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
tsserver = {
enabled = false,
},
ts_ls = {
enabled = false,
},
vtsls = {
-- explicitly add default filetypes, so that we can extend
-- them in related extras
@ -114,10 +119,16 @@ return {
},
},
setup = {
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
tsserver = function()
-- disable tsserver
return true
end,
ts_ls = function()
-- disable tsserver
return true
end,
vtsls = function(_, opts)
LazyVim.lsp.on_attach(function(client, buffer)
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)