Bug 374570 - Folding incorrect for python function with multiline arguments
Summary: Folding incorrect for python function with multiline arguments
Status: CONFIRMED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 423921 463012 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-05 01:02 UTC by stevemcqueen
Modified: 2024-09-22 18:37 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stevemcqueen 2017-01-05 01:02:31 UTC
Code folding does not work as expected for python functions where the arguments span multiple lines. It only collapses the arguments themselves (which can be useful) but not the entire function (which is not useful).

Example:

def test1(foo, bar, baz):
    """folds entire function correctly"""
    print foo

def test2(foo,
          bar,
          baz):
    """only folds the arguments"""
    print foo

def test2(
        foo,
        bar,
        baz):
    """only folds the arguments"""
    print foo

class Foo(object):
    def test1(self, foo, bar):
        """folds correctly"""
        print foo
    
    def test2(self,
              foo,
              bar):
        """only folds arguments"""
        print foo



Version info:
OS: KDE Neon
Kate: 16.12
KDE Frameworks: 5.29
Qt: 5.7.0
Comment 1 Justin Zobel 2020-10-27 02:08:55 UTC
Can confirm this on Kate 20.11.70
Comment 2 George Diamantopoulos 2021-01-28 04:02:55 UTC
Still present on Kate 20.12.1
Comment 3 Christoph Cullmann 2024-03-15 20:00:02 UTC
*** Bug 463012 has been marked as a duplicate of this bug. ***
Comment 4 Christoph Cullmann 2024-09-13 20:18:53 UTC
Ok, the issue seems that we try to fold the (), that doesn't match well with the indentation concept.
Comment 5 Christoph Cullmann 2024-09-22 18:37:33 UTC
*** Bug 423921 has been marked as a duplicate of this bug. ***