This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Implement Relations request for remote index
ClosedPublic

Authored by kbobyrev on Jul 29 2020, 3:30 PM.

Details

Summary

This is the last missing bit in the core remote index implementation. The only
remaining bits are some API refactorings (replacing Optional with Expected and
being better at reporting errors).

Diff Detail

Event Timeline

kbobyrev created this revision.Jul 29 2020, 3:30 PM
kbobyrev requested review of this revision.Jul 29 2020, 3:30 PM
kbobyrev updated this revision to Diff 281754.Jul 29 2020, 3:34 PM

Fix comment in proto file and rebase on top of master.

thanks mostly nits, only annoying bit is usage of optionals and multi-logging but letting them be for now :D.

also looks like there are some irrelevant changes, e.g. auto's in lambdas or formatting in protos, feel free to land an NFC change(without review) for those before landing this.

clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp
385

nit: why not just do:

RelationsRequest Serialized;
Serialized.add_subjects("ZZZZZZZZZZZZZZZZ");
// check for failure during deserialization
394

nit: move it near Sym.ID assignemnt.

398

nit: I would move all of the following population logic into a helper and share between here and symbol serialization tests.

423

nit: swap parameters ID is expected, Deserialized->first is actual.

426

i think this is already tested in symbol deserialization test above, feel free to leave it out.

428

again this should be part of symbol serialization tests.

kbobyrev updated this revision to Diff 281863.Jul 30 2020, 3:31 AM
kbobyrev marked 6 inline comments as done.

Address all comments.

kadircet accepted this revision.Jul 30 2020, 3:43 AM

thanks, lgtm!

clang-tools-extra/clangd/unittests/remote/MarshallingTests.cpp
391

i think you should still check for Deserialized->first == ID and Deserialized->second->ID == Sym.Id

This revision is now accepted and ready to land.Jul 30 2020, 3:43 AM
kbobyrev updated this revision to Diff 281869.Jul 30 2020, 3:56 AM
kbobyrev marked an inline comment as done.

Address post-LGTM comment.

This revision was landed with ongoing or failed builds.Jul 30 2020, 3:58 AM
This revision was automatically updated to reflect the committed changes.