parlour icon indicating copy to clipboard operation
parlour copied to clipboard

Parse props from more T:Struct-like things

Open timgaleckas opened this issue 5 years ago • 1 comments

We have a class

class Ti::Struct < T::InexactStruct
  extend T::Helpers
  extend T::Sig
  abstract!
  ...

that we use in place of T::Structs to add custom deserialization among other things. We'd like to use parlour to generate rbi files but it only handles props on 'T::Struct' due to https://github.com/AaronC81/parlour/blob/master/lib/parlour/type_parser.rb#L180

We've written a plugin to handle props on these classes but it would be great if parlour supported anything that has T::Prop included.

timgaleckas avatar Dec 02 '20 15:12 timgaleckas

This would be good to have! Parlour's not really designed to be smart enough to find and resolve struct-like classes itself, but there could be an "acts like struct" configuration option which extends that ['T::Struct', '::T::Struct'] array you've linked.

I'll have a think of the best way to implement this and put a PR together in the coming days :)

AaronC81 avatar Dec 04 '20 23:12 AaronC81