Open barkanido opened 10 months ago
Many objects have a field like CompletionItem.data
where you can store arbitrary data - which may or may not be useful to you.
Alternatively you can send custom messages to the client.
notify
is probably the easiest to get started with as it allows you to send a one off message to the client. Here is an example of a custom notification messagesend_request
or send_request_async
will handle waiting for the response for you. Here you can find examples of using thoseWhat happens client side is ultimately up to the language and/or framework that the client is written in.
In VSCode/TypeScript for example I'm able to define an interface
that describes the structure of the custom message coming from the server and then reference it in the handler definition - at the lowest level though it's all JSON :)
Hope that helps!
Hi, In addition to signals sent to the client like logs and notifications, I need to return some custom data to the client. What is pygls api for returning, say, a nested dict? Should i return a response or there is a wrapping api fot that? What will the client expect then? A raw json? Or the languages specific desirialization of the related json?