The Wayback Machine - https://web.archive.org/web/20201109035315/https://github.com/microsoft/python-language-server/issues/1970
Skip to content
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

Display argument documentation when hovering over it in a function call #1970

Open
mjbvz opened this issue Mar 24, 2020 · 3 comments
Open

Display argument documentation when hovering over it in a function call #1970

mjbvz opened this issue Mar 24, 2020 · 3 comments
Labels

Comments

@mjbvz
Copy link

@mjbvz mjbvz commented Mar 24, 2020

Environment data

  • VS Code version: 1.44.0-insider
  • Extension version (available under the Extensions sidebar): 2020.4.68586-dev
  • OS and version: MacOS 10.15.3
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): NA
  • Relevant/affected Python packages and their versions: NA
  • Relevant/affected Python-related VS Code extensions and their versions: NA
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info microsoft/vscode-python#3977): Language server
  • Value of the python.languageServer setting: Microsoft

Steps to reproduce:

  1. For the python file:
({'x': 1}).pop('x', d=)
  1. Hover over d

Expected behaviour

IntelliSense for this keyword argument is shown

Actual behaviour

No intellisense

Other example:

import argparse

argparse.ArgumentParser(description="") # hover over 'description'
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Mar 24, 2020
@MikhailArkhipov
Copy link
Member

@MikhailArkhipov MikhailArkhipov commented Apr 17, 2020

What is expected from the hover? Hovering over parameter may show type, but it depends. Are you expecting some documentation on the argument? I.e. fragment of the class docstring like

 - description -- A description of what the program does

?

@mjbvz
Copy link
Author

@mjbvz mjbvz commented Apr 17, 2020

Yes, I'd expect any documentation associated with the parameter to be displayed

@jakebailey
Copy link
Member

@jakebailey jakebailey commented Apr 17, 2020

Note that Python does not have any official specification for this (there are at least 3 popular forms I know off the top of my head). We currently don't do docstring "parsing", just a loose conversion from docstrings to valid markdown to make them better than just VS Code's plaintext mode (which wraps poorly when line breaks are involved, common for code examples).

Docstrings written in the standard library in particular are only written to be visible via the help() builtin function in a terminal, and conform to no single markup language (not even consistently across the standard library). Argparse's is unfortunately not one of the more well-known formats (sphinx/numpy/google/etc).

@MikhailArkhipov MikhailArkhipov changed the title No intellisense when hovering over keyword argument in function call Display argument documentation when hovering over it in a function call Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.