Ticket #401 (new enhancement)

Opened 3 years ago

Last modified 11 months ago

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'.

  • 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

Change History

comment:1 Changed 3 years ago by jquelin

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.

comment:2 Changed 3 years ago by jquelin

moose attribute detection added in r5577

comment:3 Changed 3 years ago by jquelin

moosex::poe events detection added in r5578

comment:4 Changed 2 years ago by rhebus

  • Type changed from defect to enhancement

comment:5 Changed 15 months ago by zenogantner

  • Component changed from editor to advanced perl tools

comment:6 Changed 15 months ago by zenogantner

  • Keywords outline added

comment:7 Changed 11 months ago by szabgab

  • Component changed from advanced perl tools to Outline
Note: See TracTickets for help on using tickets.