-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[pigeon][swift] Removes FlutterError in favor of PigeonError #6611
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
bc-lee d8968d7
[pigeon] Add option to whether emit PigeonError class in Swift code
bc-lee c2beea1
[pigeon] Simplify localizedDescription of PigeonError in Swift
bc-lee 6a8a94c
[pigeon] Always make sure CoreTests.gen.swift has PigeonError class
bc-lee b874f09
[pigeon] Make PigeonError class final and add FlutterError initializer
bc-lee df102e3
[pigeon] Rename swiftEmitErrorClass to emitPigeonErrorClass
bc-lee b30a0cc
[pigeon] Make wrapError in swift also handle PigeonError
bc-lee 30ac050
[pigeon] Emit Error class for Swift with different names per file
bc-lee 92c97af
[pigeon] Restore docregion for swift-class
bc-lee 86d9168
[pigeon] Add CHANGELOG.md entry
bc-lee 20ac87a
[pigeon] Apply format fix
bc-lee 800ba60
[pigeon] Generate Swift error on CoreTests.gen.swift
bc-lee 8fa6b75
[pigeon] Fix unittests for swift generator
bc-lee 4bd3dbc
[pigeon] Run update-excerpts
bc-lee fae49ea
[pigeon] Bump version correctly
bc-lee b386a96
Merge commit 'd670b2c38c8db0a773aa703e7d3f15682e05ad7f' into feature/…
bc-lee 78c3bb6
Remove conversion from FlutterError to PigeonError in Swift
bc-lee f13a06a
Update the comment for the PigeonError class in Swift
bc-lee 63df915
Update the documentation for using PigeonError in Swift
bc-lee 428736d
Replace several usage of Indent.nest with Indent.writeScoped
bc-lee 88cd27d
Update Changelog and README of pigeon package
bc-lee a78cae7
Addressing review comments
bc-lee 4ed7852
Relocate PigeonError class in Swift files
bc-lee 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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.