[PATCH] D43550: [clangd] Not collect include headers for dynamic index for now.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 21 03:37:49 PST 2018


ioeric added a comment.

In https://reviews.llvm.org/D43550#1014319, @ilya-biryukov wrote:

> Is there a way to still enable include insertion but in a restricted manner, e.g. only for the current project?


I'm not sure if this is currently supported, as we don't have a good definition of a "project" yet. Could you provide a use case?

> File of canonical declaration is usually a pretty good guess and it would be nice to have it. Maybe we could allowing to disable the include insertion via a flag or config parameter rather than disabling it for dynamic index entirely.

Yes, it is a nice-to-have, when it works :) Without proper canonicalization, this could easily go wrong (e.g. we don't want to insert gtest/gmock internal headers guarded by IWYU pragma).

Do you think it's beneficial to collect headers in dynamic index even when it doesn't work correctly? Again, I'm not arguing that collecting includes in dynamic index is not worth doing; I just think it's a rabbit hole that we don't need to chase down at this point :)

> It bugs me that internal STL headers are added all the time, but it also lets me test the feature without building the static index. I find the second more valuable, given that we're still actively working on it.

I think we can test the feature in a safer approach (e.g. build a small static index offline) while not bugging normal users with the wrong includes, which IMO would hurt code completion experience very badly... In general, I think user experience is much more valuable than us being able to test features.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43550





More information about the cfe-commits mailing list