Menu

Content Assist on returned variables

Help
MattLG
2008-07-29
2013-05-20
  • MattLG

    MattLG - 2008-07-29

    I am finding that content assist works fine on $object1 when I do:

    my $object1 = Class1->new();

    but when I then do

    my $object2 = $object1->createClass2();

    I get no content assist on $object2, even if createClass2() is just

    sub createClass2 {
      return Class2->new();
    }

    Surely content assist can work out what subroutines are availabe to $object2 from that.

    MattLG

     
    • Jan Ploski

      Jan Ploski - 2008-07-29

      In this particular case, it could be implemented, but it doesn't generalize easily at all. You could break it by modifying your source slightly. It is generally a cost/benefit question whether and when hacks that support a bunch of particular cases should be implemented.

       
    • MattLG

      MattLG - 2008-07-29

      I'm a bit confused as to how the content assist works in OO-Perl, becuase I've just noticed that you don't have to bless the object reference for the content assist to realise that it's an object being returned from new(). I'd assumed it would know that a blessed reference was an object and allow content assist on it's subroutines.

       
      • Jan Ploski

        Jan Ploski - 2008-07-29

        Content assist in EPIC is nothing but a bunch of regular expressions.

         
    • MattLG

      MattLG - 2008-07-31

      I've just tested this in Komodo (at work) and it seems that Komodo can't handle it either. I'm glad I didn't fork out for it when EPIC is clearly just as good :-)

       

Log in to post a comment.