-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 should implement the Language Server Protocol #39459
Comments
Is there any traction on this? I feel like this should be somewhat high priority, but only because my favorite IDE's all blame TypeScript's non-conformance to the Language Server Protocol as the reason TypeScript support is buggy. How bad is this issue, and how difficult would it be to remedy? Thanks. I'd also be interested in links to reading material that might enlighten me on the subject. |
We're working on this, albeit slowly. tsserver's implementation predates LSP so it's nontrivial work to move forward in a way that doesn't adversely affect old clients or result in code duplication. Your favorite IDE should misplace their blame somewhere else 🙃 |
@RyanCavanaugh If you are looking for a testing environment may I suggest vim with vim-lsp. |
@RyanCavanaugh is there a branch to track? Or what is the best way to track the work on that? |
@RyanCavanaugh In line with last comment: any list of issues/tasks that someone could tackle on free time to help with this? |
From Eclipse Wild Web Developer perspective, we'd also gladly participate in some testing of this feature when it's available for experiments. We're not looking for a 100% LSP conformance from day 1, we're just looking for a sustainable and more standard alternative to the https://github.com/theia-ide/typescript-language-server and we'd gladly migrate to standard tsserver LSP support even if we lose a few features by the way. We'll more easily be able to contribute to tsserver after we can have a minimum viable experimental LSP support. |
I don't have any major updates; as Ryan mentioned, the work is happening bit by bit, but we are working on it so I've at least labeled the issue as such. One thing that @minestarks mentioned to me is that it would be good to have a channel with implementers who plan to use an LSP server so that we can potentially coordinate and hear more about use-cases. If you're an LSP client implementer, I'd encourage you to just drop a reply here. |
I'm not directly an LSP client implementer, but I'm hoping to use tsserver as a language server in https://github.com/apexskier/nova-typescript as a language server for Nova instead of typescript-language-server. |
And I am willing to help with any tasks that might help @apexskier achieve that goal because I much prefer Nova and I work all day on build tools for large TypeScript monorepos. |
I guess we all(lsp client maintainers) have one use-case - we want to access the
@leungbk and I are maintainers of Emacs LSP client - https://emacs-lsp.github.io |
@DanielRosenwasser I'd be interested in being included - I'm the maintainer of |
@joaotavora, the author of eglot, another LSP client for Emacs, may also be interested. |
The sensible thing to do is support tsserver for probably years to come, and LSP in addition to that. That will give all editors and plugin authors plenty of chance to replace their tsserver implementations with LSP. This being added to the spec very recently is of great help: microsoft/language-server-protocol#737 |
Is it ok to close the issue When this issue got traction, Given how things played out, it looks like this will not be a priority anytime soon. |
I've closed issues after years of them being open as a good solution was found, and I have had issues I have never closed because no one has ever solved the problem in years. I fundamentally believe issues should only ever be closed if they are resolved. |
For others following, @jakebailey last commented on this topic in #57475, with #59250 and #59905 both seeming to still capture this in their iteration plans 💙.
@jakebailey did you have any thoughts on a rough timeline for support? Are we months or probably years away? |
I can't promise anything, but I'm certainly hoping it's not years. This is work I want to do. The main question I have for you is "why do you want LSP?" What specific problem are you looking to solve by having it implemented? To be clear, I am not saying it's a bad idea to do, not at all, I want to do it! But, my experience talking to interested parties has mainly found that a switch to LSP will not actually fix any of their problems; this work boils down to |
Talking for myself, I don't want to use a third party intermediary translation layer (or proxy) for my editor to support |
I'm using Nova, which also support LSP (but not tsserver). :( |
It would free the maintainers of typescript-language-server from having to maintain the proxy, free downstream from having to maintain packages of the proxy, and users would not have to find a way to install the proxy when they already have typescript installed. |
This might be a naive question to ask, and it might not be something the project wants to take on, but would it make sense for typescript to basically embed one of the LSP proxy translation layers for the time being, and then be able to slowly switch out the underlying calls from proxied -> native as that work gets completed? |
The different JSON blobs actually matters a lot. Most of the ecosystem tooling has converged around the LSP spec and provided LSP specific tools to make for an excellent editing experience. Which is a bit funny, considering that's exactly the reason Microsoft created the LSP spec to begin with. It's odd that this Microsoft project would wonder what providing an LSP implementation would actually help with 😉
In short, I think the benefits are actually pretty clear and at the core of why Microsoft created the LSP specification to begin with Edit: Follow up
I'd suggest that the mere existence of |
I understand the interop rationale fully (I've worked on three LSP servers before joining the TypeScript team!), so it does not surprise me that everyone's reply is "because interop" or "to not have to have a wrapper". There have been other threads where people have implied that LSP would enable features that it actually wouldn't (e.g. virtual workspaces, embedded languages), so I mainly just wanted to set expectations about how I am personally thinking.
This turns into a licensing/CLA question, among other implementation/design constraints.
The tsserver protocol predates LSP (and in some ways inspired it), and until recently had some critical tricks that LSP did not have (e.g. pull-ish diagnostics, which are still not implemented in many editors, but are effectively required for editors like VS; TS doesn't have push diagnostics exactly like LSP wants, either). I'm not "pondering" per se; just trying to read the room and again set expectations. |
Right. We know you know. That's why my reply was a bit on the nose - the entire point for us is having a well maintained LSP provider and that's why many of us work on the |
You can ask "Why does the LSP exist?" and the answer(s) will also apply to your question. |
Search Terms
language server protocol
Suggestion
This is a duplicate of issue #11274, which the OP closed because at that time, there existed two reasonable-looking LSP implementations for TypeScript.
But the times have changed. The Theia IDE now uses a VS Code extension for its TypeScript needs, and in the last eighteen months, Sourcegraph's server has received exactly one update by a sentient person.
There continue to be requests for LSP support within #11724 despite its Closed status. The OP has expressed no interest in revisiting the issue.
Use Cases
It would be useful to programmers who use TypeScript but don't use VS Code.
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: