[PATCH] D40564: [clangd] Simplify common JSON-parsing patterns in Protocol.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 28 08:49:43 PST 2017


sammccall created this revision.
Herald added subscribers: cfe-commits, klimek.

This makes the parse() functions about as short as they can be given the
current signature, and moves all array-traversal etc code to a
central location.

We keep the ability to distinguish between optional and required fields:
and we don't propagate parse errors for optional fields.

I've made most fields required per the LSP spec - the looseness we had
here was mostly a historical accident I think.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D40564

Files:
  clangd/Protocol.cpp
  clangd/Protocol.h
  test/clangd/initialize-params-invalid.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40564.124585.patch
Type: text/x-patch
Size: 22396 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171128/852d206e/attachment-0001.bin>


More information about the cfe-commits mailing list