diff options
author | Haojian Wu <hokein@google.com> | 2018-12-20 15:39:12 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2018-12-20 15:39:12 +0000 |
commit | b618849e3160d630f94596fba435fe016ac4a507 (patch) | |
tree | 0f20adf9af2db5b2be181ecc488784d230289734 /clang-tools-extra/clangd/Protocol.h | |
parent | 92e5e36004769b37ac51cd38e855e5040bed7569 (diff) | |
download | bcm5719-llvm-b618849e3160d630f94596fba435fe016ac4a507.tar.gz bcm5719-llvm-b618849e3160d630f94596fba435fe016ac4a507.zip |
[clangd] Expose FileStatus to LSP.
Summary:
Add an LSP extension "textDocument/clangd.fileStatus" to emit file-status information.
Reviewers: ilya-biryukov
Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D55363
llvm-svn: 349768
Diffstat (limited to 'clang-tools-extra/clangd/Protocol.h')
-rw-r--r-- | clang-tools-extra/clangd/Protocol.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h index 76dcf52a87e..94838a8575a 100644 --- a/clang-tools-extra/clangd/Protocol.h +++ b/clang-tools-extra/clangd/Protocol.h @@ -397,6 +397,9 @@ struct InitializationOptions { // the compilation database doesn't describe an opened file. // The command used will be approximately `clang $FILE $fallbackFlags`. std::vector<std::string> fallbackFlags; + + /// Clients supports show file status for textDocument/clangd.fileStatus. + bool FileStatus = false; }; bool fromJSON(const llvm::json::Value &, InitializationOptions &); @@ -973,6 +976,18 @@ struct ReferenceParams : public TextDocumentPositionParams { }; bool fromJSON(const llvm::json::Value &, ReferenceParams &); +/// Clangd extension: indicates the current state of the file in clangd, +/// sent from server via the `textDocument/clangd.fileStatus` notification. +struct FileStatus { + /// The text document's URI. + URIForFile uri; + /// The human-readable string presents the current state of the file, can be + /// shown in the UI (e.g. status bar). + std::string state; + // FIXME: add detail messages. +}; +llvm::json::Value toJSON(const FileStatus &FStatus); + } // namespace clangd } // namespace clang |