A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
emit_json.h File Reference
#include <string>
#include <string_view>
#include <absl/types/span.h>
#include <nlohmann/json_fwd.hpp>
#include "a11/flow/complete.h"
#include "a11/flow/diagnostic.h"
#include "a11/flow/format.h"
#include "a11/flow/parser.h"
#include "a11/flow/plan.h"
#include "a11/flow/syntax.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  a11
 
namespace  a11::flow
 

Functions

nlohmann::json a11::flow::DiagnosticToJsonValue (const Diagnostic &diagnostic)
 One diagnostic, as it appears in the envelope.
 
Diagnostic a11::flow::DiagnosticFromJsonValue (const nlohmann::json &value)
 Reads a diagnostic, ignoring unknown fields and defaulting missing ones.
 
nlohmann::json a11::flow::DiagnosticsToJsonValue (std::string_view source, absl::Span< const Diagnostic > diagnostics)
 The flow.diagnostics/v1 envelope, with source and severity counts.
 
std::string a11::flow::DiagnosticsToJson (std::string_view source, absl::Span< const Diagnostic > diagnostics)
 The envelope, serialised with a trailing newline and two-space indent.
 
nlohmann::json a11::flow::CodesToJsonValue ()
 The published code table, as flow.codes/v1.
 
nlohmann::json a11::flow::VocabularyToJsonValue ()
 The language word sets as flow.vocabulary/v1.
 
nlohmann::json a11::flow::DiagnosticsToSarifValue (std::string_view source, absl::Span< const Diagnostic > diagnostics)
 A SARIF 2.1.0 log for one file, with rule metadata from [KnownCodes].
 
std::string a11::flow::DiagnosticsToSarif (std::string_view source, absl::Span< const Diagnostic > diagnostics)
 The SARIF log, serialised with a trailing newline.
 
nlohmann::json a11::flow::NodeToJsonValue (const syntax::Node &node)
 A syntax node and its subtree.
 
nlohmann::json a11::flow::ConstantToJsonValue (const syntax::Constant &constant)
 A constant as the syntax format writes it.
 
nlohmann::json a11::flow::SyntaxToJsonValue (std::string_view source, const ParseResult &result)
 The flow.syntax/v1 envelope, including partial trees and diagnostics.
 
std::string a11::flow::SyntaxToJson (std::string_view source, const ParseResult &result)
 The envelope, serialised with a trailing newline and two-space indent.
 
nlohmann::json a11::flow::TokensToJsonValue (std::string_view source_name, std::string_view source)
 The flow.tokens/v1 envelope, with token kinds and semantic classes.
 
std::string a11::flow::TokensToJson (std::string_view source_name, std::string_view source)
 The envelope, serialised with a trailing newline and two-space indent.
 
nlohmann::json a11::flow::FormatToJsonValue (const FormatResult &result)
 The flow.format/v1 envelope: the formatted text, and what it took.
 
nlohmann::json a11::flow::CompletionsToJsonValue (const CompleteResult &result)
 The flow.completions/v1 envelope: what may be written at an offset.
 
nlohmann::json a11::flow::PlanToJsonValue (std::string_view source_name, const Program &program)
 The flow.plan/v1 envelope for resolved flows.
 
nlohmann::json a11::flow::DtoToJsonValue (const DtoPlan &dto, const Program *absl_nullable program=nullptr)
 A resolved shape.
 
std::string a11::flow::PlanToJson (std::string_view source_name, const Program &program)
 The envelope, serialised with a trailing newline and two-space indent.
 
std::string a11::flow::DiagnosticToText (std::string_view source, const Diagnostic &diagnostic)
 path:line:column: severity: message [code] on one line.
 

Variables

constexpr std::string_view a11::flow::kDiagnosticsFormat = "flow.diagnostics/v1"
 Envelope format identifiers. Readers ignore unknown fields in a version.
 
constexpr std::string_view a11::flow::kCodesFormat = "flow.codes/v1"
 
constexpr std::string_view a11::flow::kSyntaxFormat = "flow.syntax/v1"
 
constexpr std::string_view a11::flow::kTokensFormat = "flow.tokens/v1"
 
constexpr std::string_view a11::flow::kVocabularyFormat = "flow.vocabulary/v1"
 
constexpr std::string_view a11::flow::kFormatFormat = "flow.format/v1"