Eclipse PDT code folding problem

1.3k views Asked by At

I've recently been using Eclipse with PDT for PHP development.

When writing classes I tend to use the following style for class constants and properties:

class Foo extends Bar
{
    const
        CNST_1 = 1,
        CNST_2 = 2,
        CNST_3 = 3;

    private
        $fred = array(),
        $barney = array ();

    public
        $wilma = 123,
        $betty = 456;
}

Unfortunately code folding makes something of a mess of this if I have fold code on load turned on. It ends up looking like this:

class Foo extends Bar
{
        CNST_3 = 3;

        $barney = array ();

        $betty = 456;
}

The code unfold control is there, but clicking it only reveals one extra row of my source file each time until it get to the const, public, private etc part. Then clicking the folding box only hides the first item after the keyword.

Has anyone else hit this issue, and if so what did they do about it?

1

There are 1 answers

1
powtac On BEST ANSWER

I don't know PDT very well, but on PHPeclipse you can solve this by:

Window -> Preferences -> PHPeclipse -> PHP and then in the tab "Folding" unselect all default settings.

For PDT I recomend you, to search for this setting by simply seraching in the preferences for folding or PHP.