diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2019-05-03 08:03:21 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2019-05-03 08:03:21 +0000 |
commit | 13c5b9d6103c2cab273065f19909ad8ce54928d0 (patch) | |
tree | 2affbd7935667ee29c1913c852af0db9d7a217ce | |
parent | b1a32d3e448697b05fe5f804394218e876b5f26f (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@359866 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | clangd/Protocol.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clangd/Protocol.h b/clangd/Protocol.h index 9a8d4ac7..957e2f3d 100644 --- a/clangd/Protocol.h +++ b/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. |