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

Honor ClientRequiresNamedArguments when UseSingleObjectParameterDeserialization is set #734

Merged

Conversation

dibarbet
Copy link
Member

@dibarbet dibarbet commented Nov 11, 2021

Discovered while attempting to use the new attributes added in #733

Essentially when the client sends a request with a progress token using named parameters and the server is using UseSingleObjectParameterDeserialization, vs-streamjsonrpc fails to pass along the value of clientRequiresNamedArguments to the JsonProgress object.

This is exactly the configuration I hit as vscode uses named parameters and we make heavy use of UseSingleObjectParameterDeserialization in our lsp server.

The problem was that we essentially have a separate code path for handling RPC server methods that accept all args as a single argument (a special case built for LSP support), and we hadn't updated that code path to propagate the JsonRpcMethodAttribute in the special case.

@dibarbet dibarbet marked this pull request as draft November 11, 2021 06:31
…ification from server when the client passes in a request with named parameters and the server is using SingleObjectParameterDeserialization
…ram deserialization so it can access client requires named params attribute
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2021

Codecov Report

Merging #734 (b0c889f) into main (ac1f0c5) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #734      +/-   ##
==========================================
+ Coverage   91.54%   91.56%   +0.02%     
==========================================
  Files          60       60              
  Lines        5228     5230       +2     
==========================================
+ Hits         4786     4789       +3     
+ Misses        442      441       -1     
Impacted Files Coverage Δ
src/StreamJsonRpc/JsonMessageFormatter.cs 91.30% <100.00%> (+0.02%) ⬆️
...pc/Reflection/MessageFormatterDuplexPipeTracker.cs 90.62% <0.00%> (+1.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac1f0c5...b0c889f. Read the comment docs.

@AArnott AArnott marked this pull request as ready for review November 11, 2021 20:49
@AArnott AArnott changed the title Add example test to show issue with clientrequiresnamedparams + usesingleobjectdeserialization Honor ClientRequiresNamedArguments when UseSingleObjectParameterDeserialization is set Nov 11, 2021
@AArnott AArnott added this to the v2.10 milestone Nov 11, 2021
@AArnott AArnott merged commit b1b7bf7 into microsoft:main Nov 11, 2021
@dibarbet
Copy link
Member Author

thanks for the fix!

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

Successfully merging this pull request may close these issues.

4 participants