[PATCH] D130003: [clangd] Use empty string to represent None semantics in FoldingRange::kind
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 18 05:44:08 PDT 2022
kadircet created this revision.
kadircet added a reviewer: usaxena95.
Herald added a subscriber: arphaman.
Herald added a project: All.
kadircet requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D130003
Files:
clang-tools-extra/clangd/Protocol.cpp
clang-tools-extra/clangd/Protocol.h
Index: clang-tools-extra/clangd/Protocol.h
===================================================================
--- clang-tools-extra/clangd/Protocol.h
+++ clang-tools-extra/clangd/Protocol.h
@@ -1772,7 +1772,7 @@
unsigned startCharacter;
unsigned endLine = 0;
unsigned endCharacter;
- llvm::Optional<std::string> kind;
+ std::string kind;
};
llvm::json::Value toJSON(const FoldingRange &Range);
Index: clang-tools-extra/clangd/Protocol.cpp
===================================================================
--- clang-tools-extra/clangd/Protocol.cpp
+++ clang-tools-extra/clangd/Protocol.cpp
@@ -1444,8 +1444,8 @@
Result["startCharacter"] = Range.startCharacter;
if (Range.endCharacter)
Result["endCharacter"] = Range.endCharacter;
- if (Range.kind)
- Result["kind"] = *Range.kind;
+ if (!Range.kind.empty())
+ Result["kind"] = Range.kind;
return Result;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130003.445467.patch
Type: text/x-patch
Size: 899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220718/a2af9867/attachment.bin>
More information about the cfe-commits
mailing list