Skip to content

support more flexible ValueFormat #197

Open

Description

Variables and Evaluate requests support an optional format field if the debug adapter can supportValueFormattingOptions. But the only option ValueFormat currently available is whether it's hex or not.

interface ValueFormat {
  /**
   * Display the value in hex.
   */
  hex?: boolean;
}

Our debugger backend (go delve) can offer more flexible formatting options (based on a go-specific formatting verbs users can provide, e.g., %v, %x, ... ) and I wish we could take advantage of it. What do you think about adding a free-form string 'format' field? I can imagine other language debug adapters may have their own, language-specific way of formatting their data types.

I looked into a way how java debugger support a variety of formatting options (custom command to switch the formatting + invalidated event), but I am afraid that disallows different formatting per value (I may be wrong here).

ps. Is VSCode utilizing value formatting options any where? I don't see a control knob that allows me to select hex format. I can file a separate issue in the other repo for that.

Activity

  1. ashgti commented on Mar 4, 2022

    @ashgti

    Could the ValueFormat potentially include say a mimeType?

    This could be helpful for variables that represent other things like an image, if you could hover over the image and see a preview of what it contains. The hex variable could just be the mime type application/octet-stream.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions