[PATCH] D95229: [clangd] Treat optional field type mismatches as soft failures

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 27 06:18:59 PST 2021


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/Protocol.cpp:837
     return false;
+  tryMap(Params, "triggerCharacter", R.triggerCharacter, P);
   R.triggerKind = static_cast<CompletionTriggerKind>(TriggerKind);
----------------
sammccall wrote:
> why are we no longer checking the value?
oops, i was trying something different at some point and looks like i forgot to revert some of those changes ..


================
Comment at: clang-tools-extra/clangd/Protocol.cpp:33
+template <typename T>
+bool mapOptionalOrLog(llvm::json::ObjectMapper &O, llvm::StringLiteral Prop,
+                      T &Out) {
----------------
sammccall wrote:
> sammccall wrote:
> > I would call this tryMap for brevity
> Sorry... now that it can fail, I don't think `tryMap` is a great name anymore.
> 
> `mapOptOrNull`? `mapNullable`? 
> 
> up to you
going with `mapOptOrNull`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95229/new/

https://reviews.llvm.org/D95229



More information about the cfe-commits mailing list