Currently we emit an unfriendly "clang diagnostic" message when rename fails. This
patch makes clangd to emit a detailed diagnostic message.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
Event Timeline
clang-tools-extra/clangd/ClangdServer.cpp | ||
---|---|---|
57 ↗ | (On Diff #195553) | why inject the DE here (and handle mapping errors both in the caller and here) rather than always doing the mapping in the caller? |
60 ↗ | (On Diff #195553) | I'm confused about this, take() seems to return Optional<PartialDiagnosticAt>, but you're passing it as a DiagnosticError ... oh, DiagnosticError has a constructor from PartialDiagnosticAt. This seems unneccesarily confusing, just pass the PartialDiagnostic? |
315 ↗ | (On Diff #195553) | can we avoid this duplication by giving a helper function more responsibilities? |
LG, thanks!
I do think it can be further simplified, but if not then land as-is.
clang-tools-extra/clangd/ClangdServer.cpp | ||
---|---|---|
57 ↗ | (On Diff #195553) | But we just store the err in Result, and then ClangdServer::rename does if (!ResultCollector.Result.getValue()) return CB(ResultCollector.Result->takeError()); can it wrap the takeError() in expandDiagnostics()? it still has access to the diagnosticsengine I think |