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

[SR-13445] Replace uses of the word "accessor" in diagnostics with user-facing terminology #55887

Open
theblixguy opened this issue Aug 25, 2020 · 5 comments
Labels
accessors Feature → declarations: Variable (property) accessors bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself declarations Feature: declarations diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers swift 5.9

Comments

@theblixguy
Copy link
Collaborator

Previous ID SR-13445
Radar None
Original Reporter @theblixguy
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee hafraz07 (JIRA)
Priority Medium

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.

@theblixguy
Copy link
Collaborator Author

Here's an overview what needs to be done:

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.

@swift-ci
Copy link
Collaborator

swift-ci commented Oct 9, 2020

Comment by Hassan ElDesouky (JIRA)

@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.

@hborla
Copy link
Member

hborla commented Oct 9, 2020

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 🙂

@swift-ci
Copy link
Collaborator

swift-ci commented Oct 9, 2020

Comment by Hassan ElDesouky (JIRA)

@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 🙂

@swift-ci
Copy link
Collaborator

Comment by Saidhon Orifov (JIRA)

Hi @hborla, I would also like to get more involved, do you mind sharing with some of the starter bugs as well?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added swift 5.9 accessors Feature → declarations: Variable (property) accessors declarations Feature: declarations labels Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessors Feature → declarations: Variable (property) accessors bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself declarations Feature: declarations diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers swift 5.9
Projects
None yet
Development

No branches or pull requests

4 participants