<div dir="ltr">Agree, having some errors is probably more useful than having none.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 13, 2018 at 6:12 PM Sam McCall <<a href="mailto:sam.mccall@gmail.com">sam.mccall@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 13, 2018, 17:43 Ilya Biryukov <<a href="mailto:ibiryukov@google.com" target="_blank">ibiryukov@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Dan, Sam,<div><br></div><div>Synthesizing the diagnostics sounds good!</div><div>Also agree we should summarize all diags coming from the include in a single message to avoid potentially reporting a hundred diags at the same line.</div><div>Please also note that we can't catch any errors in function bodies, since we skip those. That's one of the reasons we don't report diags from other files now - we just can't do it reliably.</div></div></blockquote></div></div><div dir="auto">For the most part I suspect this will be acceptable. Uses mostly care about errors in headers to the extent that they impact the file theyre editing, and function bodies mostly don't do that.</div><div dir="auto"><br></div><div dir="auto">Careful observers will notice the discrepancy, but that's what they get for being careful :-)</div><div dir="auto"><br></div><div dir="auto">(There may be edge cases around templates too, as usual)</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Missing files are actually the most common source of inconsistencies in the current file, though, reporting them is definitely the right thing to do!</div><div>Dan, would you be interested in coming up with a patch to fix this? We're always happy to get new contributions.<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 13, 2018 at 4:37 PM Sam McCall via clangd-dev <<a href="mailto:clangd-dev@lists.llvm.org" rel="noreferrer" target="_blank">clangd-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">+<a href="mailto:clangd-dev@lists.llvm.org" rel="noreferrer" target="_blank">clangd-dev@lists.llvm.org</a><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 10, 2018 at 12:13 AM Dan Walmsley <<a href="mailto:dan@walms.co.uk" rel="noreferrer" target="_blank">dan@walms.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
Hi, I hope you dont mind me contacting you directly.</div></div></blockquote><div>I don't mind at all, but I'm out on parental leave so can't give this the attention it deserves. Adding the dev list.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt"><a id="m_1171315501507002782m_285642924148080081m_-9201414049175034663m_6008471536799145866LPlnk301251" href="https://github.com/llvm-mirror/clang-tools-extra/blame/86961faaaf0b56b1c5dac2ed979987879cbc5294/clangd/Diagnostics.cpp#L376" style="font-size:12pt" rel="noreferrer" target="_blank">https://github.com/llvm-mirror/clang-tools-extra/blame/86961faaaf0b56b1c5dac2ed979987879cbc5294/clangd/Diagnostics.cpp#L376</a></div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
I am integrating ClangD with an open source IDE. I have come across a minor issue, but its most likely my inexperience with clangd.</div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
So if I have a file that includes another file and that file has an include that cant be found, the diagnostics for that missing include get dropped.</div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
How would I be able to indicate to the users that there is a missing include file, or get hold of the dropped diagnostic without the user having to open that file first?</div></div></blockquote><div>So if we're dropping the "foo.h was not found" diagnostic when the missing file is directly included by the active file, this is just a bug we should fix. (I seem to recall this might be happening, at least in some situations).</div><div><br></div><div>For diagnostics that occur in other files, we do currently just drop them, but we should do something smarter. (This includes transitive includes like main.cc -> foo.h -> bar.h where bar.h is missing, but also if foo.h has a syntax error).</div><div><br></div><div>I'd suggest we synthesize a diagnostic at the #include site that says something like:</div><div><br></div><div>> Included file had errors:<br></div><div>></div><div>> foo.h:21: Missing ';'</div><div>> foo.h:43: No such member 'qux', did you mean 'quux'</div><div>> ...</div><div><br></div><div>What do you think?</div><div>(And anyone on clangd-dev want to take this up before I get back to work?)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
Any hints or advice is greatly appreciated.</div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
Many Thanks</div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
Dan - working on AvalonStudio <a href="http://github.com/VitalElement/AvalonStudio" rel="noreferrer" target="_blank">http://github.com/VitalElement/AvalonStudio</a></div></div></blockquote><div>Hadn't heard about AvalonStudio, will check it out!</div><div>Please hit up clangd-dev if we can help! </div></div></div>
_______________________________________________<br>
clangd-dev mailing list<br>
<a href="mailto:clangd-dev@lists.llvm.org" rel="noreferrer" target="_blank">clangd-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev" rel="noreferrer noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_1171315501507002782m_285642924148080081gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Ilya Biryukov</div></div></div></div></div>
</blockquote></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Ilya Biryukov</div></div></div></div></div>