We currently have a bunch of type-checker diagnostics that uses the word "accessor" instead of user-facing words such as "getter", "setter" or "observer". The word "accessor" is actually not used anywhere in user-facing documentation or TSPL.
It would be great to replace uses of "accessor" with words that the user is more likely to be familiar with, as mentioned above.
The text was updated successfully, but these errors were encountered:
Substitute uses of the word "accessor" in diagnostic text with "getter", "setter", "willSet observer" or "didSet observer". This can be done by using DescriptiveDeclKind, which provides user-facing and diagnostic-friendly names for declarations. Some of the diagnostic text might need to be reworded as part of this change so the new words fit properly with the rest of the text.
Here's an overview of what you need to do:
The compiler diagnostic files are located in the include/swift/AST folder. The one that needs to be updated is called DiagnosticsSema.def. Once updated, you will also need to mirror your changes in the localization file, which is located at swift/localization/diagnostics/en.yaml.
Find uses of the word "accessor" in diagnostic text and substitute it with a format specifier that maps to a DescriptiveDeclKind. There are some uses of "accessor" which should not be changed for now - you may find them attached with the words "modify" (or "_modify"), "read" (or "_read"), "addressor" and "mutableAddressor". These accessors are currently not meant for public use, so it's probably fine to leave diagnostic text for them unchanged.
Find uses of that diagnostic in code (using its identifier) and pass the DescriptiveDeclKind as argument (which can be obtained by calling getDescriptiveKind() on a declaration).
Run tests and update test files with new diagnostic text.
@theblixguy I was wondering, has this been resolved or the assignee hafraz07 (JIRA User) has started working on it, yet? Because I'm interested on working on it.
hassaneldesouky (JIRA User) yes, hafraz07 (JIRA User) is actively working on this! Let me know if you need help finding another starter bug to work on 🙂
@hborla Yes I'd love it if you can do that, that would be perfect. I've been away from the project for quite some time and want to return to contribute. Thanks 🙂
Additional Detail from JIRA
md5: de44c3ba895e7552b1a30be2e8d5763f
Issue Description:
We currently have a bunch of type-checker diagnostics that uses the word "accessor" instead of user-facing words such as "getter", "setter" or "observer". The word "accessor" is actually not used anywhere in user-facing documentation or TSPL.
It would be great to replace uses of "accessor" with words that the user is more likely to be familiar with, as mentioned above.
The text was updated successfully, but these errors were encountered: