Repository navigation
Fix-Its should be phrased as imperative actions rather than questions #67510
Description
Activity
Tracked in Apple’s issue tracker as rdar://112830935
- 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 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.
Sounds good, thank you! Other messages here start with a capital letter but
sourcekit-lspcould make that conversion ifswift-syntaxhas other clients with other expectations.@nishithshah2211's interested in taking a look at this!
Should we make a list of messages worded like this? I could maybe try and rewrite a few of them
Actually now that i think about it, where are this messages defined, anyways?
All of the diagnostic messages are located in https://github.com/apple/swift/tree/main/include/swift/AST in various
Diagnostics*.deffiles 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-namesflag in your compiler invocation and use the identifier produced in braces to grep in the def files.Reacted by Jaime Andres Torres BermejoIs 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 :)
- addedcompilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics qualityBug: The quality of compiler diagnosticsBug: The quality of compiler diagnosticstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisconformancesFeature → protocol: protocol conformancesFeature → protocol: protocol conformancesfix-itsFeature: diagnostic fix-itsFeature: diagnostic fix-itsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.
on Apr 1, 2024

Swift phrases quick fixes as questions:
This is inconsistent with other extensions and code actions, which are phrased as imperative verbs: