This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Bundle code completion items when the include paths differ, but resolve to the same file.
ClosedPublic

Authored by adamcz on Dec 2 2020, 10:02 AM.

Details

Summary

This can happen when, for example, merging results from an external
index that generates IncludeHeaders with full URI rather than just
literal include.

Diff Detail

Event Timeline

adamcz created this revision.Dec 2 2020, 10:02 AM
adamcz requested review of this revision.Dec 2 2020, 10:02 AM
adamcz updated this revision to Diff 309003.Dec 2 2020, 10:03 AM

-bracket

usaxena95 accepted this revision.Dec 2 2020, 10:57 PM
This revision is now accepted and ready to land.Dec 2 2020, 10:57 PM
kadircet added inline comments.Dec 9 2020, 1:16 AM
clang-tools-extra/clangd/CodeComplete.cpp
187

(sorry for the late drive by comment)

if this returns an error it needs to be consumed to ensure we don't crash (destructor of Expected asserts)

but apart from that, this introduces lots of new string manipulations for every completion item, might have bad impact on latency especially when the include paths are long and require heap allocations. something to keep in mind once this hits production (and maybe we can choose to approximate or not do it at all if it turns out to be problematic)