-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
lsp-csharp: handle interop notifications #2196
lsp-csharp: handle interop notifications #2196
Conversation
These were added by OmniSharp/omnisharp-roslyn#1911 to facilitate legacy clients (i.e. vscode) that will be transitioning to LSP.
This improves diagnostic procedure when projects cannot be loaded for some reason.
clients/lsp-csharp.el
Outdated
@@ -246,6 +246,11 @@ using the `textDocument/references' request." | |||
(lsp-show-xrefs (lsp--locations-to-xref-items locations-found) nil t) | |||
(message "No references found"))) | |||
|
|||
(defun lsp-csharp--handle-os-error (_workspace params) | |||
"Handle the 'o#/error' (interop) notification with PARAMS by displaying a message with lsp-warn." | |||
(-let (((&hash "FileName" filename "Text" text) params)) |
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.
we should not use &hash because soon we will switch to plist for internal representation of the jsonrpc objects.
You have 2 options:
- Use lsp-get
- Define data structures and then use the getters/destructorings generated for the interface.
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.
done (with opt 2)
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.
I faced this issue today 😅
Thanks for your contribution!
This adds handlers for '#o/XXX' notifications that have been added recently to facilitate omnisharp clients transitioning from custom to LSP protocol (see OmniSharp/omnisharp-roslyn#1911).
The events are ignored by default, except for 'o#/error' which may help resolving issues when projects are not being properly loaded (this may have helped to diagnose #2188)