admin管理员组文章数量:1315354
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
- My language sever is Pylance
- I have enabled hover tooltips (setting is
python.analysis.inlayHints.variableTypes
) - I have played around with
python.analysis.typeCheckingMode
: frombasic
tostrict
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
- My language sever is Pylance
- I have enabled hover tooltips (setting is
python.analysis.inlayHints.variableTypes
) - I have played around with
python.analysis.typeCheckingMode
: frombasic
tostrict
How can I re-enable that feature inside a python script in VSCode?
Share Improve this question edited Jan 31 at 8:25 BCArg asked Jan 30 at 9:38 BCArgBCArg 2,2502 gold badges24 silver badges39 bronze badges 2 |2 Answers
Reset to default -1If 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?
本文标签: pythonVS code no longer displays value of variable when mousehovering itStack Overflow
版权声明:本文标题:python - VS code no longer displays value of variable when mouse-hovering it - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741975405a2408091.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
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