-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Diag] Print the diagnostic ID name from localization #34319
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
[Diag] Print the diagnostic ID name from localization #34319
Conversation
test/diagnostics/Localization/en_localization_parser_lookup.swift
Outdated
Show resolved
Hide resolved
7f4cb0c
to
651655e
Compare
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.
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.
I don't entirely understand why it's important for the llvm::StringSaver to be an optional argument to the Localization producer constructors, but the rest of this change looks good to me for the most part 👍
@swift-ci please smoke test |
My motive behind this was because localization producers might be used in a other places where it doesn't make sense to use either the |
Oh, I see, thanks for the explanation! I think that's reasonable, but could you add an assert that if |
Yes of course! Going to add it now. |
…r is also present
@swift-ci please smoke test |
@owenv I think the failure in macOS isn't related to my changes. |
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.
Looks much better now, still needs a bit more work to get this across the finish line.
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.
LGTM!
// RUN: swift-serialize-diagnostics --input-file-path=%S/Inputs/en.yaml --output-directory=%t/ 2>&1 | %FileCheck %s | ||
// RUN: not %target-swift-frontend -debug-diagnostic-names -localization-path %S/Inputs -locale fr -typecheck %s 2>&1 | %FileCheck %s --check-prefix=CHECK_NAMES | ||
|
||
// CHECK: These diagnostic IDs are no longer availiable: 'not_available_in_def, not_available_in_def_2, not_available_in_def_3, not_available_in_def_4, not_available_in_def_5' |
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.
Could you please remove these diagnostics from yaml in a separate PR?
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.
Of course! But can you explain why?
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.
I mean shouldn't we be testing/checking on yaml.unknownIDs
?
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.
Since .def
file is still a source of truth and if it doesn't have it the that diagnostic is no longer viable.
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.
Okay... makes sense thank you!
@swift-ci please smoke test |
@xedin I'm not sure why CI is failing on macOS. I tried to take a look at the console output, however I can't quite understand it. |
Don't worry, it's a driver issue people are already looking into. |
@swift-ci please smoke test macOS platform |
1 similar comment
@swift-ci please smoke test macOS platform |
cc @xedin, @owenv