-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[pigeon] Kotlin implementation for ProxyApis #6371
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
Changes from 1 commit
7d66bf7
d64d2a2
b64d723
89d3c92
1f7d0ad
fa3c943
2665c22
cadf14c
2bf6738
6437fc9
aea71cd
0c09e91
f114c8c
d57ac0d
ff1e210
7e345ac
db2a198
a7c94e5
7af4343
a7b20a0
f2a1d5b
f76265e
b8e70f6
4f2327d
5ade010
3b3a91b
ec37d62
186fe47
894e642
118606a
4e821cb
4205418
258653b
5070f6e
06d163b
79e994b
1b9dfc1
f91a51f
84e0a0c
bdf1aae
2ff9075
b0569f5
4f47756
03d1100
c49aff2
c7e5ad0
d1883be
3025438
9af2d08
78128b8
84879d2
90f38b6
505b500
172ef36
c294d49
eaf1302
03f8a9e
6a57229
38ab4a1
78ade11
fcb3aa5
61579bc
c981d97
60be3da
0b7de44
8974f28
4ae228d
e5ad0ce
77ac326
33e3742
927aeea
ce65169
1dd1eda
bd08aa0
b2ae858
b2b82f6
4627f4a
abe2c0d
92a7370
6d5b581
770b24c
9e59393
bc60c15
cb10073
3b3284a
cae65e8
82f0cee
233acf5
e810a8f
b95997e
24daaa1
f0aa519
fed5b58
ccb1783
0a2a643
942918b
89abc69
cc55be5
41fca50
78e1e48
e844875
af2965f
25d4515
c5a083e
676eb05
f7b662a
d79c8f0
f4ac560
f70c2f1
c1f23ae
b958879
ecf079c
98d088f
923e21e
f9d5b78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
|
|
||
| import 'package:collection/collection.dart' show ListEquality; | ||
| import 'package:meta/meta.dart'; | ||
| import 'kotlin_generator.dart'; | ||
| import 'pigeon_lib.dart'; | ||
|
|
||
| typedef _ListEquals = bool Function(List<Object?>, List<Object?>); | ||
|
|
@@ -139,6 +140,7 @@ class AstProxyApi extends Api { | |
| required this.fields, | ||
| this.superClass, | ||
| this.interfaces = const <TypeDeclaration>{}, | ||
| this.kotlinOptions, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need Kotlin options in a class that's currently unaware of specific generators?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the generated code references the native class, each ProxyApi needs to provide the full class name with the package. I also think |
||
| }); | ||
|
|
||
| /// List of constructors inside the API. | ||
|
|
@@ -153,6 +155,10 @@ class AstProxyApi extends Api { | |
| /// Name of the classes this class considers to be implemented. | ||
| Set<TypeDeclaration> interfaces; | ||
|
|
||
| /// Options that control how Kotlin code will be generated for a specific | ||
| /// ProxyApi. | ||
| final KotlinProxyApiOptions? kotlinOptions; | ||
|
|
||
| /// Methods implemented in the host platform language. | ||
| Iterable<Method> get hostMethods => methods.where( | ||
| (Method method) => method.location == ApiLocation.host, | ||
|
|
||
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.
I don't love this being imported to this file. Can we move the kotlin options into the normal kotlin options class?
Uh oh!
There was an error while loading. Please reload this page.
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.
I can't add this to the normal kotlin options class because these options are used for each
@ProxyApiclass. The normal kotlin options are used for the whole file. I changed it tothough.