[Python] VS code no longer displays value of variable when mouse-hovering it

Discussão em 'Python' iniciado por Stack, Janeiro 30, 2025.

  1. Stack

    Stack Membro Participativo

    Sometime ago, I remember that when I was hovering over a declared variable in a python script, 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

    1. My language sever is Pylance
    2. I have enabled hover tooltips (setting is python.analysis.inlayHints.variableTypes)
    3. I have played around with python.analysis.typeCheckingMode: from basic to strict

    How can I re-enable that feature inside a python script in VSCode?

    Continue reading...

Compartilhe esta Página