Report full function extents from the stock observer

The observer emits an optional extent inside each proven definition
span from the body's last statement finish (the C++ frontend does not
set function_end_locus). The occurrence decoder binds it to the same
snapshot through the negotiated encoding and rejects malformed
extents; call hierarchy attributes nested calls to the enclosing
extent. A real stdio session reported both inner calls as outgoing
from outer, and the observer and occurrence corpora still pass.
This commit is contained in:
faumaray committed 2026-12-05 17:28:59 +03:00
1 parent a098e45dc9
commit ec86a79a1a
11 files changed
+239 -11

No files matched your search

+3
View File
@@ -19,6 +19,9 @@ struct Occurrence {
Documents::Range use;
DiagnosticSnapshot definition_file;
Documents::Range definition;
// Whole definition extent when the compiler reported one (function body
// included). Call hierarchy uses it to attribute nested calls.
std::optional<Documents::Range> extent;
[[nodiscard]] bool has_definition() const noexcept { return definition_file != nullptr; }
};