-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add on_server_notification_async API #2496
Conversation
First I tired to make it look like on_server_response_async but the method argument is redundant
""" | ||
Notifies about a notification message that has been received from the language server. | ||
|
||
:param notification: The notification object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... "The notification object."
I couldn't think of better 🙈
Although Copilot is doing some unconventional ideas. The use case is strong, in that helpers could also us it to raise information |
Copilot is adhering to the spec here https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress
|
Just for leaving a clue on how to implement it in packages: Here example with from lsp_utils import NpmClientHandler
class LspMyPackage(NpmClientHandler):
def on_server_notification_async(self, notification) -> None:
if notification.method == '$/progress':
print('read this notification', notification.params) Here example with from LSP.plugin import AbstractPlugin
class LspMyPackage(AbstractPlugin):
def on_server_notification_async(self, notification) -> None:
if notification.method == '$/progress':
print('read this notification', notification.params) |
closes #2494
This API allows LSP-* to hook into when a notification is received form the language server.