Skip to content

Add an optional source and line+column range for a Variable #343

@gfszr

Description

@gfszr

A Scope structures contain optional fields describing the source range in which the scope lies in - this is useful for presenting various per-frame/per-scope information overlaying over source code. This request proposes the same for Variable stuctures as well to describe the location where the variable is defined:

{
  /**
   * The source for this variable's definition. 
   */
  source?: Source;

  /**
   * The start line of the range where the variable is defined. 
   */
  line?: number;

  /**
   * Start position of the range where the variable is defined. It is measured in UTF-16
   * code units and the client capability `columnsStartAt1` determines whether
   * it is 0- or 1-based.
   */
  column?: number;

  /**
   * The end line of the range where this variable is defined. 
   */
  endLine?: number;

  /**
   * End position of the range where this variable is defined. It is measured in UTF-16
   * code units and the client capability `columnsStartAt1` determines whether
   * it is 0- or 1-based.
   */
  endColumn?: number
}

Using the above optional information for a variable, a UI can, for instance, overlay its value next to its definition, similar to IntelliJ IDEs' Inline Debugger feature:

image

Metadata

Metadata

Labels

feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions