summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/Protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/Protocol.h')
-rw-r--r--clang-tools-extra/clangd/Protocol.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h
index 7a1a8c77d25..a2c9438ea9d 100644
--- a/clang-tools-extra/clangd/Protocol.h
+++ b/clang-tools-extra/clangd/Protocol.h
@@ -1127,7 +1127,7 @@ struct TypeHierarchyItem {
SymbolKind kind;
/// `true` if the hierarchy item is deprecated. Otherwise, `false`.
- bool deprecated;
+ bool deprecated = false;
/// The URI of the text document where this type hierarchy item belongs to.
URIForFile uri;
@@ -1153,13 +1153,26 @@ struct TypeHierarchyItem {
/// descendants. If not defined, the children have not been resolved.
llvm::Optional<std::vector<TypeHierarchyItem>> children;
- /// The protocol has a slot here for an optional 'data' filed, which can
- /// be used to identify a type hierarchy item in a resolve request. We don't
- /// need this (the item itself is sufficient to identify what to resolve)
- /// so don't declare it.
+ /// An optional 'data' filed, which can be used to identify a type hierarchy
+ /// item in a resolve request.
+ llvm::Optional<std::string> data;
};
llvm::json::Value toJSON(const TypeHierarchyItem &);
llvm::raw_ostream &operator<<(llvm::raw_ostream &, const TypeHierarchyItem &);
+bool fromJSON(const llvm::json::Value &, TypeHierarchyItem &);
+
+/// Parameters for the `typeHierarchy/resolve` request.
+struct ResolveTypeHierarchyItemParams {
+ /// The item to resolve.
+ TypeHierarchyItem item;
+
+ /// The hierarchy levels to resolve. `0` indicates no level.
+ int resolve;
+
+ /// The direction of the hierarchy levels to resolve.
+ TypeHierarchyDirection direction;
+};
+bool fromJSON(const llvm::json::Value &, ResolveTypeHierarchyItemParams &);
struct ReferenceParams : public TextDocumentPositionParams {
// For now, no options like context.includeDeclaration are supported.
OpenPOWER on IntegriCloud