diff options
Diffstat (limited to 'clang-tools-extra/clangd/Protocol.h')
| -rw-r--r-- | clang-tools-extra/clangd/Protocol.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h index fc6a3a8c9f1..d019e82dbf7 100644 --- a/clang-tools-extra/clangd/Protocol.h +++ b/clang-tools-extra/clangd/Protocol.h @@ -871,6 +871,20 @@ struct DocumentHighlight { llvm::json::Value toJSON(const DocumentHighlight &DH); llvm::raw_ostream &operator<<(llvm::raw_ostream &, const DocumentHighlight &); +struct CancelParams { + /// The request id to cancel. + /// This can be either a number or string, if it is a number simply print it + /// out and always use a string. + std::string ID; +}; +llvm::json::Value toJSON(const CancelParams &); +llvm::raw_ostream &operator<<(llvm::raw_ostream &, const CancelParams &); +bool fromJSON(const llvm::json::Value &, CancelParams &); + +/// Param can be either of type string or number. Returns the result as a +/// string. +llvm::Optional<std::string> parseNumberOrString(const llvm::json::Value *Param); + } // namespace clangd } // namespace clang |

