-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[pigeon][swift] Removes FlutterError in favor of PigeonError #6611
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c510bd6
[pigeon] Do not use FlutterError when generating Swift code
hpcnt-daniel-l d8968d7
[pigeon] Add option to whether emit PigeonError class in Swift code
hpcnt-daniel-l c2beea1
[pigeon] Simplify localizedDescription of PigeonError in Swift
hpcnt-daniel-l 6a8a94c
[pigeon] Always make sure CoreTests.gen.swift has PigeonError class
hpcnt-daniel-l b874f09
[pigeon] Make PigeonError class final and add FlutterError initializer
hpcnt-daniel-l df102e3
[pigeon] Rename swiftEmitErrorClass to emitPigeonErrorClass
hpcnt-daniel-l b30a0cc
[pigeon] Make wrapError in swift also handle PigeonError
hpcnt-daniel-l 30ac050
[pigeon] Emit Error class for Swift with different names per file
hpcnt-daniel-l 92c97af
[pigeon] Restore docregion for swift-class
hpcnt-daniel-l 86d9168
[pigeon] Add CHANGELOG.md entry
hpcnt-daniel-l 20ac87a
[pigeon] Apply format fix
hpcnt-daniel-l 800ba60
[pigeon] Generate Swift error on CoreTests.gen.swift
hpcnt-daniel-l 8fa6b75
[pigeon] Fix unittests for swift generator
hpcnt-daniel-l 4bd3dbc
[pigeon] Run update-excerpts
hpcnt-daniel-l fae49ea
[pigeon] Bump version correctly
hpcnt-daniel-l b386a96
Merge commit 'd670b2c38c8db0a773aa703e7d3f15682e05ad7f' into feature/…
hpcnt-daniel-l 78c3bb6
Remove conversion from FlutterError to PigeonError in Swift
hpcnt-daniel-l f13a06a
Update the comment for the PigeonError class in Swift
hpcnt-daniel-l 63df915
Update the documentation for using PigeonError in Swift
hpcnt-daniel-l 428736d
Replace several usage of Indent.nest with Indent.writeScoped
hpcnt-daniel-l 88cd27d
Update Changelog and README of pigeon package
hpcnt-daniel-l a78cae7
Addressing review comments
hpcnt-daniel-l 4ed7852
Relocate PigeonError class in Swift files
hpcnt-daniel-l a8ab4f8
Merge branch 'main' into feature/pigeon-swift-error
tarrinneal 877015d
Merge branch 'main' into feature/pigeon-swift-error
bc-lee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it open for developers to use a custom class name? why don't we just use
PigeonError?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, I believe calling pigeon once for each package (plugin, app, etc.) should suffice. In these scenarios, there's no need to concern ourselves with the generated class name. However, in this repo, pigeon is invoked multiple times for the same package, which results in multiple classes with the same name, ultimately causing a compilation error.
Kotlin encounters a similar problem but has a solution for it. This Link provides a background of the issue as well as its resolution. I have therefore applied the same solution to the generation of Swift code.
I believe overriding the error class name as an advanced usage, so I prefer not to integrate it with the command line option, similar to the approach taken by Kotlin.