This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE319157: [clangd] Add missing (but documented!) JSONExpr
typed accessors (authored by sammccall).
Changed prior to commit:
https://reviews.llvm.org/D40399?vs=124204=124528#toc
Repository:
rCTE
ioeric accepted this revision.
ioeric added a comment.
This revision is now accepted and ready to land.
Lgtm
Thanks for the rename!
https://reviews.llvm.org/D40399
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
sammccall added a comment.
Thanks for the review! I think you're right about new names.
Comment at: clangd/JSONExpr.h:368
+// Typed accessors return None/nullptr if the element has the wrong type.
+llvm::Optional null(size_t I) const {
+ return (*this)[I].null();
sammccall updated this revision to Diff 124203.
sammccall marked 2 inline comments as done.
sammccall added a comment.
Renames to address review comments
https://reviews.llvm.org/D40399
Files:
clangd/ClangdUnit.cpp
clangd/JSONExpr.cpp
clangd/JSONExpr.h
clangd/JSONRPCDispatcher.cpp
sammccall added inline comments.
Comment at: clangd/JSONExpr.h:368
+// Typed accessors return None/nullptr if the element has the wrong type.
+llvm::Optional null(size_t I) const {
+ return (*this)[I].null();
ioeric wrote:
> Why is this needed?
ioeric added inline comments.
Comment at: clangd/JSONExpr.h:368
+// Typed accessors return None/nullptr if the element has the wrong type.
+llvm::Optional null(size_t I) const {
+ return (*this)[I].null();
Why is this needed? `v[x].null()` seems to
sammccall updated this revision to Diff 124105.
sammccall added a comment.
While here, fix a duplicated test.
https://reviews.llvm.org/D40399
Files:
clangd/JSONExpr.h
unittests/clangd/JSONExprTests.cpp
Index: unittests/clangd/JSONExprTests.cpp