Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » User code folding
User code folding [message #513433] Wed, 10 February 2010 03:36 Go to next message
Alexander  is currently offline Alexander
Messages: 1
Registered: February 2010
Junior Member
Hi

Is user code folding available in PDT?

Like Netbeans:
// <editor-fold defaultstate="collapsed" desc=" description">
....
// </editor-fold>

Or Visual Studio:

#region description
...
#endregion

Thx
Re: User code folding [message #514903 is a reply to message #513433] Wed, 17 February 2010 01:51 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro Izumi
Messages: 344
Registered: July 2009
Location: Japan
Senior Member
FYI:

Bug 165681 -- [CodeFolding] Allow to define elements to be folder by selecting lines in editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=165681

Bug 169098 -- [CodeFolding] Add Code Folding for three braces --> like Vim fold-marker
https://bugs.eclipse.org/bugs/show_bug.cgi?id=169098

Bug 173796 -- [CodeFolding] #region / #endregion code folding support
https://bugs.eclipse.org/bugs/show_bug.cgi?id=173796

Bug 178679 -- [CodeFolding] Add extra folding (if, while, for....) to the editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=178679

...
(My opinion is *anyone* can add such functionality to PDT through the extension point.)
Re: User code folding [message #517067 is a reply to message #514903] Thu, 25 February 2010 20:57 Go to previous messageGo to next message
Gary Mort is currently offline Gary Mort
Messages: 3
Registered: February 2010
Junior Member
"(My opinion is *anyone* can add such functionality to PDT through the extension point.)"

Considering that code folding, once the basics are there, is basically just finding the start/end keyword/charector and enabling them for folding - it seems to me that this should be easy to add as well.

Still, the lack of this one feature is what is preventing me from moving to eclipse from other platforms.

However, eclipse is so compelling a choice I am willing to roll up my sleeves and give it a go to add this functionality myself. Can you provide me any hints/pointers on where to look to hack through the code and give it a try?
Re: User code folding [message #517133 is a reply to message #517067] Fri, 26 February 2010 06:21 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro Izumi
Messages: 344
Registered: July 2009
Location: Japan
Senior Member
"through the extension point" means that you have to create an eclipse plug-in. Is it OK?
If you are familiar with developing eclipse plug-ins, you can find the extension point 'org.eclipse.php.ui.foldingStructureProviders'. It is necessary to implement two classes for IStructuredTextFoldingProvider and IPHPFoldingPreferenceBlock.
My small implementation is
https://bugs.eclipse.org/bugs/show_bug.cgi?id=173796 (attached zip...oops, I had forgotten to package sources into zip)
or
http://sourceforge.jp/cvs/view/pdt-tools/ExperimentalFolding Provider/ (another implementation's source repository)

BTW, this extension point doesn't work on Helios(Eclipse 3.6 + WTP 3.2) because wtp had removed IStructuredTextFoldingProvider. New interface is here, though pdt isn't migrated yet.
http://wiki.eclipse.org/New_Help_for_Old_Friends_V#Code_Fold ing

Best regards.
Re: User code folding [message #667541 is a reply to message #513433] Fri, 29 April 2011 08:58 Go to previous message
Palmer Eldritch is currently offline Palmer Eldritch
Messages: 40
Registered: February 2011
Member
See : https://bugs.eclipse.org/bugs/show_bug.cgi?id=63808
Needs to be implemented as a "surround with" option with default sate collapsed - as in netbeans - not just a quick hack for adding a new fold keyword


eclipse-kepler JEE
Win7 x64
Previous Topic:Define and display their value in the debugger environment
Next Topic:Problem with the Apache DefaultHttpClient class
Goto Forum:
  


Current Time: Fri Aug 01 06:11:14 EDT 2014

Powered by FUDForum. Page generated in 0.02825 seconds