Skip to content

Emit structured compiler diagnostics in JSON output#3128

Closed
Arcticae wants to merge 1 commit into
arcticae/metadata-machine-diagnosticsfrom
arcticae/compile-structured-json-diagnostics
Closed

Emit structured compiler diagnostics in JSON output#3128
Arcticae wants to merge 1 commit into
arcticae/metadata-machine-diagnosticsfrom
arcticae/compile-structured-json-diagnostics

Conversation

@Arcticae
Copy link
Copy Markdown
Member

No description provided.

@Arcticae Arcticae requested a review from a team as a code owner May 19, 2026 10:13
@Arcticae Arcticae requested review from maciektr and wawel37 and removed request for a team May 19, 2026 10:13
@Arcticae
Copy link
Copy Markdown
Member Author

Arcticae commented May 19, 2026

@Arcticae Arcticae force-pushed the arcticae/metadata-machine-diagnostics branch from 14613e1 to 0e4ad80 Compare May 19, 2026 10:21
@Arcticae Arcticae force-pushed the arcticae/compile-structured-json-diagnostics branch from 428836e to 4cc3d88 Compare May 19, 2026 10:22
}
}

pub fn check(&mut self, db: &dyn Database, sink: &mut impl StructuredDiagnosticsSink) -> bool {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be upstreamed to the compiler?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - this whole file is written in such a way to be copied-over directly without modifications once we verify we want to go forward with this approach.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(that's why there's the StructuredDiagnosticsSink abstraction present here)

@Arcticae Arcticae force-pushed the arcticae/metadata-machine-diagnostics branch from 0e4ad80 to 84cad29 Compare May 19, 2026 10:42
@Arcticae Arcticae force-pushed the arcticae/compile-structured-json-diagnostics branch from 4cc3d88 to cb4f82b Compare May 19, 2026 10:43
@Arcticae Arcticae force-pushed the arcticae/metadata-machine-diagnostics branch from 84cad29 to fcffdb8 Compare May 19, 2026 11:05
@Arcticae Arcticae force-pushed the arcticae/compile-structured-json-diagnostics branch from cb4f82b to f1b1f10 Compare May 19, 2026 11:05
@Arcticae Arcticae force-pushed the arcticae/metadata-machine-diagnostics branch from fcffdb8 to e5a6b47 Compare May 19, 2026 12:11
@Arcticae Arcticae force-pushed the arcticae/compile-structured-json-diagnostics branch from f1b1f10 to f8bceaa Compare May 19, 2026 12:11
@Arcticae Arcticae force-pushed the arcticae/metadata-machine-diagnostics branch from e5a6b47 to 91b68f5 Compare May 19, 2026 12:43
@Arcticae Arcticae force-pushed the arcticae/compile-structured-json-diagnostics branch from f8bceaa to 74f4fac Compare May 19, 2026 12:44
Copy link
Copy Markdown
Member

@wawel37 wawel37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than some nits seems fine

Comment on lines +205 to +209
fn build_structured_diagnostic_message<'db, TEntry: DiagnosticEntry<'db>>(
db: &'db dyn Database,
entry: &TEntry,
file_notes: &PluginFileDiagnosticNotes<'db>,
) -> Option<StructuredDiagnosticMessage> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if im wrong, but this function never returns None right? If so change the return type

Comment on lines +160 to +163
found |= group.check_error_free().is_err();
}
}
found
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't check_error_free check the whole group? If so whats the point of running it every time in loop. Once at the end is enough i think

@Arcticae Arcticae closed this May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants