rwols added inline comments.

================
Comment at: clangd/ClangdLSPServer.cpp:93
 
+void ClangdLSPServer::replyWithTextEditsOrError(
+    Ctx C, std::string Code,
----------------
sammccall wrote:
> This function is pretty hard to understand from a high level - it's a bit of 
> an odd split.
> 
> Is the duplication really so bad? The straight-line code could be easy to 
> read:
> 
>     auto File = Params.textDocument.uri.file;
>     auto Edits = Server.formatRange(File, Params.range);
>     if (Edits)
>       C.reply(replacementsToEdits(Server.getDocument(File), Edits.get()));
>     else
>       C.replyError(Edits.takeError());
> 
> (The "[" won't be needed after D39435, and we should add a replyError() 
> overload that takes an Error)
This is a very nice idea! I'll probably update the diff tomorrow.


https://reviews.llvm.org/D39430



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to