Skip to main content

merman_analysis/
lib.rs

1#![forbid(unsafe_code)]
2
3//! Diagnostics-first analysis contracts and source mapping for Merman.
4//!
5//! This crate is intentionally render-free. It owns the JSON payload shape and source-position
6//! helpers that FFI, UniFFI, WASM, CLI linting, Markdown scanning, and future LSP adapters can share.
7
8mod analyzer;
9mod diagnostic_projection;
10pub mod document;
11pub mod editor;
12pub mod markdown;
13pub mod options_json;
14mod payload;
15mod recovery;
16mod result;
17mod rules;
18mod source_config_rewrite;
19mod source_directives;
20mod source_limits;
21mod source_map;
22mod status;
23
24pub use analyzer::{AnalysisOptions, Analyzer};
25pub use document::{
26    DocumentDiagram, DocumentDiagramKind, DocumentSource, FenceDelimiter, FenceMarker,
27    SharedTextSlice, analyze_document, analyze_document_facts, analyze_document_result,
28    analyze_document_result_shared, source_descriptor_for_kind,
29    source_descriptor_for_markdown_path, source_descriptor_for_uri, source_language,
30};
31pub use editor::{
32    ByteSpan, EditorSymbolKind, FenceCursorCompletionKind, FenceCursorContext, FenceExpectedSyntax,
33    FenceExpectedSyntaxKind, FenceLineItem, FenceReferenceGroup, FenceSemanticItem,
34    FenceSemanticRole, FenceTextIndex, FenceTextIndexSource, ShapeObjectValuePrefix,
35    shape_object_value_prefix,
36};
37pub use options_json::{
38    AnalysisOptionsJson, AnalysisOptionsJsonError, LintOptionsJson, LintRuleSeverityOverrideJson,
39    ParseOptionsJson, ResourceOptionsJson, analysis_options_from_json_value,
40    analysis_options_json_from_json_value,
41};
42pub use payload::{
43    AnalysisDiagnostic, AnalysisPayload, DiagnosticCategory, DiagnosticFix, DiagnosticFixEdit,
44    DiagnosticRelated, DiagnosticSeverity, DiagnosticSpan, SourceDescriptor, SourceKind, Summary,
45    Utf16Position,
46};
47pub use result::{
48    AnalysisDiagramFacts, AnalysisDiagramSyntaxFacts, AnalysisExpectedSyntaxFacts,
49    AnalysisFactSpan, AnalysisFactsPayload, AnalysisFenceDelimiterFacts,
50    AnalysisFlowchartEdgeDefaults, AnalysisFlowchartEdgeFacts, AnalysisFlowchartFacts,
51    AnalysisFlowchartNodeFacts, AnalysisFlowchartSubgraphFacts, AnalysisLineItemFacts,
52    AnalysisReferenceFacts, AnalysisResult, AnalysisSemanticItemFacts, AnalysisSyntaxFacts,
53    AnalyzedDiagram,
54};
55pub use rules::{
56    AnalysisRuleConfig, AnalysisRuleProfile, RULE_CATALOG_RESPONSE_VERSION, RuleCatalogEntry,
57    RuleCatalogResponse, RuleDescriptor, RuleOrigin, configurable_rule_catalog,
58    configurable_rule_catalog_response, configurable_rule_catalog_response_json_bytes,
59    configurable_rule_descriptor, configurable_rule_descriptors, rule_catalog,
60    rule_catalog_response, rule_catalog_response_json_bytes, rule_descriptors,
61};
62pub use source_limits::{
63    source_discarded_after_limit_change_diagnostic, source_limit_diagnostic_for_len,
64};
65pub use source_map::{LineCol, SourceMap, SourceMapError};
66pub use status::AnalysisStatus;