<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="text-align:left; direction:ltr;">
<div>Can we at least make it less aggressive? I'm working on a GTK app and it keeps inserting includes when I already have the symbols available to me through a different one. Or is that the intent?</div>
<div><br>
</div>
<div>Doug.</div>
<div><br>
</div>
<div>On Thu, 2019-04-11 at 10:48 +0200, Ilya Biryukov via clangd-dev wrote:</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<div dir="ltr">
<div dir="ltr">We actually have something very similar implemented in the code ("clangd/CanonicalIncludes.h"), but we don't support the IWYU mapping file format.</div>
<div>I'm not sure how much work implementing that is, though.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Apr 10, 2019 at 11:28 PM Simon Marchi via clangd-dev <<a href="mailto:clangd-dev@lists.llvm.org">clangd-dev@lists.llvm.org</a>> wrote:<br>
</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
On 2019-04-10 4:23 a.m., Ilya Biryukov wrote:<br>
> FWIW, having a mapping for libraries like glib seems useful even if they do get patched to add IWYU pragmas.<br>
> There always a rather large amount of older versions floating around...<br>
> <br>
> Sam McCall via clangd-dev <<a href="mailto:clangd-dev@lists.llvm.org" target="_blank">clangd-dev@lists.llvm.org</a> <mailto:<a href="mailto:clangd-dev@lists.llvm.org" target="_blank">clangd-dev@lists.llvm.org</a>>> schrieb am Mi., 10. Apr. 2019, 09:22:<br>
> <br>
>     I'm a little hesitant to mention this, as it's a bit of a pandora's box, but...<br>
>     If it's hard to get prominent libraries like glib patched, we could have a lookup table, and pretend we saw such directives...<br>
<br>
IWYU seems to support the equivalent of pragmas, but specified outside the headers,<br>
and calls that "Mappings":<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_include-2Dwhat-2Dyou-2Duse_include-2Dwhat-2Dyou-2Duse_blob_master_docs_IWYUMappings.md&d=DwMFaQ&c=yzoHOc_ZK-sxl-kfGNSEvlJYanssXN3q-lhj0sp26wE&r=NrrbvTHWa2Nbp_kAN0Hl1o3lM1WAwSes64uBjxjNhMc&m=dwoj2SW-idMT8zcfeT5cAlFYZloA-cX-fETqsyUlHag&s=ks0BVfX9t7mFxAD-XnagWKmFq8yQYXobR5EFeI69Gj4&e=" rel="noreferrer" target="_blank">https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md</a><br>
<br>
It would probably be possible to write such a mapping file for a specific version of the glib<br>
library.  Then, it would be a matter of making clangd read and respect those, like it would<br>
respect the pragmas.  But it would be the user's responsibility to configure that properly.<br>
<br>
As sugar on top, clangd could always ship with some built-in IWYU mapping files contributed<br>
by the community (is there a repository of such files for various libraries somewhere?).  I<br>
am not sure though how it would identify that a certain library is in use (and which version)<br>
to load the appropriate mapping file.<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://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_clangd-2Ddev&d=DwMFaQ&c=yzoHOc_ZK-sxl-kfGNSEvlJYanssXN3q-lhj0sp26wE&r=NrrbvTHWa2Nbp_kAN0Hl1o3lM1WAwSes64uBjxjNhMc&m=dwoj2SW-idMT8zcfeT5cAlFYZloA-cX-fETqsyUlHag&s=-bl24Yj4UrwwexOsVSofhE3OP_iQQhhxlWwcCiwggPU&e=" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
<pre>_______________________________________________</pre>
<pre>clangd-dev mailing list</pre>
<pre><a href="mailto:clangd-dev@lists.llvm.org">clangd-dev@lists.llvm.org</a></pre>
<pre><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_clangd-2Ddev&d=DwIGaQ&c=yzoHOc_ZK-sxl-kfGNSEvlJYanssXN3q-lhj0sp26wE&r=NrrbvTHWa2Nbp_kAN0Hl1o3lM1WAwSes64uBjxjNhMc&m=dwoj2SW-idMT8zcfeT5cAlFYZloA-cX-fETqsyUlHag&s=-bl24Yj4UrwwexOsVSofhE3OP_iQQhhxlWwcCiwggPU&e=">https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_clangd-2Ddev&d=DwIGaQ&c=yzoHOc_ZK-sxl-kfGNSEvlJYanssXN3q-lhj0sp26wE&r=NrrbvTHWa2Nbp_kAN0Hl1o3lM1WAwSes64uBjxjNhMc&m=dwoj2SW-idMT8zcfeT5cAlFYZloA-cX-fETqsyUlHag&s=-bl24Yj4UrwwexOsVSofhE3OP_iQQhhxlWwcCiwggPU&e=</a></pre>
<pre><br></pre>
</blockquote>
</body>
</html>