-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fixed up two issues that were discovered #12
Conversation
SomeRandomiOSDev
commented
Nov 10, 2023
- When a diagnostic has multiple fix its the annotated string didn't insert newlines between fix-its
- When a syntax has the same node offset as one of its children, replacing the child with a fix-it would always replace the outermost node
1. When a diagnostic has multiple fix its the annotated string didn't insert newlines between fix-its 2. When a syntax has the same node offset as one of its children, replacing the child with a fix-it would *always* replace the outermost node
┬────────────────────────── | ||
├─ ⚠️ This is the first diagnostic. | ||
│ ✏️ This is the first fix-it. | ||
│ ✏️ This is the second fix-it. | ||
╰─ ℹ️ This is the second diagnostic, it's a note. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the fix in DiagnosticsFormatter.swift
, this output took the following form:
┬──────────────────────────
├─ ⚠️ This is the first diagnostic.
│ ✏️ This is the first fix-it. │ │ ✏️ This is the second fix-it. │ ╰─ ℹ️ This is the second diagnostic, it's a note.
@SomeRandomiOSDev Thanks for the PR and fixes! Just the one thing about the |
@SomeRandomiOSDev I think @Matejkob also brings up a good point, that this is really an upstream issue that will hopefully be fixed by Apple soon. Because of that, I'm inclined to think we should limit this PR to just fixing the formatting issue to minimize future churn when reintegrating code back from Apple in the future. |
Makes sense, I'll push a change that moves this fix it to a different macro type to keep the |
@stephencelis @Matejkob I pushed changes that removed the changes to types pulled upstream from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!