This is useful for the remote index: system libraries and external dependencies
would still have a different location on local and remote machine, so they
should be simply excluded.
Details
- Reviewers
hokein
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/indexer/IndexerMain.cpp | ||
---|---|---|
110 | I think we could reuse the FileShardedIndex to do the filtering job, rather than implementing a new one. |
clang-tools-extra/clangd/indexer/IndexerMain.cpp | ||
---|---|---|
110 | Ah, this is interesting, I haven't seen FileShardedIndex before, let me take a look at its API, it looks like a convenient piece of infrastructure for implementing this! |
clang-tools-extra/clangd/indexer/IndexerMain.cpp | ||
---|---|---|
70 | FileFilter seems more promising, but there are some FIXMEs ("use the result to filter out symbols.") in the SymbolCollector.cpp` -- looks like the SymbolCollector doesn't support this yet, sigh... |
clang-tools-extra/clangd/indexer/IndexerMain.cpp | ||
---|---|---|
70 | Hmm, you are right. However, I tried running the indxer with and without new option and the number of symbols & references was different. Hmm, this is interesting, I wonder why this happened. Yeah, I think I should update the code to make sure everything works. Thanks for noticing it! |
Even despite FileFilter not being fully implemented yet (an issue for a separate patch) I think this change should still be correct and is probably OK to land, WDYT @hokein?
Yes, personally no objection on landing this, but landing it doesn't seem to help much for your remote-index case (STL symbols are not filtered out)?
True, it doesn't filter _all_ of them, but it partially filters some symbols which is still a win I guess :) My rationale is probably that having this blocked on more implementation details would be more reasonable if there was no implementation at all but since it still filters out some symbols this should probably be fine.
It just reduces symptoms, not solving the problem. I think remote-index is also blocked the FileFiltering stuff (we can't launch remote-index without fixing this issue entirely).
As you may have noticed implementing FileFiltering is tricky, I think the indexer here is a good opportunity to test/verify your implementation (comparing the index data before vs after), so my preference would be to implement the FileFilter, test it with this patch together, then finally land this patch after making sure everything works.
FileFilter seems more promising, but there are some FIXMEs ("use the result to filter out symbols.") in the SymbolCollector.cpp` -- looks like the SymbolCollector doesn't support this yet, sigh...