-
Notifications
You must be signed in to change notification settings - Fork 440
swift should offer fixit for "#elif" #1221
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
Comments
I've started investigating this issue. I've used the following code to check on the parser diagnostics: let sourceFile = Parser.parse(source: """
#if arch(arm64)
debugPrint("arm64")
#elif arch(x86_64)
debugPrint("x86_64")
#endif
""")
let diagnostics = ParseDiagnosticsGenerator.diagnostics(for: sourceFile)
print(diagnostics)
print(diagnostics.flatMap(\.fixIts).map(\.message.message)) The above code prints the following:
I've tried using ´#else if´ instead of ´#elseif´ in the code above, but here's the emitted diagnostic (which is different from the message in this issue):
@ahoppen Am I on the right track? Should I be looking for Thanks in advance. |
Thanks for having a look @TiagoMaiaL!
Is referring to the C++ parser in the Swift compiler. It outputs a useful diagnostic on a https://github.com/apple/swift-syntax/blob/main/Sources/SwiftParser/SwiftParser.docc/FixingBugs.md talks about this a little. In this case |
@ahoppen I think this can be finally closed, right? Thank you for the help! |
Yes, thanks for your patience and seeing this Fix-It through 🙏🏽 |
Uh oh!
There was an error while loading. Please reload this page.
Description
Swift offers a fixit for #else if -> #elseif.
We should also offer a fixit for #elif, eg:
rdar://103506087
The text was updated successfully, but these errors were encountered: