[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Folding editor for ruby code browsing

Andrew Walrond

4/24/2005 9:46:00 PM

I need to fold the code so that I can get a handle on the overall structure;
basically to tidy up and and move whole public methods into protected or
private sections, that sort of thing.

I've tried browsing the code in Kate (xemacs is my usual home) which supports
folding of ruby code. But it's folding is very buggy and I seem to lose whole
portions of a file into a fold without warning. I can't find any good folding
solutions for xemacs. What about vim, or other open source editors (for
linux)?

Recommendations?

Andrew Walrond


35 Answers

Thomas Kirchner

4/24/2005 9:54:00 PM

0

* On Apr 25 6:46, Andrew Walrond (ruby-talk@ruby-lang.org) wrote:
> What about vim, or other open source editors (for linux)?
>
> Recommendations?

Vim is excellent at folding (along with pretty much everything else).
You can fold by any number of methods, including indent, marker,
expression, syntax, diff-style, or even manual... Give it a shot if
you're not too die-hard with emacs.
Tom

Curt Hibbs

4/24/2005 11:01:00 PM

0

Andrew Walrond wrote:
> I need to fold the code so that I can get a handle on the overall structure;
> basically to tidy up and and move whole public methods into protected or
> private sections, that sort of thing.
>
> I've tried browsing the code in Kate (xemacs is my usual home) which supports
> folding of ruby code. But it's folding is very buggy and I seem to lose whole
> portions of a file into a fold without warning. I can't find any good folding
> solutions for xemacs. What about vim, or other open source editors (for
> linux)?
>
> Recommendations?

Try the open source FreeRIDE IDE:

http://freeride.ruby...

It not only does code folding, but also has a source browser - a
clickable tree control that let's you see and navigate your ruby code by
its structure (module/class/method). It also has interactive Ruby
documentation.

Best of all, it written entirely in Ruby and is open source!

Curt


Florian Groß

4/25/2005 12:13:00 AM

0

Andrew Walrond wrote:

> I need to fold the code so that I can get a handle on the overall structure;
> basically to tidy up and and move whole public methods into protected or
> private sections, that sort of thing.
>
> Recommendations?

jEdit with the Ruby plug in does this quite well. There's other folding
options like by-indentation as well.



gabriele renzi

4/25/2005 8:39:00 AM

0

Andrew Walrond ha scritto:
> I need to fold the code so that I can get a handle on the overall structure;
> basically to tidy up and and move whole public methods into protected or
> private sections, that sort of thing.
>
> I've tried browsing the code in Kate (xemacs is my usual home) which supports
> folding of ruby code. But it's folding is very buggy and I seem to lose whole
> portions of a file into a fold without warning. I can't find any good folding
> solutions for xemacs. What about vim, or other open source editors (for
> linux)?
>
> Recommendations?

SciTE does folding quite well (especially if you get the more rubyish
lexers, the old one did some strange pythonic things).

Andrew Walrond

4/25/2005 9:36:00 AM

0


Content-Type: Multipart/Mixed;
boundary="Boundary-00=_7mLbCZ9NJX4gsuv"
On Sunday 24 April 2005 22:54, Thomas Kirchner wrote:
>
> Vim is excellent at folding (along with pretty much everything else).
> You can fold by any number of methods, including indent, marker,
> expression, syntax, diff-style, or even manual... Give it a shot if
> you're not too die-hard with emacs.
> Tom

Vim fell at the first hurdle; syntax colouring/highlighting :(
It seems unhappy with IO#<< unless I put some spaces around it; Try the
attached file.

I have downloaded the latest syntax/ruby.vim file, but no change.

Haven't tried folding yet

Andrew

Michael Ulm

4/25/2005 12:08:00 PM

0

Andrew Walrond wrote:
> On Sunday 24 April 2005 22:54, Thomas Kirchner wrote:
>
>>Vim is excellent at folding (along with pretty much everything else).
>>You can fold by any number of methods, including indent, marker,
>>expression, syntax, diff-style, or even manual... Give it a shot if
>>you're not too die-hard with emacs.
>>Tom
>
>
> Vim fell at the first hurdle; syntax colouring/highlighting :(
> It seems unhappy with IO#<< unless I put some spaces around it; Try the
> attached file.

The syntax highlighting engine parses the line
f<<stdin
as the beginning of a Here Document. This would go away if you
put a space after the << (makes the code more readable too IMO).

As a fix (especially if you don't use Here Documents anyway) you
can comment out the lines in the Here Document section of the
ruby.vim file; actually, commenting out only the first line there,
(the one containing the expression '<<\z' (without the quotes))
should work too.

HTH,

Michael

--
Michael Ulm
R&D Team
ISIS Information Systems Austria
tel: +43 2236 27551-219, fax: +43 2236 21081
e-mail: michael.ulm@isis-papyrus.com
Visit our Website: www.isis-papyrus.com


Stefan Lang

4/25/2005 1:15:00 PM

0

On Sunday 24 April 2005 23:46, Andrew Walrond wrote:
> I need to fold the code so that I can get a handle on the overall
> structure; basically to tidy up and and move whole public methods into
> protected or private sections, that sort of thing.
>
> I've tried browsing the code in Kate (xemacs is my usual home) which
> supports folding of ruby code. But it's folding is very buggy and I seem to
> lose whole portions of a file into a fold without warning. I can't find any
> good folding solutions for xemacs. What about vim, or other open source
> editors (for linux)?
>
> Recommendations?
>
> Andrew Walrond

What version of Kate/KDE are you using?
If you can show me specific code snippets for which syntax highlighting or
code folding fails, I can probably correct them.

Stefan


Andrew Walrond

4/25/2005 3:18:00 PM

0

On Monday 25 April 2005 14:14, Stefan Lang wrote:
>
> What version of Kate/KDE are you using?
> If you can show me specific code snippets for which syntax highlighting or
> code folding fails, I can probably correct them.
>

2.3.2

I'll mail you the offending file off-list (because its too big for the ML, not
because its confidential)

Andrew


Joe Van Dyk

4/25/2005 4:51:00 PM

0

On 4/24/05, Thomas Kirchner <lists@halffull.org> wrote:
> * On Apr 25 6:46, Andrew Walrond (ruby-talk@ruby-lang.org) wrote:
> > What about vim, or other open source editors (for linux)?
> >
> > Recommendations?
>
> Vim is excellent at folding (along with pretty much everything else).
> You can fold by any number of methods, including indent, marker,
> expression, syntax, diff-style, or even manual... Give it a shot if
> you're not too die-hard with emacs.

Any online places that discuss vim folding? Or general vim tips, for
that matter?



kyu

4/25/2005 6:24:00 PM

0

Joe Van Dyk wrote:

>On 4/24/05, Thomas Kirchner <lists@halffull.org> wrote:
>
>
>>* On Apr 25 6:46, Andrew Walrond (ruby-talk@ruby-lang.org) wrote:
>>
>>
>>>What about vim, or other open source editors (for linux)?
>>>
>>>Recommendations?
>>>
>>>
>>Vim is excellent at folding (along with pretty much everything else).
>>You can fold by any number of methods, including indent, marker,
>>expression, syntax, diff-style, or even manual... Give it a shot if
>>you're not too die-hard with emacs.
>>
>>
>
>Any online places that discuss vim folding? Or general vim tips, for
>that matter?
>
>
>
>
Emacs can do this just as well
http://www.chrislott.org/geek/emacs/n2n_foldin...
(see the customizing folding mode section)