Skip to content
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

Parse props from more T:Struct-like things #105

Open
timgaleckas opened this issue Dec 2, 2020 · 1 comment
Open

Parse props from more T:Struct-like things #105

timgaleckas opened this issue Dec 2, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@timgaleckas
Copy link

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 timgaleckas added the enhancement New feature or request label Dec 2, 2020
@AaronC81
Copy link
Owner

AaronC81 commented Dec 4, 2020

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants