perl-diagnostics
Unified diagnostic codes, types, and catalog for Perl LSP.
This crate consolidates three previously separate diagnostic crates into a single, coherent API:
| Former crate | Now |
|---|---|
perl-diagnostics-codes |
perl_diagnostics::codes |
perl-lsp-diagnostic-types |
perl_diagnostics::types |
perl-lsp-diagnostic-catalog |
perl_diagnostics::catalog |
Modules
-
codes— canonicalDiagnosticCode,DiagnosticCategory,DiagnosticSeverity, andDiagnosticTagenums. All other modules derive their severity/tag types from here; there is exactly one definition in the workspace. -
types—DiagnosticandRelatedInformationstructs.DiagnosticSeverityandDiagnosticTagare re-exported fromcodesso the legacytypes::DiagnosticSeverityimport path still resolves to the same type. -
catalog— LSP-facing metadata helpers that map aDiagnosticCodeto its human-readable message, related documentation URL, and default severity.
All public items are additionally re-exported from the crate root via the
api module so consumers need only use perl_diagnostics::*.
Usage
[]
= { = "../../crates/perl-diagnostics" }
# Enable serde support for JSON serialization:
# perl-diagnostics = { path = "...", features = ["serde"] }
use ;
let diag = Diagnostic ;
Type Unification
DiagnosticSeverity and DiagnosticTag are defined once in codes and
re-exported through types. This means types::DiagnosticSeverity and
codes::DiagnosticSeverity are the same type — no orphan-impl issues, no
From conversion needed when passing values between modules.
Features
| Feature | Default | Effect |
|---|---|---|
serde |
off | Derives Serialize/Deserialize on all public types |