mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-23 19:27:15 +00:00
I want to use the rpc interface for communication via stdin/out in wsl, but currently RPC is tightly coupled to the control server. The control server also speaks msgpack instead of JSON, since it deals with binary messages. WSL won't, and we'll want to use JSON to interact with VS Code, so some separation is needed. This pulls out a base set of RPC types for use in both scenarios. Currently these are only 'helper' structs that don't actually do any i/o, but once I figure out the model I would like to have a cleaner way to do i/o in a unified way as well. For the control server, previously we basically handled all methods in one big `switch` block with nasty macros, whereas now there's nicer `register_a/sync` functions. Some additional small refactors were needed to preserve the strict ordering of server messages, since they need to be order else we get decompression errors. This is the `start_bridge_write_loop`. As a small benefit, this means we can avoid the relatively expensive async Tokio mutex that we were using, and instead use the standard library mutex.