[PATCH] D50502: [clangd] Initial cancellation mechanism for LSP requests.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 24 02:48:58 PDT 2018


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





More information about the cfe-commits mailing list