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:
1 parent
a098e45dc9
commit
ec86a79a1a
11 files changed
+239
-11
No files matched your search
@@ -124,3 +124,14 @@ VOID_TEST(CallHierarchy, outgoing_skips_unresolved_callees_and_bounds_groups) {
|
||||
require(outgoing(calls, known, known.front()).size() == 1);
|
||||
expect(outgoing(calls, known, known.front(), Limits{.callers = 0}).empty());
|
||||
}
|
||||
|
||||
VOID_TEST(CallHierarchy, a_compiler_extent_identifies_the_same_function) {
|
||||
const auto target = definition("f", "/p/a.cpp", range(1));
|
||||
const auto caller_name = definition("outer", "/p/a.cpp", range(0, 4, 5));
|
||||
const std::vector<Definition> known{definition("outer", "/p/a.cpp", {{0, 4}, {9, 1}}), target};
|
||||
const std::vector<Call> calls{call("f", target, "/p/a.cpp", range(5))};
|
||||
require(incoming(calls, known, target).size() == 1);
|
||||
const auto result = outgoing(calls, known, caller_name);
|
||||
require(result.size() == 1);
|
||||
expect(result.front().to.name == "f");
|
||||
}
|
||||
Reference in new issue
Block a user