Skip to content
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

Difference between context.Notify and context.Call #35

Open
Myzel394 opened this issue Oct 6, 2024 · 1 comment
Open

Difference between context.Notify and context.Call #35

Myzel394 opened this issue Oct 6, 2024 · 1 comment

Comments

@Myzel394
Copy link

Myzel394 commented Oct 6, 2024

Hey I was wondering what's the difference between context.Notify and context.Call - it took me a few hours to find out that you need to use context.Call for the workspace/applyEdit command to work :C I think some documentation here could potentially save future people's time too :D

From the arguments, I can see that context.Call takes a result argument - what is this exactly? From my understanding, I'd expect this to be returned from the client instead of the server specifying it

@rcjsuen
Copy link

rcjsuen commented Oct 12, 2024

From the arguments, I can see that context.Call takes a result argument - what is this exactly? From my understanding, I'd expect this to be returned from the client instead of the server specifying it

When you send a JSON-RPC request, you are expecting a result to come back from the "other side".

// request
{"jsonrpc": "2.0", "id": 1, "method": "subtract", "params": [42, 23]}
// result
{"jsonrpc": "2.0", "id": 1, "result": 19}

The result argument you specify will have the result deserialized "into" as can be seen here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants