This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Code completion uses Sema for NS-level things in the current file.
ClosedPublic

Authored by sammccall on Jan 12 2018, 8:52 AM.

Details

Summary

To stay fast, it avoids deserializing anything outside the current file, by
disabling the LoadExternal code completion option added in r3223771, when the
index is enabled.

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Jan 12 2018, 8:52 AM
hokein accepted this revision.Jan 12 2018, 9:22 AM

nice, LGTM.

By r322377, I think you mean r322371.

We also need to set CollectorOpts.IndexMainFiles to false in FileIndex.cpp::indexAST -- we don't need dynamic index to catch the symbols in current main file since sema does that for us now :)

This revision is now accepted and ready to land.Jan 12 2018, 9:22 AM
sammccall edited the summary of this revision. (Show Details)Jan 12 2018, 10:13 AM

nice, LGTM.

By r322377, I think you mean r322371.

Done.

We also need to set CollectorOpts.IndexMainFiles to false in FileIndex.cpp::indexAST -- we don't need dynamic index to catch the symbols in current main file since sema does that for us now :)

This would fix the problem. But it will break index-based go-to-definition for modified files, so I'd rather leave this at least for now, and pursue deduplicating symbols instead.

This revision was automatically updated to reflect the committed changes.