This patch adds support for diagnostic message capitalization to Clangd. The diagnostic messages are now always capitalized.
Oh sorry, I thought -capitialize-diagnostic-text was an existing clang flag, in which case we should respect it. I don't think there is any con that I could think of, as long as it looks nice in clients :)
What's the motivation for clangd to differ from clang here? (& if the first
letter is going to be capitalized, should there be a period at the end? But
also the phrasing of most/all diagnostic text isn't in the form of complete
sentences, so this might not make sense)
It's mostly for the presentation purposes, to match the needs of our client. I first implemented it as an opt-in feature, but the consensus was to capitalize the messages all the time.
I don't think it would make sense to insert the period at the end, because, as you said, not all diagnostics are complete sentences
The presentation of diagnostics to the users is different between clang and clangd:
- clang diagnostics are always prefixed with the file, location and severity of the diagnostic, e.g. main.cpp:1:2: error: expected '}'
- 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.
See the screenshots from VSCode on how diagnostics are presented: