This is needed for call hierarchy to be able to find callers of
main-file-only functions.
Details
- Reviewers
kadircet - Commits
- rGc6cb47b640ff: [clangd] Collect main file refs by default
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
i remember discussing this in the past, and having "negative" feelings about it. I couldn't find the discussion on the issues page tho, could you toss me the link if you can find it? (it might've been an offline discussion as well, sorry if that's the case for not dumping a summary).
But if there were no discussions before, it would be nice to see some numbers, for increase in memory and disk usage for LLVM.
NVM, found the summary https://github.com/clangd/clangd/issues/162#issuecomment-653981038
Note, the call hierarchy feature is pretty significantly impaired without this. See the example of Selection::createEach() discussed in this comment.
Thanks, LGTM.
clang-tools-extra/clangd/tool/ClangdMain.cpp | ||
---|---|---|
497 | can we just change the default in ClangdServer::Options and also use that one in here (i.e. ClangdServer::Options().CollectMainFileRefs)? without plumbing the change to symbolcollector and fileindex ? |
nope, as it doesn't change the serialization format. but any existing shards won't have refs from the main file, they'll accumulate over time as sources gets modified. (i don't think it is worth bumping the version to invalidate existing shards, if a user cares enough they can manually delete their cache)
can we just change the default in ClangdServer::Options and also use that one in here (i.e. ClangdServer::Options().CollectMainFileRefs)? without plumbing the change to symbolcollector and fileindex ?