Skip to content

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

Description

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 (View→Output, 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

Activity

  1. skilly-lily commented on Sep 15, 2018

    @skilly-lily
    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.

  2. d3r3kk commented on Sep 20, 2018

    @d3r3kk

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

  3. changed the title [-]Intellisense docstrings do not match interpreter[/-] [+]Intellisense docstrings do not follow functools.wraps() semantics[/+] on Sep 20, 2018
  4. skilly-lily commented on Jun 27, 2019

    @skilly-lily
    Author
  5. locked as resolved and limited conversation to collaborators on Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions