<div dir="ltr"><div dir="ltr">Sam has go/phab/D60409 ready to land. It will provide an option to disable the automatic insertion.</div><div dir="ltr"><br></div><div>Alternatively, clangd respects IWYU private pragma [0] which can be used by library owners to specify alternative (public) include headers for index symbols in private headers. </div><div><br></div><div>[0]: <a href="https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-private">https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-private</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 8:50 PM Simon Marchi via clangd-dev <<a href="mailto:clangd-dev@lists.llvm.org">clangd-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
In some cases, I find myself fighting against clangd automatically <br>
adding includes when choosing a completion item.  Is there a way to <br>
disable this feature?  If not, is there any opposition to adding one?<br>
<br>
One such example is when using glib.  The users of glib are supposed to <br>
only include glib.h, trying to include the more specific header files <br>
(such as glib/gscanner.h) results in an error:<br>
<br>
/usr/include/glib-2.0/glib/gscanner.h:29:2: error: #error "Only <glib.h> <br>
can be included directly."<br>
  #error "Only <glib.h> can be included directly."<br>
   ^~~~~<br>
<br>
When I choose a completion item, such as the GTokenType type, clangd <br>
automatically adds an include of "glib/gscanner.h", which I have to <br>
constantly remove before building.<br>
<br>
Ideally, this feature would always do the right thing in all situations, <br>
but since it's unlikely that clangd will ever be 100% right about this, <br>
I think it would be useful to be able to disable it.<br>
<br>
Thanks!<br>
<br>
Simon<br>
_______________________________________________<br>
clangd-dev mailing list<br>
<a href="mailto:clangd-dev@lists.llvm.org" target="_blank">clangd-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev</a><br>
</blockquote></div>