This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Don't show base class versions of members as completions.
ClosedPublic

Authored by sammccall on Oct 23 2018, 6:51 AM.

Details

Summary

These are available via qualifiers, but signal to noise level is low.
Keep required quailifier machinery around though, for cross-ns completion.

Diff Detail

Event Timeline

sammccall created this revision.Oct 23 2018, 6:51 AM

Keep required quailifier machinery around though, for cross-ns completion.

Do we have cross-ns completion in sema?

clangd/CodeComplete.cpp
732

Are there hidden results that are neither declarations nor class members and do not require qualifier?

Keep required quailifier machinery around though, for cross-ns completion.

Do we have cross-ns completion in sema?

No, I don't think so. I meant RequiredQualifier etc.
Unfortunately I've got no idea whether there are !QualifierIsInformative cases in Sema we still care about, so I don't know whether that logic is safe to remove...

clangd/CodeComplete.cpp
732

I don't know. I thought a namespace-scope thing shadowed by a member was such a case, but it doesn't seem to generate results at all.

But that (hypothetical) example illustrates a point: I do think we would want to show ns::foo() if it was shadowed by MyClass()::foo(). The difference is that they're probably fundamentally different things that share a name, while MySubClass::foo() is usually just a strictly better version of MyBaseClass::foo() as far as a caller is concerned.

sammccall updated this revision to Diff 170863.Oct 24 2018, 6:16 AM

Remove misleading change to test.

ioeric accepted this revision.Oct 24 2018, 6:28 AM

The diff seems to be wrong. Please rebase.

clangd/CodeComplete.cpp
732

Fair enough. Thanks!

This revision is now accepted and ready to land.Oct 24 2018, 6:28 AM
This revision was automatically updated to reflect the committed changes.