Menu

#571 Block start/stop incorrectly identified in Ruby programs

v1.23
closed-fixed
Filetypes (68)
5
2012-10-25
2010-10-24
No

Geany version 0.18 "Kaine" on Ubuntu 10.04 (lucid)

See the attached file for an example Ruby program consisting of one class and three subroutines ("initialize", "run" and "terminate").

1. Load the example Ruby program into Geany.
2. Notice immediately how, in the Symbols window, the subroutines are not correctly lined up.
3. Collapse the second subroutine ("run") using the boxed minus sign on the left of the line reading "def run".
4. Notice how this collapses not just subroutine "run" but also subroutine "terminate" as well.
5. I have a much larger program consisting of several classes and dozens of subroutines in which this behaviour is amplified.

Discussion

  • Lex Trotman

    Lex Trotman - 2012-09-13
    • status: open --> pending
     
  • Lex Trotman

    Lex Trotman - 2012-09-13

    No attachment provided, will close if none provided in a couple of weeks.

     
  • Bob Bevan-Jones

    Bob Bevan-Jones - 2012-09-13

    Example code for ID: 3094431

     
  • Bob Bevan-Jones

    Bob Bevan-Jones - 2012-09-13

    Recently retested with Geany 0.20 ("Disra") on Linux Mint running kernel 3.0.0-12-generic. Same outcome.

     
  • Bob Bevan-Jones

    Bob Bevan-Jones - 2012-09-13
    • status: pending --> open
     
  • Lex Trotman

    Lex Trotman - 2012-09-13

    Bug still happens on Geany 1.23 (git >= c05f1bd).

     
  • Lex Trotman

    Lex Trotman - 2012-09-13
    • status: open --> open-accepted
     
  • Colomban Wendling

    OK, I see the problem. Weirdly not only the folding is buggy but the tags hierarchy is wrong too, seeing "terminate" as a child of "run"; although those two things are done by completely different means.

    Apparently both parsers get fooled by the "for x in [...] do": they open a scope on the "for" AND on the "do". Using the syntax "[...].each do |x|" don't fool the parsers though (and seems more standard as far as I can read the internets).

     
  • Colomban Wendling

    • assigned_to: nobody --> colombanw
     
  • Colomban Wendling

    • labels: 790033 -->
     
  • Colomban Wendling

    Now fixed in Git, thanks for reporting.

     
  • Colomban Wendling

    • milestone: --> v1.23
    • labels: --> Filetypes
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.