This is an archive of the discontinued LLVM Phabricator instance.

[Clangd] Failed to decode params using 1.x-compatible request message
ClosedPublic

Authored by malaperle-ericsson on Apr 19 2017, 12:07 PM.

Details

Summary

textDocument/completion sends a TextDocumentPositionParams message in the 2.x
and 3.x. But in 1.x it was instead a TextDocumentPosition with inlined
parameters. This means that the "uri" field is at the top level and not in
textDocument. Because of this, some clients that maintain compability with 1.x
have both uri and textDocument.uri. Clangd, however, early returns in the
presence of anything but 'textDocument' or 'position' which prevents a client
compatible with both 3.x and 1.x to work correctly. If Clangd was a bit more
permissive (no early return), clients implementing all the versions of the
protocol would work.

Diff Detail

Repository
rL LLVM

Event Timeline

malaperle-ericsson set the repository for this revision to rL LLVM.
malaperle-ericsson added a project: Restricted Project.
malaperle-ericsson added a subscriber: cfe-commits.
bkramer edited edge metadata.Apr 19 2017, 12:59 PM

A test case would be nice.

This revision is now accepted and ready to land.Apr 21 2017, 7:10 AM

Could you commit it? I don't have commit access :) Thanks!

This revision was automatically updated to reflect the committed changes.