A common server protocol for the Rust Language Server?


#1

It came to my attention recently that VSCode has what it seems a well defined and comprehensive protocol for interacting with a language server:

The protocol is meant to be agnostic to platform and language (and to the IDE as well, to a degree at least). There is some preliminary interest from Eclipse committers in implementing this for Eclipse as well.

As such, it becomes obvious that it would be of interest to Rust (for racer/rustw/rls/cargo/etc) to implement their functionality under some sort of common protocol, especially as more and more language server functionality becomes available. BTW, I work not just on RustDT, but analogue IDEs for Go (GoClipse) and D (DDT), and I can definitely see the benefit of having a common protocol for complex language servers. It would be of benefit not just across IDEs, but across languages as well.


#2

I had seen this, but have not had a chance to study it in detail. It did seem like a promising starting point for the RLS.

I’m curious about possible Eclipse support, is there a pubic forum to follow that conversation?


#3

There is the Eclipse IDE-dev mailing list. This is the relevant thread: https://dev.eclipse.org/mhonarc/lists/ide-dev/msg01225.html

Apparently they are already working for support for it in Eclipse Che (however Eclipse Che is a cloud-based IDE, it’s not the same as the standard Eclipse desktop IDE). But it might make it possible to re-use their Java implementation of the client-side protocol.


#4

Another interesting protocol exists for the Dart language: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html. It’s older than Microsoft’s language server protocol.

One interesting aspect of it is that analysis information is pushed to the client without explicit requests: client subscribes to certain kinds of notifications and push content updates to the server, while the server pushes analysis info to the client automatically.