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

Allow adding labels to notes #346

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nolanderc
Copy link

Attempts to address #293 by extending each note with an optional list of labels:

error: cycle detected when evaluating constant `A`
  ┌─ one_line.rs:1:1
  │
1 │ const A: u32 = B;
  │ ^^^^^^^^^^^^^^^^^
  │
  = ...which requires evaluating constant `B`...
  ┌─ one_line.rs:2:1
  │
2 │ const B: u32 = A;
  │ -----------------
  │
  = ...which requires evaluating constant `A`
  ┌─ one_line.rs:1:1
  │
1 │ const A: u32 = B;
  │ -----------------

@brendanzab
Copy link
Owner

Cool, thanks so much! Apologies for the lackluster response time. If labels are attached to the notes, I wonder if it would make sense to indent them to demonstrate the hierarchy?

error: cycle detected when evaluating constant `A`
  ┌─ one_line.rs:1:1
  │
1 │ const A: u32 = B;
  │ ^^^^^^^^^^^^^^^^^
  │
  = ...which requires evaluating constant `B`...
      ┌─ one_line.rs:2:1
      │
    2 │ const B: u32 = A;
      │ -----------------
      │
      = ...which requires evaluating constant `A`
      ┌─ one_line.rs:1:1
      │
    1 │ const A: u32 = B;
      │ -----------------

That might look a bit weird though…

If not I wonder if another solution could be to allow for a series of trailing labels attached to the top level diagnostic that are always rendered in order. 🤔

No worries if you are on other things at the moment.

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.

None yet

2 participants