Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#126 Open SUB Declaration fails if sub is in another package

v0.3.9
closed-fixed
nobody
Editor (234)
5
2005-02-01
2005-01-28
JoK
No

If e.g. the SUB declaration of MyFunc is serached in
another perl script then the function cannot be found!

Example:
Test/Pac1.pm:
--start--
package Test::Pac1;

sub MyFunc
{
}

1;
--end--

Perl Script test.pl:
--start--
use Test::Pac1;

# Call MyFunc
MyFunc();
--end--

When you select the MyFunc string in test.pl and
select "Open SUB Declaration" from the context menu it
cannot be found.

I analyzed
org\epic\perleditor\popupmenus\OpenDeclaration.java
and found a bug in the function searchSelection(..) in
the section for "//retrieve all Packages":

The line:
selection += "()";

must be replaced by:
selection += ")";

because the selection string is set previously
to "function(".

I corrected this => now it finds the use statement in
the test.pl file, but still it does not open the Pac1.pm
file and sets the focus on the requested function.

Discussion

  • LeO
    LeO
    2005-01-31

    Correcte OpenDeclaration

     
    Attachments
  • LeO
    LeO
    2005-01-31

    Logged In: YES
    user_id=703323

    Your correction would be OK, if the previous code wouldn't
    have had a minor Bug (see comments in the attached File).

    The Open of Files of a packages was shifted on the timeline
    to much, much later (if ever) due to several unsolved issues
    resp. no time from myself.

    IF you volunteer for improvements I could assist with
    comments. I personally guess, it's not THAT difficult,
    except you have to handle different cases (File in the
    project-path, file in the INC-path, etc.). Send me an email
    just in case, otherwise I'll make a RFE the next time I get
    a slot.

     
  • LeO
    LeO
    2005-02-01

    • status: open --> closed-fixed
     
  • LeO
    LeO
    2005-02-01

    Logged In: YES
    user_id=703323

    Correction as you've pointed correctly out were made and are
    available in CVS.

    The open Package is currently not implemented and there NO
    Bug. I could assist if you'll volunteer for coding. If not,
    then please open a RFE.

    :)

    LeO