-
Notifications
You must be signed in to change notification settings - Fork 86
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
Organize the arguments of Model.render. #272
Conversation
} | ||
return nil | ||
} | ||
.sorted { (left: (String, Int64), right: (String, Int64)) -> Bool in |
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.
The sorting is done in generateUniqueModels
, so sorting here is unnecessary.
@@ -32,28 +31,37 @@ final class ClosureModel: Model { | |||
return .closure | |||
} | |||
|
|||
init(genericTypeParams: [ParamModel], paramNames: [String], paramTypes: [SwiftType], isAsync: Bool, throwing: ThrowingKind, returnType: SwiftType, encloser: String) { |
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.
encloser
is unnecessary here because type
depends on RenderContext
.
@@ -27,6 +27,18 @@ public enum ModelType { | |||
case closure | |||
} | |||
|
|||
enum NominalTypeDeclKind: String { |
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.
In the most places, DeclType
has incorrect cases so prepares new enum.
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 left a few minor review comments. Thank you very much!
Co-authored-by: Fumiya Tanaka <[email protected]>
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.
Thank you very much!
Model.render
has a lot of arguments, making it very complex.There are also places where meaningless values are being passed.
In this PR, I will organize the arguments by separating them into
RenderContext
andGenerationArguments
, allowing us to distinguish between global settings and the state during the render process.