-
Notifications
You must be signed in to change notification settings - Fork 4
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
refactor a bit #100
refactor a bit #100
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
Sorry I went awol on this. I'll be heading home tomorrow and this will be my first priority. |
@asmello So the time I had allocated after my trip to work on this was unfortunately spent sick. I have had time to tinker with it here and there but I'm struggling to nail down a design with regard to mutli-errors. The biggest hurdle is that I considered I'm at the point where I'm pretty certain that related errors just aren't worth it. It spikes the complexity considerably with little upside (if a pointer is malformed, its malformed and as pointers are likely something being generated by logic, i don't know how many users would really benefit from having a detailed demonstration. I think everything else is solid and I'll finish it out, hopefully sometime this weekend. We can decide whether to proceed without them from there. |
I "fixed" the issue of repeated sourcing by returning I modified the error messages such that each error does not delve into the source, displaying only information at that depth: |
We could provide richer error messages for |
Hey @asmello, I made some changes for you to review. High level:
SRC
generic ofReport
toD
and bound it toDiagnostic
SUB
in generic, usesD::Subject
insteadReport
Diagnostic
Adds associated typeRelated
and methodrelated
toDiagnostic
for multi-errorsRegarding lifetimes, I really think we should only deal with owned subjects. It simplifies the code considerably, reduces boilerplate, avoids
borrowck
issues, and doesn't cost much; a single allocation at worst on an error path for reporting seems more than fair. Given that this behavior is opt-in, I say we keep it simple.I really don't know about the multi-error list. We can include it and I made some changes to support it, but I don't know how valuable it'll be. However, it is possible with this structure. To support it, we will need a
struct ParseErrors(Box<[ParseError]>
that would have aRelated = ParseError
and I'll need to move over the logic from the other branch.