vscode-java-debug
vscode-java-debug copied to clipboard
Mark function return value as readOnly
When stepping out of a function the return value is helpfully displayed like a variable: ->equals(): false
But when trying to edit it (for lack of #1320) I'm getting

Environment
- Operating System: Win11
- JDK version: GraalVM 22.3 JDK17
- Visual Studio Code version: 1.77.2
- Java extension version: v1.16.0
- Java Debugger extension version: v0.49.1
Editing the return value is not a supported scenario. The return value is a placeholder variable that's read-only.
Ok, but possibly an attribute is missing so VSCode doesn't even let you try to modify it. I don't quite remember if readOnly did the trick: https://microsoft.github.io/debug-adapter-protocol/specification#Types_VariablePresentationHint
Also would it be technically possible to implement this with the java debug API? Then it could be turned into a feature request.
Ok, but possibly an attribute is missing so VSCode doesn't even let you try to modify it. I don't quite remember if readOnly did the trick: https://microsoft.github.io/debug-adapter-protocol/specification#Types_VariablePresentationHint
This is a good finding that we can adopt it to show the return value placeholder as readOnly.
Also would it be technically possible to implement this with the java debug API? Then it could be turned into a feature request.
Pls remember the return value in Variables view is not a real local variable in current call stack. It's captured by debugger when stepping out the previous stack frame. It does not have a variable name. The name -> equals() you see in the Variables view is a placeholder name we created for readability.
Yeah I don't know how Java handles it. In native code it's conceivable to modify the return value. I think VS offers that functionality.