-
Notifications
You must be signed in to change notification settings - Fork 155
Use type builder to generate DSL RBI files #2489
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
base: main
Are you sure you want to change the base?
Conversation
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.
What do you think of first doing a refactor to allow compilers to use 2 type builders, one for RBI, one for RBS.
class MyCompiler < Compiler
def decorate
# we go from this:
root.create_path(constant) do |model|
end
# to this:
rbi_builder.create_path(constant) do |model|
end
# or this:
rbs_builder.create_path(constant) do |model|
end
endAnd keep root as a proxy to the rbi_builder so the API is unchanged?
That way we can migrate compilers one by one and not worry about external ones.
I don't understand why we need 2 type builders, though. I thought the whole point of the type builder abstraction was to be able to generate RBI syntax or RBS syntax from the same types, and I also got some of that working as well. |
Sorry I got confused in the naming, the idea would be to have the current builder that use |
Motivation
Implementation
Tests