Skip to content
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

tsserver has been renamed to ts_ls in nvim-lspconfig #458

Closed
2 tasks done
ic-768 opened this issue Sep 5, 2024 · 6 comments · Fixed by #459
Closed
2 tasks done

tsserver has been renamed to ts_ls in nvim-lspconfig #458

ic-768 opened this issue Sep 5, 2024 · 6 comments · Fixed by #459

Comments

@ic-768
Copy link

ic-768 commented Sep 5, 2024

Problem description

Per neovim/nvim-lspconfig#3232,

if you install tsserver through mason-lspconfig, then you will get a deprecation warning from nvim-lspconfig telling you to rename it to ts_ls.

Why do you think this is an issue with mason-lspconfig.nvim?

If it's not, then I'm mistaken and I'm sorry

Neovim version (>= 0.7)

11

Operating system/version

Ubuntu

I've manually reviewed the Nvim LPS client log (:LspLog) to find potential errors

  • Yes

I've recently downloaded the latest plugin version of mason.nvim, mason-lspconfig.nvim, and nvim-lspconfig

  • Yes

Affected language servers

tsserver

Steps to reproduce

snippet:

require("mason").setup()
require("mason-lspconfig").setup({
	ensure_installed = {
		"tsserver",
	},
})

require("mason-lspconfig").setup()

require("mason-lspconfig").setup_handlers({
	function(server_name)
		local capabilities = require("cmp_nvim_lsp").default_capabilities()
		require("lspconfig")[server_name].setup({
			capabilities = capabilities,
		})
	end,
})

Actual behavior

Deprecation error

Expected behavior

No deprecation error

LspInfo

x

LspLog

No response

Healthcheck

x

Screenshots or recordings

No response

@Integralist
Copy link

Integralist commented Sep 5, 2024

Yup, I just stumbled into this.

So I deleted the installed tsserver binary via Mason, and then updated my nvim config to replace tsserver with ts_ls but now I get the warning...

[mason-lspconfig.nvim] Server "ts_ls" is not a valid entry in ensure_installed. Make sure to only provide lspconfig server names.

I realise this is because Mason hasn't been updated to reflect the change and so I can't actually install ts_ls via Mason.

@ic-768
Copy link
Author

ic-768 commented Sep 5, 2024

Yup, I just stumbled into this.

So I deleted the installed tsserver binary via Mason, and then updated my nvim config to replace tsserver with ts_ls but now I get the warning...

[mason-lspconfig.nvim] Server "ts_ls" is not a valid entry in ensure_installed. Make sure to only provide lspconfig server names.

I realise this is because Mason hasn't been updated to reflect the change and so I can't actually install ts_ls via Mason.

if it's of any help until this gets resolved, you can see how i handled the name change in my config here.

alau added a commit to alau/dotfiles that referenced this issue Sep 6, 2024
@mke21
Copy link

mke21 commented Sep 6, 2024

I cannot change it, MasonUninstall tsserver gives the error "tsserver is not a valid package.
So does MasonInstall ts_ls: "ts_ls" is not a valid package.

What to do?

@muazong
Copy link

muazong commented Sep 6, 2024

run this command in your terminal:
npm install -g typescript-language-server typescript

config file:
local lspconfig = require("lspconfig") lspconfig["ts_ls"].setup({})

@rendi12345678
Copy link

run this command in your terminal: npm install -g typescript-language-server typescript

config file: local lspconfig = require("lspconfig") lspconfig["ts_ls"].setup({})

it works perfectly, thanks :)

@theherk
Copy link

theherk commented Sep 27, 2024

I know the issue is closed, but I'm still a bit confused. I have updated the language server and all references from tsserver to ts_ls. It seems to work, but the deprecation warning is still there. Where is the reference to tsserver that I'm missing if not in my configuration. Or will the warning persist anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants