#pragma once #include #include #include #include #include #include #include namespace vls::semantic { // A compiler-owned direct-call fact. Byte spans from the stock observer are // already converted to the captured snapshot's negotiated character positions. struct Occurrence { std::string name, type, canonical_type, signature; DiagnosticSnapshot use_file; Documents::Range use; DiagnosticSnapshot definition_file; Documents::Range definition; [[nodiscard]] bool has_definition() const noexcept { return definition_file != nullptr; } }; struct OccurrenceReport { std::vector occurrences; bool complete{}; bool partial{}; std::string reason; }; enum class OccurrenceError { invalid_report, wrong_nonce }; // Decode a stock-observer report against the exact capture that was compiled. // Unknown paths, byte spans that do not match the captured bytes, duplicates // and malformed envelopes reject the whole report. [[nodiscard]] std::expected decode_occurrences(std::string_view report, std::string_view nonce, std::span capture); } // namespace vls::semantic