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

fixed-typed-throws-after-arrow-fixit #2731

Merged

Conversation

AppAppWorks
Copy link
Contributor

@AppAppWorks AppAppWorks commented Jul 15, 2024

fixes #2391

@AppAppWorks AppAppWorks marked this pull request as draft July 15, 2024 23:55
@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch from 7523e31 to c8f261a Compare July 16, 2024 00:12
Sources/SwiftParser/Parser.swift Outdated Show resolved Hide resolved
Sources/SwiftParser/Specifiers.swift Outdated Show resolved Hide resolved
@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch from c8f261a to 2c2c810 Compare July 17, 2024 02:34
Sources/SwiftParser/Specifiers.swift Outdated Show resolved Hide resolved
Sources/SwiftParser/Specifiers.swift Outdated Show resolved Hide resolved
Sources/SwiftParser/Specifiers.swift Outdated Show resolved Hide resolved
Tests/SwiftParserTest/DeclarationTests.swift Outdated Show resolved Hide resolved
@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch from 2c2c810 to 37be3b4 Compare July 18, 2024 08:28
@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch 3 times, most recently from 07a7053 to e6cf861 Compare July 20, 2024 03:55
@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch from e6cf861 to a3f776e Compare July 23, 2024 20:47
@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch from a3f776e to 2976fc0 Compare July 24, 2024 23:46
@AppAppWorks AppAppWorks marked this pull request as ready for review July 25, 2024 00:33
@AppAppWorks
Copy link
Contributor Author

@ahoppen, could you review my latest commit? :)

@ahoppen
Copy link
Member

ahoppen commented Aug 7, 2024

Did you try to address #2731 (comment)?

@AppAppWorks
Copy link
Contributor Author

Did you try to address #2731 (comment)?

I might have tried that but now I've forgotten it ;)
I'll have a quick check and come back to you!

@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch from 2976fc0 to 1981651 Compare August 7, 2024 03:24
@AppAppWorks
Copy link
Contributor Author

#2731 (comment) addressed.

@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch from 1981651 to c853e3b Compare August 7, 2024 22:41
@ahoppen
Copy link
Member

ahoppen commented Aug 8, 2024

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge August 8, 2024 00:35
@ahoppen
Copy link
Member

ahoppen commented Aug 8, 2024

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member

ahoppen commented Aug 8, 2024

@swift-ci Please test Windows

- `Parser.parseMisplacedEffectSpecifiers` will detect whether there is any misplaced typed throws. If yes, it will try to parse the thrown type and mark all tokens of the thrown type as missing.
- `ParseDiagnosticsGenerator.handleMisplacedEffectSpecifiersAfterArrow` will recognize the entire throws clause as correct instead of the throws specifier only.
- `ParseDiagnosticsGenerator.exchangeNodes` to replace `ParseDiagnosticsGenerator.exchangeTokens`, relaxing the input type from token to any syntax node.
- refactored `TokenMissingMaker` in Declaration.swift, moved to Parser.swift, creating `Parser.withAllTokensMarkedMissing` for more generalized use.
auto-merge was automatically disabled August 8, 2024 01:15

Head branch was pushed to by a user without write access

@AppAppWorks AppAppWorks force-pushed the fix-typed-throws-after-arrow-fix-it branch from c853e3b to c225440 Compare August 8, 2024 01:15
@AppAppWorks
Copy link
Contributor Author

Fixed, please test again.

@ahoppen
Copy link
Member

ahoppen commented Aug 8, 2024

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge August 8, 2024 20:34
@ahoppen
Copy link
Member

ahoppen commented Aug 9, 2024

@swift-ci Please test macOS

@ahoppen
Copy link
Member

ahoppen commented Aug 9, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 2256eaa into swiftlang:main Aug 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix-its for misplaced typed throws could be improved
2 participants