Vscode-java-debug: Define custom "toString()" in variables view

Created on 9 Feb 2018  路  3Comments  路  Source: microsoft/vscode-java-debug

Eclipse has a functioality to setup a custom "toString" method (called "Detail Formatter") on each type in the variables view. This is handy when you have objects that don't come with a nice toSring method. It allows you to directly show the useful information.
Example details formatter: getName() + ": " + getBirthDate()

Environment
  • Operating System: macOS 10.12.6 (16G1212)
  • JDK version: 1.8.0_144-b01
  • Visual Studio Code version: 1.20.0 (1.20.0)
  • Java extension version: 0.18.1
  • Java Debugger extension version:0.6.0

detailformatter

enhancement feature request voting

Most helpful comment

something like this would be amazing: natvis

All 3 comments

@mojo2012 thank you for reporting this issue. Now the debugger supports expression evaluation. So if you type the body of the formatter in Watch panel, it will evaluate. Can it address the issue?

That's not the same actually. The "detail formatter" feature is persistent across debug sessions. The expression view can be deleted at any point, losing the "body". Futhermore it would kinda "duplicate" the variable.

something like this would be amazing: natvis

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivenxu picture ivenxu  路  8Comments

James-Oswald picture James-Oswald  路  3Comments

bsaby picture bsaby  路  8Comments

PG-practice picture PG-practice  路  3Comments

gcbartlett picture gcbartlett  路  3Comments