Skip to content

Intellisense docstrings do not follow functools.wraps() semantics #2596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
skilly-lily opened this issue Sep 15, 2018 · 3 comments
Closed

Intellisense docstrings do not follow functools.wraps() semantics #2596

skilly-lily opened this issue Sep 15, 2018 · 3 comments
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@skilly-lily
Copy link

Environment data

  • VS Code version: 1.27.2 (user setup)
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: Windows 10 Enterprise 1803 (64-bit)
  • Python version (& distribution if applicable, e.g. Anaconda): Official CPython 3.7.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): replicated with system-level interpreter & pipenv
  • Relevant/affected Python packages and their versions: N/A (problem is with core language and stdlib)

Actual behavior

The function docstrings shown in the intellisense popout (visible on hover) are showing docstrings which do not match those of the interpreter's inspect.getdoc() output.

Expected behavior

The function docstrings shown in the intellisense popout (visible on hover) should match the docstrings shown by the interpreter (output of inspect.getdoc() used as reference), even when there are decorators (sometimes multiple layers) covering them.

Steps to reproduce:

This issue is somewhat reproducible with jedi as the backing language server, but seems more consistent with then new language server.

  1. Hover over the function references on lines 38-39 of the included reproduction script:
    issue.py.txt

  2. Note that the docstrings shown are not the same as the output of inspect.getdoc()

I have included a gif of the reproduction (located at the end of this issue document) to show the kind of output I am getting.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.
Initializing for D:\Python37\python.exe

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

None

Gif

issue-replication

@skilly-lily
Copy link
Author

Opening a new issue after #210 was closed. I was asked to replicate the issue on the new language server before reopening, which I have done.

@d3r3kk d3r3kk added bug Issue identified by VS Code Team member as probable bug area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. needs verification labels Sep 15, 2018
@d3r3kk
Copy link

d3r3kk commented Sep 20, 2018

Verified that this behaviour is indeed happening in Windows 10 on the latest VSCode + extension + Language Server.

@brettcannon brettcannon changed the title Intellisense docstrings do not match interpreter Intellisense docstrings do not follow functools.wraps() semantics Sep 20, 2018
@skilly-lily
Copy link
Author

Fixed by microsoft/python-language-server#546

@ghost ghost removed the needs upstream fix label Jun 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants