Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some context to code gen errors #34

Merged
merged 3 commits into from
Jan 24, 2025
Merged

Conversation

einarmo
Copy link
Contributor

@einarmo einarmo commented Jan 23, 2025

A bit of a rough way to do it, but it's relatively easy and not that intrusive. It's very nice to get some general context about where in the process an error occurred when generating code, so that you can CTRL-F into the offending XML file and find where the code gen gave up.

This adds some basic context to CodeGenError that lets us capture this information and pass it along. There's probably more that can be done, but this is a start.

@einarmo einarmo force-pushed the improve-code-gen-error-context branch from 2330478 to 636f533 Compare January 23, 2025 08:02
A bit of a rough way to do it, but it's relatively easy and not that
intrusive. It's very nice to get some general context about where in the
process an error occurred when generating code, so that you can CTRL-F
into the offending XML file and find where the code gen gave up.

This adds some basic context to `CodeGenError` that lets us capture this
information and pass it along.
@einarmo einarmo force-pushed the improve-code-gen-error-context branch from 636f533 to bf3d50d Compare January 23, 2025 08:07
OPC-UA Schemas use Extension for structs, not Restriction.
 - Fix rendering of DateTime<Utc>
 - Fix rendering of Guid
 - Skip rendering type loader if it is empty
 - Properly handle native rust types
 - Support ListOf[Struct] types. It won't work at the top level, but I
   don't think that is actually valid either way.
@einarmo einarmo merged commit 1a93e8c into master Jan 24, 2025
6 checks passed
@einarmo einarmo deleted the improve-code-gen-error-context branch January 24, 2025 07:21
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.

2 participants