Eclipse/EPIC source formatter sometimes works

Help
2009-11-02
2013-05-20
  • Sumeet Pareek
    Sumeet Pareek
    2009-11-02

    I have EPIC installed for Eclipse to be used for perl development. EPIC used perltidy for souce formatting. The problem I am facing is this - When I select a bunch of code and press CTRL+SHIFT+F the selected code gets formatted according to the preferences saved. However, sometimes this does happen even though the select code is not correctly formatted.

    Eg:

    #1 formatting the below gives what is shown in
    <pre>
    if ($job) {
    &debugprint( 1, "Calling job=>$job" );
        eval { &$job; };
        &n_implemented( $@, $job ) if $@;
    }
    else
    {
    &debugprint( 1, "Calling job=>default_job" );
        &default_job();
    }
    </pre>

    #2 Correctly formatted code
    <pre>
    if ($job) {
        &debugprint( 1, "Calling job=>$job" );
        eval { &$job; };
        &n_implemented( $@, $job ) if $@;
    }
    else {
        &debugprint( 1, "Calling job=>default_job" );
        &default_job();
    }
    </pre>

    When I edit  > change it back to look like  > reselect code and press CTRL+SHIFT+F > code does not get correctly formatted.

    Is this a known bug? OR could it be that my installation is corrupt? (but I have same problem on multiple Eclipse/EPIC installs of diff versions and OSs)

     
  • Jan Ploski
    Jan Ploski
    2009-11-02

    I can't quite reproduce the behavior your described, but it is worth noting that the source formatter always works on the whole file, not on the current selection. Perhaps it explains what is happening in your case?

     
  • Sumeet Pareek
    Sumeet Pareek
    2009-11-02

    @jploski Thanks for the reply. I have already tried source formatter on the entire file. The problem still remains. The same code would sometimes get formatted and sometimes it wont (same machine, same eclipse install).
    btw..
    my eclipse version - 3.3.2
    epic version - 0.6.24

     
  • Jan Ploski
    Jan Ploski
    2009-11-02

    Does it also happen with the most recent version of EPIC (0.6.35)?