-
Notifications
You must be signed in to change notification settings - Fork 126
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
ocamllsp/switchImplIntf results in "Jsonrpc: json conversion failed: missing field error" #1330
Comments
It seems the documentation is not correct. Sending a DocumentUri as a parm of ocamllsp/switchImplIntf fails, but sending the DocumentUri in a list does work. Like this: This is with |
Indeed, it looks like the query expects an (json) array with a single uri: https://github.com/ocaml/ocaml-lsp/blob/master/ocaml-lsp-server/src/custom_requests/req_switch_impl_intf.ml#L13-L14 This is explained by the base protocol LSP relies on: JSON-RPC
Do you want to open a PR to make it clearer in the documentation ? |
I'm not really good at this, but I think it would be better to extend the error message to this: |
Coming back to this issue, I don't see the reason why switchImplIntf and inferIntf have such a strange parameter when typedHoles simply accepts DocumentUri. I created a PR to fix it (the change for vscode-ocaml-platform will be minimal since they'll only have to remove |
So, I know nothing about ocaml, but wanted to support ocaml-lsp extensions in an LSP client. I installed ocaml-lsp with these commands:
Then I created a project with
opam exec -- dune init proj hello
and connected to the server and sent anocamllsp/switchImplIntf
request, which made the server die with an uncaught exception. Probably, the client sent something invalid, but (I think) the server should handle the situation more gracefully.This is the quest the client sends:
{"jsonrpc":"2.0","id":5,"method":"ocamllsp/switchImplIntf","params":"file:///tmp/hello/bin/main.ml"}
On the other hand, I'm guessing there's nothing wrong with the request itself, because if I change it to some other format, I get a jsonrpc-error: "The input parameter for ocamllsp/switchImplIntf is invalid".
At any rate, the communication log is below.
Thanks!
communication log
The text was updated successfully, but these errors were encountered: