From 53800ab77565de1c16fb8a95e047eba1cb3a160c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 5 Jun 2026 03:17:01 +0900 Subject: feat(json-lint): port ParsingException details into a typed struct Replace the Phase B stub that discarded ParsingException details with a dedicated ParsingExceptionDetails struct (text/token/line/loc/expected), modeling the PHP string|int token union as a ParsingExceptionToken enum. Wire JsonFile::validate_syntax to forward the source details and let Application read the error line from the typed accessor. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/console/application.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'crates/shirabe/src/console/application.rs') diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs index f27ed79..8bd34ad 100644 --- a/crates/shirabe/src/console/application.rs +++ b/crates/shirabe/src/console/application.rs @@ -448,17 +448,11 @@ impl Application { if e.downcast_ref::().is_some() { // suppress these as they are not relevant at this point } else if let Some(pe) = e.downcast_ref::() { - // TODO(phase-b): ParsingException::get_details is not yet ported. - let details: IndexMap = IndexMap::new(); + let details = pe.get_details(); let file = realpath(&Factory::get_composer_file().unwrap_or_default()); - let mut line: Option = None; - if !details.is_empty() { - if let Some(l) = details.get("line").and_then(|v| v.as_int()) { - line = Some(l); - } - } + let line = details.line; let mut ghe = GithubActionError::new(self.io.clone()); ghe.emit(&pe.message, file.as_deref(), line); -- cgit v1.3.1