NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Collapse/expand of code loop
AciD
Guest

Reply with quote
hi,

firstly, ur ide is *really* nice :)
secondly, few features would make it perfect, features like a possiblity to collapse/expand loops, directly in the editing windows :

a loop would look like :

[-] while ($data = mysql_fecth_array($my_result)) {
| echo ("blahh");
| [+] if ($my_test) {[...]}
| [-] for ($i=0;$i<$foo;$i++) {
| | print_r($_SESSION);
| -- }
-- }


i hope the little scheme will look great out of this editing window :)
hum...
AciD
Guest

Reply with quote
i forgot to tell i saw this feature in the 'kate' editor for linux (if u wanna see it in action :))
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
yeah, I know what code collapsing means Smile
Agreed, it's a nice feature. Unfortunately, it requires huge development...
I can't make sure when and if this feature will be implemented.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Jul 2003
Posts: 8
Reply with quote
yeah... whould be realy cool.
but a little hard to implement i think...
cuz it must be compatible with all the different coding styles...

i prefer making the brakets this way:
Code:

if(...)
 {
  //bla...
 }

others prefer this
Code:

if(...) {
  //bla...
}
View user's profileFind all posts by SwatinemSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
that's the least problem.
you'll see
if ()
{...}

while others will see
if () {...}

where {...} is collapsed block.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 06 Feb 2005
Posts: 1
Reply with quote
Awh, what the hell, I know this is years old and all, but I just had to make a post about this one.

I love code collapse, that's why I'm bumping this one up.
I've tried looking through your announcements searching for keywords similar to code collapsing, but I can't really figure out if this is implemented or not.... :/

I was just thinking about the thoughts you had about this feature and it seems to me that you'd prefferably have the function be fully automatic, trying to interpret where a loop starts and ends.

But how about having custom made collapses? Wouldn't that ease off the interpreter pain that seems to be the big issue here?
Just have people select an amount of text, no matter where and what it is, have a right-click context menu with an option to "collapse" and perhaps a small note could be entered to keep track of what you're collapsing.

Or, if you'd rather it be automatic or "semi"-automatic, have the users enter quotes in the code that are collapsible. I'm not saying that it should be forcing anyone to type stuff like:

Code:

/* CollapseStart "StartCollapse" */
  function CollapseFunction() {
     CODE HERE
  }
/* CollapseStart "EndCollapse" */

because it clutters everyones probably already cluttered code, but it could be an option?

The interpreter part could be anything you choose, of course, I'd just love to see some kind of code collapse than none at all. Wink
View user's profileFind all posts by iljonasoSend private message
Actually thats not a bad idea


Joined: 11 Mar 2005
Posts: 1
Location: Yuma, Arizona
Reply with quote
I've taken phpDocumentor and expanded it for our developers to include @change, @state, @suggestion. ect. You should be documenting your code Smile
So, why not just have he editor detect @collapse ina docblock and then collapse everything in the following class, method, function?


/**
* After much thought and work, here is the new improved hello world function
* @param String; $world; The world in which you wish to say hello to
* @access public
* @return void
* @collapse
*/
function hello($world) {...}

or

class World extends planet {

/**
* This is the constructor method for the class.
* @author Some Smuck
* @collapse
*/
final public __constructor() {...}


/**
* This is the destructor method for the class.
* @author Some Smuck
* @collapse
*/
final public __destructor() {...}
}

or

/**
* This class allows you to say hello to any world.
* @package World
* @author Some Smuck
* @collapse
*/
class CWorld extends planet {...}


It would be easy to do, all you have to add is @collapse which will not in a comment block or line before the function, class, ect.

have the editor keep track of this by giving each collapse a name from what we know.

filename world.php
so key "world.php.CWorld" would be set to true or false depending on state of CWorld Class


Just an idea.
View user's profileFind all posts by NlaakSend private messageAIM AddressYahoo MessengerMSN Messenger


Joined: 21 Nov 2003
Posts: 39
Reply with quote
nah, using comments to denote collapsible block endpoints is a bad idea
a better would be to make the editor got throug the code and look for { and }, using some kind of stack to keep track of current block id, and then mark up beginning and end. then there is another array for keeping track of which block is visible and which is not. if a block is invisible then the editor will print the first line of that block and skip other lines to the next block. also it will skip any sub-blocks (nested if-s and for-s etc)
then there will be a bit messing with removing and creating new blocks on-the-fly
/edit: critical typos


Last edited by netgert on Wed Mar 30, 2005 11:50 pm; edited 1 time in total

_________________
-/ NetGert /-
View user's profileFind all posts by netgertSend private messageVisit poster's websiteMSN Messenger
What are the odds of this development


Joined: 30 Mar 2005
Posts: 1
Reply with quote
I am new to PHPed and I am really enjoying it mainly for it's debugging. But I find that it is missing two key features. One is the collapsible blocks and the second is better block editing.

I do a lot of block editing in Ultra Edit and find it reallly saves on development time.
View user's profileFind all posts by TroyYonerSend private message


Joined: 21 Nov 2003
Posts: 39
Reply with quote
could u explain what is "block editing"

_________________
-/ NetGert /-
View user's profileFind all posts by netgertSend private messageVisit poster's websiteMSN Messenger
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
Quote:
could u explain what is "block editing"


Block Editing is called column mode in UE:

From the UE site:
Quote:

Column Mode button

Toggle between Column Mode and regular text mode. Column Mode allows users to select/edit text in columns or blocks. This introduces powerful editing options as this makes it possible to insert text into multiple lines with a single operation. Column Mode also enables such options as selecting a column of numbers and summing their values, inserting sequential numbers into the active document across multiple lines, and converting unaligned text to fixed columns. This greatly facilitates manual editing of database files when errors must be corrected.


The only block-ish thing i frequently miss is being able to draw a selection line (with no characters selected) (fig 1) and then when pressing tab only the code from that line on is indented (fig 2).

What I already requested long time ago iirc still stands: being able to modify the characters interpreted as word boundaries. (or something similar), phpEd skips a lot of things I would prefer it didn't when using the Control+Arrow. UE interpretes symbols like (){}=\/. etc etc as word breaks as well and I for one find that method more comfortable (perhaps a simple switch to enable extended wordbreaks or not)

<suckup> Anyway, whatever the result off my and other requests is, i still love phpEd and haven't regretted paying for it for a sec (although it was a substantioal amount of money for my little company;) ) </suckup>

Fig1:


Fig2:
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 21 Nov 2003
Posts: 39
Reply with quote
okay, got the idea now. however the usefulness seems very rare and not for php editing

_________________
-/ NetGert /-
View user's profileFind all posts by netgertSend private messageVisit poster's websiteMSN Messenger
Collapse/expand of code loop
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 2  

  
  
 Reply to topic