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
 - rG LLVM Github Monorepo
 - Build Status
 Buildable 30681 Build 30680: arc lint + arc unit 
Event Timeline
| clang-tools-extra/clangd/ClangdServer.cpp | ||
|---|---|---|
| 57 | 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 | 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 | 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 | 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  | |
why inject the DE here (and handle mapping errors both in the caller and here) rather than always doing the mapping in the caller?