You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like an option to place Sorbet sigs in the source file, rather than a separate .rbi file, to make use of the sorbet-runtime.
Describe the solution you'd like
To use the example in the README, given:
moduleExampleclassPerson# @param name [String] The name of the Person to create.# @param age [Integer] The age of the Person to create.# @return [Example::Person]definitialize(name,age)@name=name@age=ageend# @return [String]attr_accessor:name# @return [Integer]attr_accessor:age# @param possible_names [Array<String>] An array of potential names to choose from.# @param possible_ages [Array<Integer>] An array of potential ages to choose from.# @return [Example::Person]defself.construct_randomly(possible_names,possible_ages)Person.new(possible_names.sample,possible_ages.sample)endendend
I would like to be able to transform the file into:
moduleExampleclassPerson# @param name The name of the Person to create.# @param age The age of the Person to create.sig{params(name: String,age: Integer).void}definitialize(name,age)@name=name@age=ageendsig{returns(String)}attr_accessor:namesig{returns(Integer)}attr_accessor:age# @param possible_names An array of potential names to choose from.# @param possible_ages An array of potential ages to choose from.sig{params(possible_names: T::Array[String],possible_ages: T::Array[Integer]).returns(Example::Person)}defself.construct_randomly(possible_names,possible_ages)Person.new(possible_names.sample,possible_ages.sample)endendend
Note that I've kept the docstrings, and only scrubbed the types from the YARD annotations, bc the yard-sorbetplugin can merge the two when generating YARD docs.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I would like an option to place Sorbet
sig
s in the source file, rather than a separate .rbi file, to make use of the sorbet-runtime.Describe the solution you'd like
To use the example in the README, given:
I would like to be able to transform the file into:
Note that I've kept the docstrings, and only scrubbed the types from the YARD annotations, bc the
yard-sorbet
plugin can merge the two when generating YARD docs.The text was updated successfully, but these errors were encountered: