<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 8, 2018 at 5:00 AM Ilya Biryukov via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ilya-biryukov added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D50154#1191002" rel="noreferrer" target="_blank">https://reviews.llvm.org/D50154#1191002</a>, @dblaikie wrote:<br>
<br>
> What's the motivation for clangd to differ from clang here?<br>
<br>
<br>
The presentation of diagnostics to the users is different between clang and clangd:<br>
<br>
- clang diagnostics are always prefixed with the file, location and severity of the diagnostic, e.g. `main.cpp:1:2: error: expected '}'`<br></blockquote><div><br>*nod* That's a fairly natural one - and I assume the information is provided semantically - source, line, column, and text. A client can stitch them together as clang does or it can render the information some other way (by placing the text as a mouseover/popup at the source location). I don't see that as a divergence - but providing the full fidelity of the information (rather than prematurely stringifying it all together) & leaving it up to the client to decide how to render it to the user.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- In LSP clients (VSCode in particular), the diagnostic message is the first thing the user sees and it looks a little nicer (subjectively) if the first letter is capitalized.<br></blockquote><div><br></div><div>It looks nicer in VSCode because that's the UI convention for mouseover text (in Windows, at least) - first letter capitalized. But it seems hard to me to generalize from there to all or most LSP clients. (& I also worry that such a mechanical transformation might be erroneous in some messages)<br><br>(well, there's at least one case where reversing this would fail - there's a diagnostic in Clang that starts with "ISO" - so uppercasing does nothing, but lowercasing it to try to get back to the original would result in "iSO" - several others like "Objective-C", "Neon", "GCC", etc)<br><br>(also, there's one that this will mangle: "ms_struct may not produce Microsoft-compatible layouts" - I assume capitalizing "ms_struct" would be incorrect (though arguably/mostly identifiers like that are quoted in error messages - and that may be reasonable/correct/better to do that here). Similar use of 'sizeof' at the start of a diagnostic, 'os_log()', - those'll be an issue no matter where the implementation is (in clangd or its client(s)) though - short of having a more customized thing in the diagnostics table itself to record which things can be capitalized/how they should be capitalized - but, yeah, arguably quoting might be the right thing in many, maybe all, of those cases)<br><br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
See the screenshots from VSCode on how diagnostics are presented:<br>
F6901986: image.png <<a href="https://reviews.llvm.org/F6901986" rel="noreferrer" target="_blank">https://reviews.llvm.org/F6901986</a>> F6901990: image.png <<a href="https://reviews.llvm.org/F6901990" rel="noreferrer" target="_blank">https://reviews.llvm.org/F6901990</a>><br>
<br>
<br>
Repository:<br>
  rCTE Clang Tools Extra<br>
<br>
<a href="https://reviews.llvm.org/D50154" rel="noreferrer" target="_blank">https://reviews.llvm.org/D50154</a><br>
<br>
<br>
<br>
</blockquote></div></div>