I am working on a proc macro, and would like to be able to write some tests to ensure it's playing nice with rust-analyzer (e.g. correct localized diagnostics).
Ideally, my testing suite would look something like this:
rust-analyzerpointed at a test crate
- Send some JSON-RPC requests to the server over stdin
- Read the response and check to see the result is as expected
So in principal, I should be able to do all of this, but as not to re-invent the wheel I am wondering how much of this might already exist. For instance, is there a crate, or maybe an existing utility which is part of the rust-analyzer project, for setting up an LSP client like this and handling requests?