You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be a function to easily send a notification to the client from a plugin. This can currently be achieved via object_to_stdout, but in a somewhat unpleasant manner and makes the plugin authors have to figure out the details of the LSP/PSP api for sending information. (I think that function should also be hidden, and plugin authors using the library should just deal with functions for sending notifications/requests)
We can use lsp-types/psp-types Notification trait to make things more type-safe, like:
pubfnsend_notification<T:Notification>(params:T::Params){// Having them give the `T` ensures that they can't give us the wrong method name or the wrong params// They can still do custom notifications (like editor-specific notifs) via making a custom structure and implementing Notification on itlet method:&'static str = T::METHOD;// We could just have send_host_notification take `impl Serialize`?send_host_notification(method,json!(params));}
The text was updated successfully, but these errors were encountered:
There should be a function to easily send a notification to the client from a plugin. This can currently be achieved via
object_to_stdout
, but in a somewhat unpleasant manner and makes the plugin authors have to figure out the details of the LSP/PSP api for sending information. (I think that function should also be hidden, and plugin authors using the library should just deal with functions for sending notifications/requests)We can use lsp-types/psp-types
Notification
trait to make things more type-safe, like:The text was updated successfully, but these errors were encountered: