Skip to content

Formatting Hints for requests that return displayable values #84

@richardstanton

Description

@richardstanton

Several protocol requests ask for displayable information, such as the name of a stack frame or the value of a variable. There is the possibility that the IDE would like to have the information displayed using an alternative format. For example it is very useful to see the value of a variable in hexadecimal. This proposal is to add a Format property to these requests. The format property will contain an object that may have additional properties specifying formatting hints.

Some formats are added to the protocol in this proposal that could be used by multiple IDEs. However as an object additional properties could be added.

/** Arguments for 'stackTrace' request. */
export interface StackTraceArguments {
  // ...
  /** Specifies details on how to format the stack frames. */
  format?: StackFrameFormat;
}
/** Arguments for 'variables' request. */
export interface VariablesArguments {
  // ...
  /** Specifies details on how to format the values. */
  format?: ValueFormat;
}
/** Arguments for 'evaluate' request. */
export interface EvaluateArguments {
  // …
  /** Specifies details on how to format the result. */
  format?: ValueFormat;
}
 
/** Provides formatting information for a value. */
export interface ValueFormat {
  /** Displays the value in hex. */
  hex?: boolean;
}
 
/** Provides formatting information for a stack frame. */
export interface StackFrameFormat extends ValueFormat {
  /** Displays parameters for the stack frame. */
  parameters?: boolean;
  /** Displays the types of parameters for the stack frame. */
  parameterTypes?: boolean;
  /** Displays the names of parameters for the stack frame. */
  parameterNames?: boolean;
  /** Displays the values of parameters for the stack frame. */
  parameterValues?: boolean;
  /** Displays the line number of the stack frame. */
  line?: boolean;
  /** Displays the module of the stack frame. */
  module?: boolean;
}

Proposed pull request: #82

@weinand
@jacdavis @gregg-miskelly @andrewcrawley @tzwlai

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions