Nvim-lspconfig: typescript-language-server no longer maintained

Created on 24 May 2020  路  23Comments  路  Source: neovim/nvim-lspconfig

It looks like the typescript-language-server library is no longer actively maintained (source).

There's another language server that supports both javascript and typescript that seems to be more active (javascript-language-server). Would that be a better option?

question

Most helpful comment

I'd like to promo this issue as well that asks Microsoft to make TSServer (theirs) support LSP (also theirs) https://github.com/microsoft/TypeScript/issues/11274.

All 23 comments

I didn't really want to make a github issue out of this since this isn't really one but I just realized that coc-tsserver from coc.nvim works on singular .ts files without actually initializing a typescript project in that directory while this both this and tsserver only work if there's a tsconfig. Is there any way I can obtain the same behavior here ?

Both my typescript and lua are trash but I think it's because of the default values coc-tsserver comes with.
https://github.com/neoclide/coc-tsserver/blob/bac002caef532d6dc58c10a2885eeed463082d4f/package.json

Edit: It seems it's not really possible in this case.
https://github.com/sourcegraph/javascript-typescript-langserver/issues/433

@pyrr yeah I think we're dependent on the language server itself for that. Not sure why that issue was closed - did they resolve the issue maybe?

I don't think so.

It looks like the typescript-language-server library is no longer actively maintained (source).

There's another language server that supports both javascript and typescript that seems to be more active (javascript-language-server). Would that be a better option?

The repo you are suggesting hasn't received any updates to the actual source code in more than a year---really, look at the commit history. That project also has some problems with memory leaks: https://github.com/sourcegraph/javascript-typescript-langserver/issues/447

It might be easier for someone to take over the Theia project instead.

I'd like to promo this issue as well that asks Microsoft to make TSServer (theirs) support LSP (also theirs) https://github.com/microsoft/TypeScript/issues/11274.

This is the reason why I have not switched to use nvim-lsp from coc. coc-tsserver has always worked great. And typescript-lang-server is no longer maintained

FWIW Sourcegraph language server mentioned by OP also seems abandoned, all the activity there comes from deps-update bots

@whitebyte are there any other options? The coc-tsserver plugin seems to work really well for coc.nvim. Is there any way to adapt that plugin to work for nvim-lsp?

@lynndylanhurley unfortunately I'm not aware of any other options

@kuator I ended up switching back to coc. I'm mostly using TS these days and coc-tsserver is just way better than the nvim-lsp typescript plugin.

@lynndylanhurley I've switched from coc to lsp for the past week. While I agree that it's worrying that typescript-language-server is no longer maintained, I don't really have an issue with my current LSP setup compared to coc.

May I know what did not work for you?

@pyrho I kept getting stale / glitchy linting errors. Also the editor would occasionally freeze completely 1-2 times per day.

I switched back to coc to see if that resolved the issue. I haven't had the freezing issue at all, but I do occasionally get bad linting results. In those cases I can just run CocReset and it resolves the issue. Not sure if there's an equivalent command for the nvim LSP - the only way I knew how to resolve with nvim-lsp was to exit vim and restart.

I did notice a bad freeze/hang/OOM with LSP that I never had with coc; thanks for sharing.

@kuator I ended up switching back to coc. I'm mostly using TS these days and coc-tsserver is just way better than the nvim-lsp typescript plugin.

Thanks for the suggestion, I used to use coc.nvim, it's an amazing plugin, but I'm gonna stick to nvim-lsp. I mostly write python, so typescript support is not big of a deal for me.

coc uses vscode (which has many extensions that provide in-process LSP servers). Is there some reason why nvim-lsp could not also use vscode as the LSP server? That seems like the best approach for any LSP client, since most vscode extensions that provide LSP aren't going to bother to provide standalone versions.

@justinmk You make it sound easy, are you sure :) ?

For Typescript CoC uses coc-tsserver which looks like it spawns a tsserver process and interacts with it via stdin/out.
I think nvim-typescript does something similar; eg. not really LSP but just an in-house wrapper around tsserver.

typescript-language-server provides an LSP interface to tsserver (unlike the two aforementioned repos) so that nvim's LSP can "talk" with tsserver.

We need all this needless complexity because tsserver does not have an LSP interface.

You are exponentially more knowledgeable than me (<3), so there is a good chance everything I just said is just non sense, but that's my two cents.

You make it sound easy, are you sure :) ?

it's definitely not easy, I wonder if coc could be leveraged as a library or a dependency somehow. Haven't looked into whether this is a goal of coc. And it's probably a bit silly since then nvim-lsp is kinda redundant.

I think nvim-typescript does something similar; eg. not really LSP but just an in-house wrapper around tsserver.

oh. so what's the problem?

We need all this needless complexity because tsserver does not have an LSP interface.

the way LSP seems to be going is that many "LSP" impls are done as in-process vscode extensions, because it's just easier for the author. Which of course defeats the purpose of LSP. But if this trend continues then vscode will be a de facto necessary dependency of all LSP clients.

And it's probably a bit silly since then nvim-lsp is kinda redundant.

Agreed.

I think nvim-typescript does something similar; eg. not really LSP but just an in-house wrapper around tsserver.

oh. so what's the problem?

From my limited understanding, the code from coc (or nvim-typescript) could be adapted to talk to an LSP-able client, acting as an LSP abstraction layer in front of tsserver; I also don't think it would be too hard to do.

(note: coc uses official vscode packages to interact with tsserver, found here)

The problem is finding someone with enough time on their hands to actually do it (I'm trying to stop making promise I can't fulfill P:).

But if this trend continues then vscode will be a de facto necessary dependency of all LSP clients.

Do you mean like an actual VSCode instance acting as a server, with which other out-of-memory programs can interact with? Is such API already live?


It just hit me, I've been rambling about re-using code from here or there, but we already have a "wrapper around tsserver that speaks LSP", that's already exactly what typescript-language-server is; it just needs a new maintainer.
As for interacting directly with VSCode (eg. nvim <> vscode <> tsserver instead of nvim <> tsserver) , that's outside of my knowledge.

馃憢 To keep this conversation going, the theia lsp server, https://github.com/theia-ide/typescript-language-server appears to have been picked up by someone, it has commits in the last 25 days as of this writing.

https://github.com/sourcegraph/javascript-typescript-langserver has been archived and points to the theia lsp among other options.

Typescript claims to be slowly implementing LSP functionality but so far its hard to track https://github.com/microsoft/TypeScript/issues/39459

Should we update the README to point back to the theia LSP? I am having trouble getting it running myself.

Isn't this no longer an issue as typescript-language-server is now maintained, and @Chocrates I believe the documentation does point to theia LSP?
https://github.com/neovim/nvim-lspconfig/blob/36d9109dc402eb4a37e55b0814cd8d4714f9a3a4/lua/lspconfig/tsserver.lua#L35-L40

Deno now has a built-in LSP for JS and TS in Rust:

https://deno.land/posts/v1.6#built-in-deno-language-server
https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno-canary

They are working on it:

denoland/deno#8643

Does it allow to use it in non-deno projects?

@David-Else @kuator If you want to continue this discussion (and test) this PR https://github.com/neovim/nvim-lspconfig/pull/491

Was this page helpful?
0 / 5 - 0 ratings

Related issues

teto picture teto  路  10Comments

mjlbach picture mjlbach  路  8Comments

dlukes picture dlukes  路  4Comments

nhooyr picture nhooyr  路  3Comments

DarkDefender picture DarkDefender  路  3Comments