Open sphaerophoria opened 7 years ago
Hi
Sorry about the delay. I've been kinda swamped. I think the proposal sounds good and would definitely be interested in a PR around this. I wouldn't mind generalizing the output formatting and the translation from JSON-RPC to RTagsMessage is the same mechanism I would choose. Looking forward to the PR.
Thanks
Cool, thanks for the input. Hopefully I'll get some time to prototype out a simple prototype during the week.
Any update on this?
Proposal for Language Server Support
I've been working on my own plugin atom-rtags-plus for a bit now and am fairly happy with the functionality. Unfortunately I've found that when working in other languages it's frustrating that each plugin has a separate set of keybindings and feature sets that need to be configured independantly. Most of the languages I write in have at least partial support for the language server protocol and I'd love to leverage that to write something that provides a consistant interface and feature set.
Protocol intro
The protocol is defined at https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md but I'll sum it up here to the best of my understanding.
Servers and clients communicate with JSON-RPC over any type of socket (can use unix io or tcp etc.). Communication is bi-directional with the ability to push commands in either direction.
I've only done a quick onceover of the api, but it seems to support most of the major functionality provided by rtags.
Benefits
Drawbacks
Proposal for a Potential Implementation
RDM spins up another socket connection alongside TCP/Unix/etc. in Server::initServers
Requests to this socket will be translated from LSP messages into RtagsMessages
We can add a query flag to signal that we want LSP output opposed to stdout, elisp, or json
Each job in it's current state will have to support LSP messages directly
I believe this is better than doing an external proxy because
What do you think? I'm only casually familiar with the Rtags code base as well as LSP so I may have missed some details. Is this something you'd be interested in PRs for?