Use type builder to generate DSL RBI files#2489
Conversation
There was a problem hiding this comment.
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