-
Notifications
You must be signed in to change notification settings - Fork 73
Use typescript-language-server instead of using javascript-typescript-langserver #22
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
Comments
- it's a Microsoft guy who has developed that
It doesn't matter ;)
- tsserver is hosted in the TypeScript bundle, so you will benefit of
new features just by installing TypeScript bundle. For instance
javascript-typescript-langserver doesn't support TypeScript plugins
(see sourcegraph/javascript-typescript-langserver#327
<sourcegraph/javascript-typescript-langserver#327>).
When
typescript-language-server will support all feature like diagnotics (
prabirshrestha/typescript-language-server#1
<prabirshrestha/typescript-language-server#1>)
we will able to consume https://github.com/angelozerr/
tslint-language-service or other plugins.
That can be a convincing reason. But as long as the set of features
supported by this LS is smaller that the one from current LS, it's not
worth it.
@felixfbecker: wdyt?
…--
Mickael Istria
Eclipse IDE <https://www.eclipse.org/downloads/eclipse-packages/>
developer, at Red Hat Developers <https://developers.redhat.com/> community
|
Awesome to see that MS is doing steps in the direction of LSP. I initially played around with just using TSServer, but that has some problems. To be clear, TSServer is just the RPC server that exposes the TS language service API. So in our language server, we expose the language server API directly over LSP, while in @prabirshrestha's, the language service API is first exposed through the TSServer RPC protocol, then that is proxied to LSP. There is no direct benefit to that other than less code is needed in the language server, but there are some disadvantages:
|
Although I'm a MS employee, I'm one of those devs who still uses vim at work. I didn't find any good vim plugins for typescript that suits my needs ie, is purly async and works as first class plugin on windows (for work) and mac and linux (for OSS). I did discover LSP when researching so I decided to write the LSP plugin in vim first and use I don't think of The main reason for using To me I personally think |
Thanks @felixfbecker @prabirshrestha to have taken time to answer us! In my case, I'm studying if I could migrate TypeScript IDE and Angular Eclipse to LSP. I'm consumming tsserver and TypeScript plugins for angular support (completion, hover, etc inside Component/template) and compile on save. More you can choose the version of TypeScript runtime (generally you use the version of TypeScript runtime that user defines in their node_modules). In other words I have the same architecture than VSCode. I would like keep that. I know with tsserver you benefit with those features that's why I like the idea of typescript-language-server. javascript-typescript-langserver seems more powerfull but I have the impression that your hard work (parallel request, etc) should be done on tsserver to avoid reinventing the wheel like tsserver. @mickaelistria if you don't want to switch to typescript-language-server, do you think it should be possible to provide a preferences to choose the TypeScript LSP server? |
@angelozerr it would be great if you could express your desire at microsoft/TypeScript#11274 so Microsoft sees people want this :) I am definitely not reinventing the wheel, the limitations rather come from the RPC protocol. So by switching to LSP you get these for free. See this architectural overview:
https://github.com/Microsoft/TypeScript/wiki/Architectural-Overview The only thing the TS langserver replaces is the TSServer part (yellow). All the intelligence is still done by the language service API. It is just a thin wrapper around the language service API, like TSServer itself. It just uses a different RPC protocol. If you want the benefits of LSP in the TSServer RPC protocol, you would have to turn it into LSP ;) |
Thanks again @felixfbecker for your very complete answer!
Ok I will do that.
tsserver provides plugins support (tslint, angular), compile on save support, ATA support, so it's not only a simple wrapper of language service API. It's the reason why I would like to use tsserver with BlueSky otherwise I could not provide the same feature with LSP BlueSky than TypeScript IDE and Angular Eclipse which consumes tsserver. |
There is a WIP PR for TS plugins: sourcegraph/javascript-typescript-langserver#327 |
Yes I have seen that, but it's a sample of feature that you must reimplement it like tsserver. It's very important for me to consume tslint and angular plugings otherwise I cannot to swith to LSP.
There are some code inside tsserver for ATA https://github.com/Microsoft/TypeScript/tree/master/src/server/typingsInstaller
Yes sure, I would like just be sure to have the same feature than tsserver without waiting for some missing feature for several month @felixfbecker none offense with your great work! |
At the moment, there is no value for BlueSky to adopt another LS for JS/TS. So let's close this issue. |
When I will try to support advanced features like compile on save or tslint/angular support, I will give you feedback |
Just for your information an another tsserver wrapper https://github.com/theia-ide/typescript-lsp |
hmm get this issue from google, so which one should we use ? is there any user experience differences? |
Tody Eclipse Bluesky is using https://github.com/sourcegraph/javascript-typescript-langserver which implements LSP with TypeScript Language service.
IMHO, I think it should be better to consume https://github.com/prabirshrestha/typescript-language-server (once it will support all features like diagnostic, etc) which uses tsserver. Here pros to use it:
typescript-language-server will support all feature like diagnotics ( Add textDocument/publishDiagnostics prabirshrestha/typescript-language-server#1) we will able to consume https://github.com/angelozerr/tslint-language-service or other plugins.
We must just wait for https://github.com/prabirshrestha/typescript-language-server consumes the whole tsserver commands.
The text was updated successfully, but these errors were encountered: