microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.3k stars 292 forks source link

Debugging: Show function return values in Run and Debug panel, Variables section #15959

Open lukaszkadlubowski opened 3 months ago

lukaszkadlubowski commented 3 months ago

VSCode supports launch.json files, where I can set "showReturnValue": true to see function return values when stepping through the functions while debugging. It works fine with regular python files. It seems however that launch.json is not used when debugging Jupyter Notebooks. It would be really helpful if this feature was supported.

This is how it works for regular Python files (and seemingly does not work when debugging Jupyter notebooks):

debug-return-value
def function1(a):
    return a + 1

def function2(a):
    return a + 2

print(f"Result is: {function1(function2(function1(function2(4))))}")