Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Tooltip shows setter docstring instead of GETTER docstring #2142

Closed
gsutra opened this issue Feb 18, 2021 · 2 comments
Closed

Tooltip shows setter docstring instead of GETTER docstring #2142

gsutra opened this issue Feb 18, 2021 · 2 comments

Comments

@gsutra
Copy link

gsutra commented Feb 18, 2021

Environment data

  • VS Code version: 1.52.1
  • Extension version (available under the Extensions sidebar): v2021.2.576481509
  • OS and version: CentOS7
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.8
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): none
  • Relevant/affected Python packages and their versions: none
  • Relevant/affected Python-related VS Code extensions and their versions: none
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

When mouse is over a property, tooltip should display the docstring of the property's GETTER.

Actual behaviour

Tooltip show the property's SETTER.

Steps to reproduce:

  1. Write basic class with property name
class Person:
    """ Represents a person. """

    def __init__(self, name=''):
        self.name = name

    @property
    def name(self) -> str:
        """ GETTER. """
        return self._name

    @name.setter
    def name(self, value: str) -> None:
        """ SETTER. """
        self._name: str = value


if __name__ == '__main__':
    p1 = Person(name='john')
    p1.name
  1. Mouse over the property name.
    issue

Logs

NA

@karthiknadig
Copy link
Member

Thanks for your feedback! We have recently released a new and more performant language server called Pylance which likely solves these issues you are reporting.  You can download Pylance from the marketplace and install it alongside the core Python extension. Because our team's development efforts have shifted to support the new language server, we'd encourage you to try it out.

In the meantime, I'll transfer this issue over to the Microsoft Python Language Server repo for tracking. If you try out Pylance and this issue persists, you can open an issue on the pylance-release repo.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Feb 18, 2021
@gsutra
Copy link
Author

gsutra commented Feb 19, 2021

Indeed, Pylance fixes this issue. Thank you.

@gsutra gsutra closed this as completed Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants