As it works today, I can collapse methods and I can add regions.
That's nice, but I'd like to see it taken one step further. I'd like to be able to collapse other language structures such as loops and ifs, much like, for example, Visual Studio does.
However, I'd like to take it one more step further. When collapsed, the line representing the collapsed block of code should be shown as any comment on that line, or just the line if there is no comment. This bit is something I've not seen someone do yet, but it would be immensely useful.
Example:
would collapse to:
However, this:
would collapse to:
Of course, indentation levels should be preserved.
With good comments, and most of the code collapsed, the code would read like a pretty clean plaintext description of what's done, with almost no extra effort.
Example of what the end result could look like collapsed:
It doesn't matter if each collapsed block is long and complicated, you still get a clear, concise picture of what the code does.
(Yes, I know the example above should be broken down in sub-methods, but it's just an example. I kept it simple so that it's easy to understand. I'm sure you all could imagine some horribly complicated operation that's too cumbersome to break down.)
That's nice, but I'd like to see it taken one step further. I'd like to be able to collapse other language structures such as loops and ifs, much like, for example, Visual Studio does.
However, I'd like to take it one more step further. When collapsed, the line representing the collapsed block of code should be shown as any comment on that line, or just the line if there is no comment. This bit is something I've not seen someone do yet, but it would be immensely useful.
Example:
B4X:
For f=0 to numfiles 'Delete all the files
Lots of code here
...
Next
would collapse to:
B4X:
Delete all the files
However, this:
B4X:
For f=0 to numfiles
Lots of code here
...
Next
would collapse to:
B4X:
For f=0 to numfiles
Of course, indentation levels should be preserved.
With good comments, and most of the code collapsed, the code would read like a pretty clean plaintext description of what's done, with almost no extra effort.
Example of what the end result could look like collapsed:
B4X:
Sub DeleteLotsOfFiles(path as string)
If arguments are good
Ask user for confirmation
If user confirmed
Read files in dir
Delete all the files
Else exit cleanly
Else bad arguments, exit with error
End Sub
It doesn't matter if each collapsed block is long and complicated, you still get a clear, concise picture of what the code does.
(Yes, I know the example above should be broken down in sub-methods, but it's just an example. I kept it simple so that it's easy to understand. I'm sure you all could imagine some horribly complicated operation that's too cumbersome to break down.)