Skip to content

Better error ranges for classes and functions #5466

Closed
@cdce8p

Description

@cdce8p

The error ranges for Class and Function nodes should be improved. At the moment they span the whole length of the corresponding block which isn't ideal, especially once error range support in VSCode is added.

Ideally, those should only highlight the actual class or function name.

def func2():
    return

class SomeCls:
    def __init__(self):
        """"""
        pass


def some_decorator_function():
    """some docstring"""

class invalid_class_name:
    pass

@some_decorator_function()
def invalidFunctionName():
    pass

Screen Shot 2021-12-03 at 19 14 28

Screen Shot 2021-12-03 at 19 17 01

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions