diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2019-06-04 09:36:59 +0000 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2019-06-04 09:36:59 +0000 |
| commit | 4ef0f82b71dedeb11d2ff40c6a68ac2737f07f59 (patch) | |
| tree | 7a46f384bd75b6a6be92f929a7429ae5f3fc2857 /clang-tools-extra/clangd/Protocol.h | |
| parent | 63846039f574a584714ef10777a6ea4c4e5706fd (diff) | |
| download | bcm5719-llvm-4ef0f82b71dedeb11d2ff40c6a68ac2737f07f59.tar.gz bcm5719-llvm-4ef0f82b71dedeb11d2ff40c6a68ac2737f07f59.zip | |
[clangd] Support offsets for parameters in signatureHelp
Summary: Added to LSP in version 3.14
Reviewers: hokein
Reviewed By: hokein
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62476
llvm-svn: 362481
Diffstat (limited to 'clang-tools-extra/clangd/Protocol.h')
| -rw-r--r-- | clang-tools-extra/clangd/Protocol.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h index 21bac8abfb5..1ebe8071cda 100644 --- a/clang-tools-extra/clangd/Protocol.h +++ b/clang-tools-extra/clangd/Protocol.h @@ -390,6 +390,9 @@ struct ClientCapabilities { /// Client supports hierarchical document symbols. bool HierarchicalDocumentSymbol = false; + /// Client supports processing label offsets instead of a simple label string. + bool OffsetsInSignatureHelp = false; + /// The supported set of CompletionItemKinds for textDocument/completion. /// textDocument.completion.completionItemKind.valueSet llvm::Optional<CompletionItemKindBitset> CompletionItemKinds; @@ -979,8 +982,14 @@ llvm::json::Value toJSON(const CompletionList &); /// A single parameter of a particular signature. struct ParameterInformation { - /// The label of this parameter. Mandatory. - std::string label; + /// The label of this parameter. Ignored when labelOffsets is set. + std::string labelString; + + /// Inclusive start and exclusive end offsets withing the containing signature + /// label. + /// Offsets are computed by lspLength(), which counts UTF-16 code units by + /// default but that can be overriden, see its documentation for details. + llvm::Optional<std::pair<unsigned, unsigned>> labelOffsets; /// The documentation of this parameter. Optional. std::string documentation; |

