Skip to content

Data type in debugger watch list hides variable value #2569

Open
@ardnew

Description

code-watch-values
Issue Type: Bug

When halting any Go program under debugger dlv, the Variables and Watch panes in the Run and Debug panel show variables using their full, absolute type preceding its current value. With many nested packages, it makes values hard to see without expanding each individually.

You can see in the attached screenshot that the entire Variables list is useless – it redundantly shows only the path prefix for local types defined in the current package being debugged.

Is there any way to define the formatting for the watch/local variables? Or is there a way to modify how it shows the type?
For example, the language server gopls has a configuration option that narrows type paths:

  "gopls": {
    "formatting.local": "github.com/ardnew"
	// Project-specific settings.json can narrow the scope further, e.g.:
    //"formatting.local": "github.com/ardnew/bases"
  }

If the debugger can refer to that, great; otherwise, could a similar option in the Go extension's settings be added to copy this behavior?

Extension version: 0.36.0
VS Code version: Code 1.67.1 (Universal) (da15b6fd3ef856477bf6f4fb29ba1b7af717770d, 2022-05-06T12:37:16.526Z)
OS version: Darwin x64 21.6.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.77GB free)
Process Argv . --crash-reporter-id d1db2c30-84ae-4a50-be0a-79d992e054e5
Screen Reader no
VM 0%

Activity

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

Metadata

Assignees

No one assigned

    Labels

    DebugIssues related to the debugging functionality of the extension.debug/variablesissues related to variables inspection/presentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions