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
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?
The text was updated successfully, but these errors were encountered:
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 message
However, if you need the client to reply to your message then send_request or send_request_async will handle waiting for the response for you. Here you can find examples of using those
What 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 :)
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?
The text was updated successfully, but these errors were encountered: