-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ts_ls)!: rename tsserver
to ts_ls
#3232
Conversation
Note that |
Now the |
skip-checks: true
@glepnir Could you please review it? |
https://github.com/search?q=lspconfig.tsserver&type=code quick search it has 5.6k files.. so hasty merge will only result in a lot of complaints. best approach is to popup a notify and keep it available and remove it in the next release. |
It does, you can see in there, the snippet redirects But considering your search result, I will do extra PR for |
Could just wait for microsoft/TypeScript#39459 to be resolved and then do something about it then. |
@polyzen Not that related. There are two points I want to emphasize.
|
seems like lsp-mode also use ts_ls.. but I'm wondering if this abbreviation is appropriate. How about typescript_ls? ts is a bit ambiguous. |
Keep my recommendation still. |
Well reasoned. Thank you |
So, umm guys, I now get "tsserver is deprecated, use ts_ls instead" in my neovim after updating. How can I fix this? Do I need to edit some config file and change the name to ts_ls or what? I am asking this because mason doesn't have a separate ts_ls option to install within it. |
No idea about mason. Wherever you set "tsserver", change that to "ts_ls". |
I was also blindsided by this. Here's what I did ( not the full config but you can see how I handle the name change ):
|
@ic-768 Thanks a lot, that was very swift of you, and I will go ahead and give that a try. |
Why not just change the "tsserver" item in |
Because that would tell mason to install the |
@ic-768 Hey, I tried to use your code, but I still get the same warning on startup, "tsserver is deprecated, use ts_ls instead", while I can see that tsserver is actually renamed to ts_ls regardless, because it actually says, "Configured servers: { "cssls", "css_variables", "pylsp", "ts_ls" }". Also, there's an error now that says, "/home/sannan/.config/nvim/lua/config/lsp_zero.lua:28: attempt to call field 'setup' (a nil value)" which is quite weird. Any idea what I might be doing wrong here? |
@SannanOfficial I don't use lsp_zero and I'm not getting any errors, so there might be some conflict with that plugin that needs fixing? |
@ic-768 Perhaps, I will look into it. Thanks for the help. |
Originally, I planned to change the package name in mason-registry so that we could merge without many breaking changes, but I noticed a lot of pending pull requests in its repo (maybe the maintainer is busy now) so I did not. Whenever you have a problem that is difficult to solve, I recommend switching to vtsls. You will have almost the same experience because they are both |
@ofseed Spent about an hour trying to get this to work for me, but couldn't for now. So I will try and switch to vtsls as you suggested for the time being. Thanks. Edit: vtsls works, thanks again. |
Matching the upstream change: neovim/nvim-lspconfig#3232
Just came across this but you can also just use a simple one-liner to do the same thing: server_name = server_name == 'tsserver' and 'ts_ls' or server_name |
|
temporary fix for vim-plug users: require('mason').setup()
require('mason-lspconfig').setup({
ensure_installed = {'tsserver','pyright', 'jsonls', 'rust_analyzer'},
handlers = {
-- lsp_zero.default_setup,
function(server_name)
if server_name == 'tsserver' then
server_name = 'ts_ls'
else
lsp_zero.default_setup(server_name)
end
end
},
}) |
- Updated the handler for tsserver to ts_ls as per the changes in nvim-lspconfig (neovim/nvim-lspconfig#3232).
for more details check out this PR in the nvim-lspconfig repo neovim/nvim-lspconfig#3232
tsserver
cannot be used as an abbreviation fortypescript-language-server
, because there istsserver
already and it is completely different fromtypescript-language-server
. This is misleading.As the README of
typescript-language-server
says, it's a wrapper oftsserver
. This abuse has been around for so many time in lspconfig that people don't realize they are two different things, and are then confused by replacements oftypescript-language-server
like typescript-tools.nvim and vtsls.