Serve type hierarchy from observer class facts

Occurrences carry their result type uid, decoded types are retained per
editor entry, and a bounded core selects direct bases and inverse
subtypes. The server advertises typeHierarchyProvider and serves
prepareTypeHierarchy, supertypes and subtypes. Registered feature tests
cover the selection; a real stdio session prepared DerivedA and
returned Base as supertype and DerivedA/DerivedB as subtypes of Base.
This commit is contained in:
faumaray committed 2026-12-05 23:36:05 +03:00
1 parent b1c8a4a625
commit 86b9923532
14 files changed
+357 -15

No files matched your search

+3
View File
@@ -22,6 +22,8 @@ struct Occurrence {
// Whole definition extent when the compiler reported one (function body
// included). Call hierarchy uses it to attribute nested calls.
std::optional<Documents::Range> extent;
// Uid of the reported class type of this call's result, when present.
std::uint32_t result_type_uid{};
[[nodiscard]] bool has_definition() const noexcept { return definition_file != nullptr; }
};
@@ -29,6 +31,7 @@ struct Occurrence {
struct TypeRef {
std::string name, path;
Documents::Range range;
std::uint32_t uid{};
};
// A class observed as a call's result type and its direct bases.
struct ReflectedType {