Skip to content

feat: return printable compilation diagnostics#53

Open
lukas-loering wants to merge 1 commit into
Relacibo:mainfrom
lukas-loering:main
Open

feat: return printable compilation diagnostics#53
lukas-loering wants to merge 1 commit into
Relacibo:mainfrom
lukas-loering:main

Conversation

@lukas-loering
Copy link
Copy Markdown

The previous implementation forwarded the display of source diagnostics to the debug implementation of Typst's SourceDiagnostic. While this prints the diagnostic message, other information like the diagnostics location in the source file, or the backtrace were not shown in a human- readble way.
Crucially, this information could also not be obtained, as the World used for the compilation went out of scope as the compile function returned.

This commit solves this issue by converting SourceDiagnostics to a new Diagnostic type, which resolves World dependent information, while keeping all other data of the SourceDiagnostic. Furthermore, a Diagnostic will display the information in a human-readable way.

Closes #19

The previous implementation forwarded the display of source diagnostics
to the debug implementation of Typst's `SourceDiagnostic`. While this
prints the diagnostic message, other information like the diagnostics
location in the source file, or the backtrace were not shown in a human-
readble way.
Crucially, this information could also **not** be obtained, as the
`World` used for the compilation went out of scope as the compile
function returned.

This commit solves this issue by converting SourceDiagnostics to a new
`Diagnostic` type, which resolves World dependent information, while
keeping all other data of the SourceDiagnostic. Furthermore, a
`Diagnostic` will display the information in a human-readable way.
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.

Error Formatting

1 participant