While trying to work on https://github.com/rust-analyzer/rust-analyzer/issues/6823 I ran into a trouble of forging requests without modifying TS extension part of RA. Is there any way to invoke arbitrary methods from VS Code by just passing custom JSON?
I don't think so. But I think that feature requires custom TS anyway?
Yep. But I decided to start from Rust part, and only then work on TS
For the rust part, I'd go with just writing unit-tests in the IDE module (how, eg, join_lines work). When integrating with LSP, I don't think there's an easier way then just writing both the rust and the TS parts together. On the bright side, the LSP part should be mostly trivial, so it often just writes itself from the definitions of request/response types.
I guess Rust part is done, and tests are passing, though I'm not sure about chosen API. Is it ok to just ask for a cursor position and direction? image.png
Seem right overall
On VS Code side this can be implemented as two different commands, so that user bindings are possible
You probably want
lsp_types::TextDocumentEdit instead of just a vector of edits
And I think it's best to use
Range rather than
Position for input, such that we can extend this to multiple items in the futuer
Got it. Thanks!
Are there any issues with CI? Cross is failing to compile, other ones (and my local build) are successful. https://github.com/rust-analyzer/rust-analyzer/pull/8054/checks
needs a rebase(/
I can't reproduce locally with
cargo check --all-targets --target powerpc-unknown-linux-gnu, but rebasing might be a good idea
Yep, looks like that helped. Thanks.
I guess item movers are ready for review - https://github.com/rust-analyzer/rust-analyzer/pull/8054