diff options
| author | Kadir Cetinkaya <kadircet@google.com> | 2018-08-24 13:09:41 +0000 |
|---|---|---|
| committer | Kadir Cetinkaya <kadircet@google.com> | 2018-08-24 13:09:41 +0000 |
| commit | 689bf93b2ff10ee1d94249274353bb819618a16d (patch) | |
| tree | 935ff3b9f11d8e9f359ad8ddbc859530965f36e8 /clang-tools-extra/clangd/Protocol.h | |
| parent | 406f1ff1cdfe3ef065a3ac3414ff1672dcfb9049 (diff) | |
| download | bcm5719-llvm-689bf93b2ff10ee1d94249274353bb819618a16d.tar.gz bcm5719-llvm-689bf93b2ff10ee1d94249274353bb819618a16d.zip | |
[clangd] Initial cancellation mechanism for LSP requests.
Reviewers: ilya-biryukov, ioeric, hokein
Reviewed By: ilya-biryukov
Subscribers: mgorny, ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D50502
llvm-svn: 340607
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 |

