Skip to content

feat: Use sphinx field-level documentation for hover #372

@WhyNotHugo

Description

@WhyNotHugo

Given this simple type

class Human:
    #: This person's date of birth
    dob: datetime

And this code:

h = human
h.dob

When fetching the "hover" information (e.g.: textDocument/hover, vim.lsp.buf.hover() on neovim) with the cursor on dob this shows the documentation for the type (e.g.: datetime) in this case.

I think that it would be very useful to show the documentation right above the field, instead of the documentation for type type. This particular format is used by sphinx, so a lot of code-bases (e.g.: Django) use this to document fields. In most contexts, the docs for the field are far more relevant/useful that the docs for the type.

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