This is an archive of the discontinued LLVM Phabricator instance.

[CodeComplete] Add an option to omit results from the preamble.
ClosedPublic

Authored by sammccall on Jan 12 2018, 5:51 AM.

Details

Summary

Enumerating the contents of a namespace or global scope will omit any
decls that aren't already loaded, instead of deserializing them from the
PCH.

This allows a fast hybrid code completion where symbols from headers are
provided by an external index. (Sema already exposes the information
needed to do a reasonabl job of filtering them).
Clangd plans to implement this hybrid.

This option is just a hint - callers still need to postfilter results if
they want to *avoid* completing decls outside the main file.

Diff Detail

Repository
rC Clang

Event Timeline

sammccall created this revision.Jan 12 2018, 5:51 AM

This is basically all plumbing, so I've marked the two lines that actually do something :-)

lib/Sema/SemaLookup.cpp
3517–3522

here's a substantive change

3546

here's a substantive change

ilya-biryukov accepted this revision.Jan 12 2018, 6:32 AM

LGTM modulo the comment about variable name.

lib/Sema/SemaLookup.cpp
3502

Maybe rename the variable to LoadExternal?
The intention of Load is not immediately clear. Also a bit longer name seems to be more in-line with the other code in this file.

This revision is now accepted and ready to land.Jan 12 2018, 6:32 AM
sammccall updated this revision to Diff 129618.Jan 12 2018, 6:47 AM

Load -> LoadExternal

sammccall marked an inline comment as done.Jan 12 2018, 6:48 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.