python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

Class Parameter Hints do not show up when inheriting from NamedTuple

Open sbland opened this issue 4 years ago • 4 comments

Class parameter hints should show above docstring on intellisense when using typing.NamedTuple

Environment data

  • VS Code version: 1.45.0
  • Extension version 2020.4.76186
  • OS and version: Ubuntu 18.04.4 LTS
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.9
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info microsoft/vscode-python#3977): Jedi Enabled
  • Value of the python.languageServer setting: Microsof

Example

from typing import NamedTuple

class Config_Shape(NamedTuple):
    x: int
    y: int

Intellisense now shows the parameters for NamedTuple rather than Config_Shape. I.e. typename: str, fields: Iter..

sbland avatar May 12 '20 10:05 sbland

👍 this is a big nuisance

jlxgcgcg avatar Jun 15 '20 23:06 jlxgcgcg

btw, it seems like pylance fixes this

joelgrus avatar Jul 01 '20 03:07 joelgrus

Yep (along with many other things 🙂).

https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

jakebailey avatar Jul 01 '20 03:07 jakebailey

I'm also having this issue.

I don't think it's just a lack of a feature though? Because it was initially brought up in #15, then I believe added in #339? Or am I misunderstanding that?

levihb avatar Sep 06 '20 18:09 levihb