[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358675: [clangd] Support relatedInformation in diagnostics. (authored by sammccall, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Discussed further offline - it's not clear that expressing the flattening as LSP diagnostic -> LSP diagnostic is better than the current Diag -> LSP diagnostic. So that followup probably won't happen, and there isn't that much to be gained from "unifying" the

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 2 inline comments as done. sammccall added inline comments. Comment at: clangd/Diagnostics.cpp:271 + if (!Note.AbsFile) { +log("Dropping note from unknown file: {0}", Note); +continue; kadircet wrote: > ilya-biryukov wrote:

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clangd/Diagnostics.cpp:271 + if (!Note.AbsFile) { +log("Dropping note from unknown file: {0}", Note); +continue; ilya-biryukov wrote: > Maybe `vlog`? This is what we use for dropped diagnostics,

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195706. sammccall added a comment. Propagate the capability to Diagnostics, add lit test. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60267/new/ https://reviews.llvm.org/D60267 Files:

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195707. sammccall added a comment. Remove accidental copy/paste in lit test. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60267/new/ https://reviews.llvm.org/D60267 Files: clangd/ClangdLSPServer.cpp

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 195694. sammccall marked an inline comment as done. sammccall added a comment. Rebase and address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60267/new/ https://reviews.llvm.org/D60267 Files:

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 9 inline comments as done. sammccall added inline comments. Comment at: clangd/Diagnostics.cpp:280 + Main.relatedInformation->push_back(std::move(RelInfo)); +} } ilya-biryukov wrote: > NIT: maybe call `OutFn` and return here to avoid

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-10 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/Protocol.cpp:280 R.DiagnosticFixes = *CodeActions; + if (auto CodeActions = Diagnostics->getBoolean("relatedInformation")) +R.DiagnosticRelatedInformation = *CodeActions; kadircet

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-10 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clangd/Protocol.cpp:280 R.DiagnosticFixes = *CodeActions; + if (auto CodeActions = Diagnostics->getBoolean("relatedInformation")) +R.DiagnosticRelatedInformation = *CodeActions;

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-10 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/Diagnostics.cpp:271 + if (!Note.AbsFile) { +log("Dropping note from unknown file: {0}", Note); +continue; Maybe `vlog`? This is what we use for dropped diagnostics, should probably

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-10 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/Diagnostics.cpp:185 OS << Note.Message; - OS << "\n\n"; - printDiag(OS, Main); + // If there's no structured link between the note and the original diagnostic + // then emit the main diagnostic to give context.

[PATCH] D60267: [clangd] Support relatedInformation in diagnostics.

2019-04-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ioeric. Herald added a project: clang. We already have the structure internally, we just need to expose it. Repository: rCTE Clang Tools