Skip to content

[Feature Request] Detail Formatters for custom object display in Variables view #1655

Description

@SougandhS

Eclipse JDT Debug lets you define a "Detail Formatter" per type — a small expression (e.g. getName() + ": " + getId()) that's evaluated against instances of that type and shown in the Variables view, Expressions view, and on hover. It's saved per type and applies automatically across debug sessions, without editing code. IntelliJ IDEA has the same capability under "Type Renderers", so this is a common expectation for anyone moving between Java IDEs.

VS Code doesn't have this today. #236 requests it and is still open; the only workaround suggested there is typing the expression manually in the Watch panel each time, which doesn't persist and has to be redone per object/session.

Benefits: saves repeated manual Watch-panel entries for the same type across sessions, makes deeply nested or verbose objects (entities, DTOs, wrapper types) readable at a glance in Variables/hover, and closes a well-known parity gap for developers coming from Eclipse or IntelliJ.

java-debug already uses Eclipse's ASTEvaluationEngine (along with JDIThread/JDIStackFrame) for expression/watch evaluation, so the engine that evaluates an arbitrary snippet against a suspended object is already in place and can be further reused here. Eclipse's own formatter resolution logic in JavaDetailFormattersManager — can also be reused (some parts maybe), matching a formatter by walking up a type's superclass/interface hierarchy rather than requiring an exact type match, and caching the compiled expression per type per session instead of recompiling on every render.

Related to eclipse-jdtls/eclipse.jdt.ls#3834

Activity

  1. github-actions commented on Jul 17, 2026

    @github-actions

    Hi Sougandh S (@SougandhS), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    This is a feature request to add per-type detail formatters (like Eclipse’s “Detail Formatter” or IntelliJ’s “Type Renderers”) in VS Code’s Java debugger. There’s no built-in solution yet, but you can:

    Please add your scenarios or snippets to those threads to help prioritize this enhancement.

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

  2. SougandhS commented on Jul 22, 2026

    @SougandhS
    Author
  3. chagong commented on Jul 23, 2026

    @chagong
    Contributor

    Sougandh S (@SougandhS) this is a duplicate of #236 , there were some discussion. Can you post your implementation suggestion there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions