Skip to content

IndexError in signature.py on textDocument/signatureHelp #459

@mike-hearn

Description

@mike-hearn

I'm using pyls via coc.nvim, and when it attempts to grab the signature of a class method, it's throwing an IndexError on this line:

'label': s.docstring().splitlines()[0],

It looks like in this case s.docstring() is somehow not returning a string, which causes splitlines() to not return an array, and [0] causes the error.

This was easy to mitigate by just catching that error and returning returning .splitlines() without the index, but I wanted to flag it here in case your team might have a better idea for why/when that wouldn't return an array, and what the right way to mitigate it is.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions