The code snippet below does it. The region for class A goes all the way to the next class/EOF (actually, 3 lines before EOF, unless there's whitespace on the third- or second-last lines), the region for funca goes from the def to the line 'def funcb(self):' inclusive and the region for funcb only includes the def and the pass (as expected).
Interestingly, two unbound functions (remove class, unindent) have the correct regions class A: def funca(self): if True: pass def funcb(self): pass On Tue, May 4, 2010 at 05:58, Dino Viehland <di...@microsoft.com> wrote: > Steve Dower wrote: >> > There were some bugs here and I thought we fixed them all. Can you >> > give a little more detail? >> >> It seems somewhat unpredictable. The outlining regions occasionally >> don't fully appear when either the start or the end of the region is >> not visible (maybe my functions are just too long...) and scrolling up >> and down causes many to disappear/reappear. Occasionally the following >> def is included with the previous function (seems to happen with more >> than one unindent at the end of the function) and # comments >> 'attached' to the following class/def are sometimes included in the >> previous region. (While I'm here, another 'nice-to-have' region would >> be top-level if blocks, eg. if __name__=='__main__':) > > I have a fix for the unpredictableness and scrolling - there were some > issues w/ checking to see if 2 spans intersect. I can also repro the > comments issue but it'll be tougher to fix (I need to update the > IronPython parser). And I even added support for top-level if blocks > being marked as collapsible regions. But I can't repro the functions > collapsing into each other and I thought I had mostly fixed that problem. > Can you send me a file that repros it? > > _______________________________________________ > Users mailing list > Users@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com