lapce-plugin-rust
lapce-plugin-rust copied to clipboard
Async Requests
It would be good to have the ability to send asynchronous requests, and handle the result via a callback.
Ex: Sending a command to a spawned LSP server shouldn't typically need to block the plugin. It can typically handle multiple requests (like multiple commands being ran) that it then can immediately send to the likely-multithreaded LSP for processing.
This would probably require modifying handle rpc to take into account responses. Possibly having some sort of HashMap<Id, Callback>
store on PluginServerRpcHandler
.
(Or we could use actual Rust async but I'm unsure of the nicest way to fit that into this. Also we currently have STATE
be a thread local, etc.)