Sometime ago, I remember that when I was hovering over a declared variable in a python script (not in debug mode), I could see its value. That was very handy, as (I) I could see the value of the variable right away and (II) I could copy the value if necessary.
I regularly update VS code as well as the python extension, so my suspicion is that this default behaviour changed in any of the updates.
I have tried a few things as listed below, but nothing helped. When I hover over a variable (e.g. reads = ['R1', 'R2']
, I see (variable) reads: list[str]
whereas in the past I could see the list with its values i.e. R1
and R2
python.analysis.inlayHints.variableTypes
)python.analysis.typeCheckingMode
: from basic
to strict
How can I re-enable that feature inside a python script in VSCode?
Sometime ago, I remember that when I was hovering over a declared variable in a python script (not in debug mode), I could see its value. That was very handy, as (I) I could see the value of the variable right away and (II) I could copy the value if necessary.
I regularly update VS code as well as the python extension, so my suspicion is that this default behaviour changed in any of the updates.
I have tried a few things as listed below, but nothing helped. When I hover over a variable (e.g. reads = ['R1', 'R2']
, I see (variable) reads: list[str]
whereas in the past I could see the list with its values i.e. R1
and R2
python.analysis.inlayHints.variableTypes
)python.analysis.typeCheckingMode
: from basic
to strict
How can I re-enable that feature inside a python script in VSCode?
If you set a breakpoint and run in debug mode you get that when you hover on a variable the value is shown.
If you are in the editor the variable name and type is shown.
Since you mentioned copying values. It is an option available in debug mode.
Is this what you have seen in the past?
sudo apt update
andsudo apt upgrade
. Some old libraries were removed, but no newer version of VS code was installed. Can this be an explanation? – BCArg Commented Feb 4 at 9:07