Skip to content

Initiial source ID and location #3

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

Open
eaglgenes101 opened this issue Aug 5, 2021 · 3 comments
Open

Initiial source ID and location #3

eaglgenes101 opened this issue Aug 5, 2021 · 3 comments

Comments

@eaglgenes101
Copy link

eaglgenes101 commented Aug 5, 2021

In the method to create a report builder, there are two arguments corresponding to a source ID and a location. From reading the source code, these correspond to a location field inside the report builder struct, which is only ever used in

let location = if src_id == self.location.0.borrow() {
and following lines for determining a source location in certain cases. Am I missing something, or am I correct in thinking that this initial location could (and for ease of end usage, should) be made optional?

@bestouff
Copy link

Also the docs aren't clear about what's its use, and the multifiles example makes it look like it's redundant.

@bestouff bestouff mentioned this issue Oct 12, 2021
5 tasks
@zesterer
Copy link
Owner

zesterer commented Oct 12, 2021

I think I'm going to remove this in favour of a 'blessed' primary label that gets used as the canonical error location. I do want to keep this notion of there being a canonical single location for the error though, because this would allow for reporting short form errors in a manner similar to Rust's --message-format=short.

@bestouff
Copy link

bestouff commented Oct 12, 2021

That sounds perfect.
For now my code scans the different labels and finds the Primary one, then uses this as the location for Report::build().

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

No branches or pull requests

3 participants