Ticket #401 (new enhancement)
profile view should take moose into account
| Reported by: | jquelin | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Outline | Version: | 0.36 |
| Keywords: | outline | Cc: |
Description
moose becomes more and more proeminent those days, and thus padre should support it correctly.
so i propose that profile view detects the various sugar syntaxes added by moose. (should i create one ticket per proposal?)
among them:
- attribute detection
add a new category 'attributes' in profile view, with a list of declared attributes. clicking on the attribute name focuses on it.
attributes are declared in moose with:
has attribute => ( ... );
beware that some people are using 'attribute' or "attribute" instead of using the fat comma stringification
- also, parsing attributes to fetch if they're read-only or read-write (or nothing), to create the accessors in the profile view
has attr1 => ( [...], is=>'ro', [...] ); has attr2 => ( [...], is=>'rw', [...] ); has attr3 => ( [... no 'is' param ...] );
the methods 'attr1' and 'attr2' should be created. (no 'attr3' method at all)
note however that if MooseX::FollowPBP is loaded, the methods will be 'get_attr1', 'set_attr1' and 'get_attr2'. and if MooseX::SemiAffordanceAccessor? is loaded, the methods will be 'attr1', 'set_attr1', 'attr2'.
- should we take method modifiers into account? cf http://search.cpan.org/perldoc?Moose::Manual::MethodModifiers
- also, MooseX::POE allows to create events easily with the following syntax:
event my_event => sub { ... }
==> a new category Events in the outline view should be created for them

oh, one useful & popular module is MooseX::AttributeHelpers?
example - if we have the followin attributes declaration:
has _attribute => ( metaclass => 'Collection::Array', provides => { push => 'add_stuff', elements => 'all_frobnizers', } );==> the methods add_stuff and all_frobnizers should be added to the outline view.