kadircet added inline comments.

================
Comment at: clangd/Protocol.h:883
+/// converts it into a string.
+bool parseNumberOrString(const llvm::json::Value &Params, std::string &Parsed,
+                         const std::string &Field);
----------------
ilya-biryukov wrote:
> Maybe simplify the signature to: `Optional<string> parseNumberOrString(const 
> llvm::json::Value&);`
> And call as `parseNumberOrString(obj["id"])` instead of 
> `parseNumberOrString(obj, "id")`?
> 
> Also, maybe call it `normalizeRequestId`? 
LSP has a few more places that can have paremeters of type number | string so I 
believe this one could be used with them as well. Therefore I think it is 
better to keep the name that way. The normalizeRequestID is a sepcial case and 
handled within ClangdLSPServer.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50502



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

Reply via email to