
Rust Language Server Now Available with Rustup - bluejekyll
http://www.jonathanturner.org/2017/04/rls-now-in-nightly.md.html
======
georgewfraser
The language server protocol is revolutionary for providing features like
intelligent autocomplete to text editors. It basically brings proper
separation-of-concerns to language tooling. In particular, because it's based
on JSON messages over sockets, you can implement the tooling for each language
in that language. I'm the author of [https://github.com/georgewfraser/vscode-
javac](https://github.com/georgewfraser/vscode-javac) which uses the Java
compiler tree API to implement a Java language server---the task was made
radically easier by being able to implement it in the target language.

~~~
SideburnsOfDoom
> The language server protocol is revolutionary for providing features like
> intelligent autocomplete to text editors.

There have been similar things recently. Jetbrains built an out-of-process
version of resharper in order to power Rider.

[https://www.jetbrains.com/rider/](https://www.jetbrains.com/rider/)

Omnisharp, which is aimed at providing features like autocomplete to various
text editors, has done out-of-process as well:
[https://github.com/OmniSharp/omnisharp-
server](https://github.com/OmniSharp/omnisharp-server)

~~~
flukus
Language server protocol is a specification, hopefully all tools will work
towards compatibility:

[https://github.com/Microsoft/language-server-
protocol](https://github.com/Microsoft/language-server-protocol)

~~~
josteink
> Language server protocol is a specification

This is indeed the important bit, and out of process is in that regard merely
a implementation detail (although a practical one).

Right now we have a situation where the N editors and M languages gives us NxM
language-plugins matrix if we want complete support.

If a new editor or language comes along, the job to implement complete support
across the line is astronomical (thus noone does). Right now you may even have
to switch editor to get "full" support for a given language, if any support at
all.

LSP replaces this with a much more manageable situation where we have N
editors (with LSP clients) + M languages (with LSP servers), and that yielding
a N clients + M servers solution-space instead.

Simplified a wee bit: One new editor only needs to implement a single LSP-
client to support all languages with a LSP-server, and one new language only
need to implement a single LSP-server to be supported in all editors which
already has a LSP-client.

This really is a revolutionary change, and I'm surprised how little attention
LSP has gotten in the grand scheme of things.

------
sqs
This looks awesome. Great to see more folks adopting this. We're using the
language server protocol (LSP) pretty heavily over at Sourcegraph
([https://sourcegraph.com/](https://sourcegraph.com/)), and we're loving it.

We wrote up a couple of blog posts with general info about LSP and how we use
it for other languages:

[https://text.sourcegraph.com/how-sourcegraph-scales-with-
the...](https://text.sourcegraph.com/how-sourcegraph-scales-with-the-language-
server-protocol-a4e8fd3fbae5)

[https://text.sourcegraph.com/part-2-how-sourcegraph-
scales-w...](https://text.sourcegraph.com/part-2-how-sourcegraph-scales-with-
the-language-server-protocol-73b86175f38b)

We also maintain an unofficial listing of language servers with a matrix of
supported features: [http://langserver.org/](http://langserver.org/).

------
timlyo
Is this similar to Racer?

[https://github.com/phildawes/racer](https://github.com/phildawes/racer)

Edit:

Just found this on the github repo[1]

>The RLS gets its source data from the compiler and from Racer. Where possible
it uses data from the compiler which is precise and complete. Where its not
possible, (for example for code completion and where building is too slow), it
uses Racer.

[1] [https://github.com/rust-lang-nursery/rls](https://github.com/rust-lang-
nursery/rls)

~~~
lifthrasiir
Yes, but in principle slower (as it cannot update its status incrementally---
referred as to "end-to-end" incremental compilation and harder than the normal
incremental compilation producing executables) and accurate (as it leverages
the compiler itself). AFAIK Racer has a heuristic engine that is faster and
less accurate, and RLS falls back to Racer whenever it's appropriate.

------
tmm
Is there a list of editors which support RLS or is it just VSCode at the
moment?

~~~
Sean1708
From further down in the thread:

[http://langserver.org/](http://langserver.org/)

------
Animats
Because everything's better with cloud.

~~~
masklinn
Language Servers are not "cloud" or even remote, they're local daemons with a
standardised protocol, the "server" comes from the fact that you run a
language server and various clients (IDE, refactoring systems, documentation,
…) can connect to the server to query it and get information about
files/projects in a given language without needing to understand the semantics
of the language itself.

See [https://code.visualstudio.com/docs/extensions/example-
langua...](https://code.visualstudio.com/docs/extensions/example-language-
server) for more.

~~~
flukus
Being pedantic, why is it called server? Wouldn't service be more appropriate?
Or deamon for that matter, service is already over used in our field but a
daemon has a specific meaning.

~~~
masklinn
> Being pedantic, why is it called server?

Because it serves data to clients connecting to it. Hence e.g. Emacs Server[0]
or X Server[1]. Historically server doesn't imply a network operation.

> Or deamon for that matter, service is already over used in our field but a
> daemon has a specific meaning.

It's a subset (well not exactly you can have non-daemon servers but close
enough), most daemons are not servers, in fact many daemons are client (e.g.
ntpd).

Service is basically the windows name for daemon, so it has the same lack of
connotation, a service can be a client, a server, neither, both.

[0]
[https://www.gnu.org/software/emacs/manual/html_node/emacs/Em...](https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-
Server.html)

[1] [http://www.linfo.org/x_server.html](http://www.linfo.org/x_server.html)

