This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Avoid inserting new #include when declaration is present in the main file.
ClosedPublic

Authored by ioeric on May 29 2018, 3:03 AM.

Details

Summary

Also fix USR generation for classes in unit tests. The previous USR
only works for class members, which happens to work when completing class name
inside the class, where constructors are suggested by sema.

Diff Detail

Repository
rL LLVM

Event Timeline

ioeric created this revision.May 29 2018, 3:03 AM
sammccall accepted this revision.May 29 2018, 4:26 AM
sammccall added inline comments.
clangd/CodeComplete.cpp
249 ↗(On Diff #148870)

do you need to iterate over all redecls?

251 ↗(On Diff #148870)

ShouldInsertInclude = ShouldInsertInclude && ... would be a little more future-proof

This revision is now accepted and ready to land.May 29 2018, 4:26 AM
ioeric updated this revision to Diff 149061.May 30 2018, 2:05 AM
ioeric marked 2 inline comments as done.

Addressed review comments.

This revision was automatically updated to reflect the committed changes.