1

VS is code is now the most popular code editor and I love it.

When you hover your mouse over a function, it shows you the function signature and help doc string.

When you decorate a function, its help docstring changes to that of the wrapper's. ( to understand what I mean read this↗️ )

In python 3.4+ This is fixed by using functools.wrap as shown here.( Please read ⬅️ that to better understand my problem.) I am not writing because its well explained there.

But when I hover over the function in VS Code, it shows the docstring of the wrapper.

How can I make VS code show the docstring of the original function ?

aahnik
  • 1,661
  • 1
  • 11
  • 29
  • for that to happen it has to execute the program up to the point of the "main" routine. Not very likely. This is now done with code analysis and the knowledge of what a decorator is – rioV8 Sep 24 '20 at 22:50

1 Answers1

1

VS Code (newer pylance server ) has become smart and it now does the correct thing! by default.

aahnik
  • 1,661
  • 1
  • 11
  • 29