summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2019-05-03 08:03:21 +0000
committerIlya Biryukov <ibiryukov@google.com>2019-05-03 08:03:21 +0000
commitd020f270d617fe37a8926e820adb1b2a951417be (patch)
tree00851424e91a4aa6efc145c04c0b277c869e33fb
parentb1f39102838363054361df630dafcc00d3348395 (diff)
downloadbcm5719-llvm-d020f270d617fe37a8926e820adb1b2a951417be.tar.gz
bcm5719-llvm-d020f270d617fe37a8926e820adb1b2a951417be.zip
[clangd] Minor code style cleanups in Protocol.h. NFC
- Remove a parameter name that was misspelled (OS used for non-stream parameter) - Declare operator == (TextEdit, TextEdit) outside the struct, for consistency with other user-declared ops in our code. - Fix naming style of a parameter. llvm-svn: 359866
-rw-r--r--clang-tools-extra/clangd/Protocol.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h
index 9a8d4ac74f0..957e2f3da44 100644
--- a/clang-tools-extra/clangd/Protocol.h
+++ b/clang-tools-extra/clangd/Protocol.h
@@ -206,11 +206,10 @@ struct TextEdit {
/// The string to be inserted. For delete operations use an
/// empty string.
std::string newText;
-
- bool operator==(const TextEdit &rhs) const {
- return newText == rhs.newText && range == rhs.range;
- }
};
+inline bool operator==(const TextEdit &L, const TextEdit &R) {
+ return std::tie(L.newText, L.range) == std::tie(R.newText, R.range);
+}
bool fromJSON(const llvm::json::Value &, TextEdit &);
llvm::json::Value toJSON(const TextEdit &);
llvm::raw_ostream &operator<<(llvm::raw_ostream &, const TextEdit &);
@@ -294,7 +293,7 @@ using CompletionItemKindBitset = std::bitset<CompletionItemKindMax + 1>;
bool fromJSON(const llvm::json::Value &, CompletionItemKindBitset &);
CompletionItemKind
adjustKindToCapability(CompletionItemKind Kind,
- CompletionItemKindBitset &supportedCompletionItemKinds);
+ CompletionItemKindBitset &SupportedCompletionItemKinds);
/// A symbol kind.
enum class SymbolKind {
@@ -352,7 +351,7 @@ enum class OffsetEncoding {
};
llvm::json::Value toJSON(const OffsetEncoding &);
bool fromJSON(const llvm::json::Value &, OffsetEncoding &);
-llvm::raw_ostream &operator<<(llvm::raw_ostream &, OffsetEncoding OS);
+llvm::raw_ostream &operator<<(llvm::raw_ostream &, OffsetEncoding);
// This struct doesn't mirror LSP!
// The protocol defines deeply nested structures for client capabilities.
OpenPOWER on IntegriCloud