Closed macintacos closed 1 week ago
The bar
parameter on Foo.__init__
and the Foo.bar
instance attribute are technically two different things, but I can see that in many cases you'd want them to both have the same docstring.
Moving this issue to discussions as an enhancement request for comments and upvotes.
When hovering over a class attribute, it would be great if it showed documentation for that attribute, similar to how documentation hover works for parameters within a method.
Here's an example (using the syntax resolved in #3347 - I'm currently using the pre-release version of Pylance,
v2024.6.100 (pre-release)
):Here's what I see when I hover my mouse over
bar
in the lastprint(test.bar)
line:And here's what I see when I hover my mouse over
thing
inFood.some_method
:I know that Pylance is "aware" of these parameters and their documentation, because it does get shown to me as I type:
As such, it would be great if that same documentation bits for class attributes could be shown in the hover window like parameters' documentation is shown for methods.