Closed Denperidge closed 8 months ago
Hi @Denperidge, would you mind trying this with the v3.b0 release? I’ve rewritten the type annotations for operations and have tested it working in VSCode.
Sorry for the late reply @Fizzadar , but here to confirm that it is fixed in v3.b0! Thank you very much!
Describe the bug
On VSCode, you cannot view the docstrings for operations (e.g. server.user() and the like). This seems to be because of the
@operation
wrapperTo Reproduce
from pyinfra.operations import server
)server.user(
)Alternatively, you can add
from pyinfra.api import operation
and test this out on a local function. As seen below, the docstrings get jambled up as soon as the@operation
decorator is used.Expected behavior
The docstrings displaying! This is the output when copying the
server.user
function, but don't add the decorator! A VSCode screenshot of a function descriptor. server.user got copied without the@operation
hovered over. Docstrings are displayed as expected, and the keywords are visiblePossible solution?
In terms of Python3, I was only able to find this bug thread in the sphinx repository: https://github.com/sphinx-doc/sphinx/issues/3783 . It describes multiple potential solutions (e.g. functools.wrap, or custom wrapping thing)
Meta
Include output of
pyinfra --support
.-vv
and--debug
. N/A