Skip to content

Fix-Its should be phrased as imperative actions rather than questions #67510

Description

@tristanlabelle

Swift phrases quick fixes as questions:

image

This is inconsistent with other extensions and code actions, which are phrased as imperative verbs:

image image image image

Activity

  1. ahoppen commented on Jul 25, 2023

    @ahoppen
    Member

    Tracked in Apple’s issue tracker as rdar://112830935

  2. changed the title [-]Quick fixes should be phrased as imperative actions rather than questions[/-] [+]Fix-Its should be phrased as imperative actions rather than questions[/+] on Jul 25, 2023
  3. ahoppen commented on Jul 25, 2023

    @ahoppen
    Member

    I have been moving in the same direction of imperative Fix-It messages in new parser (https://github.com/apple/swift-syntax/blob/1a594a6296de3964756835bd57599f9c28c40229/Sources/SwiftParserDiagnostics/ParserDiagnosticMessages.swift#L582-L629) so I support the direction.

    All these Fix-It messages are coming from the compiler, so I’m moving the issue to that repo. But just to set expectations, I don’t expect all the compiler Fix-It messages to get updated in the near future.

  4. tristanlabelle commented on Jul 25, 2023

    @tristanlabelle
    ContributorAuthor

    Sounds good, thank you! Other messages here start with a capital letter but sourcekit-lsp could make that conversion if swift-syntax has other clients with other expectations.

  5. self-assigned this
    on Aug 1, 2023
  6. hborla commented on Aug 1, 2023

    @hborla
    Member

    @nishithshah2211's interested in taking a look at this!

  7. XaurDesu commented on Aug 12, 2023

    @XaurDesu

    Should we make a list of messages worded like this? I could maybe try and rewrite a few of them

  8. XaurDesu commented on Aug 12, 2023

    @XaurDesu

    Actually now that i think about it, where are this messages defined, anyways?

  9. xedin commented on Aug 13, 2023

    @xedin
    Contributor

    All of the diagnostic messages are located in https://github.com/apple/swift/tree/main/include/swift/AST in various Diagnostics*.def files split into one file per compiler phase e.g. Parser, Sema, SIL as well as Common. There is an easy way to find out identifier of the diagnostic: add -Xfrontend -debug-diagnostic-names flag in your compiler invocation and use the identifier produced in braces to grep in the def files.

  10. vickipetrova commented on Mar 31, 2024

    @vickipetrova

    Is there any work remaining on this issue -- I can see it's still open but there's a merged PR? I'm just looking for a simple first issue to tackle :)

  11. tristanlabelle commented on Apr 1, 2024

    @tristanlabelle
    ContributorAuthor

    You're welcome to review other scenarios but I just verified that the specific bug I was reporting here was fixed, although now there are two different-named actions that will do the same.

    image

  12. added
    compilerThe Swift compiler itself
    diagnostics qualityBug: The quality of compiler diagnostics
    type checkerArea → compiler: Semantic analysis
    conformancesFeature → protocol: protocol conformances
    fix-itsFeature: diagnostic fix-its
    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.
    on Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfconformancesFeature → protocol: protocol conformancesdiagnostics qualityBug: The quality of compiler diagnosticsfix-itsFeature: diagnostic fix-itsgood first issueGood for newcomersswift 5.9type checkerArea → compiler: Semantic analysis

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions