iarsystems / iar-vsc-debug

Visual Studio Code extension for the IAR C-SPY debugger
19 stars 1 forks source link

Watch window variable value edit inconsitency #23

Closed davidanderle closed 1 year ago

davidanderle commented 1 year ago

Hello, I've been having a play around with the watch window in VSCode and I've spotted 2 issues:

  1. Although the "Set value" functionality is shown, the last element of an array in the watch window cannot be modified. When you set the element's new value, it simply doesn't update. As a workaround you can update the value in the local/static variables window without an issue.
  2. A scalar variable's value cannot be modified in the watch window, only under the local/static variables window.

Here's a quick demonstration: https://github.com/IARSystems/iar-vsc-debug/assets/17354704/d3d09663-6a80-4632-aeb9-58f59eb05cf8

As a side-note, is there a way to colour numbers with an apostrophe in their digits the same colour as ones without? For example, in the demonstration video above you can see that 999 is green, while 1'000 is grey. This apostrophe number interpretation of C-SPY is extremely useful so I would use this feature over the colour mismatch at any point :)

HampusAdolfsson commented 1 year ago

Hi,

I will look into the issues you found. Regarding the colouring of values in the watch (and variables) window, VS Code automatically classifies the values into different types depending only on the value, and uses this to determine the color. Numbers with apostrophes are classified as generic 'values', not 'numbers'.

A workaround is to override the colors used by VS Code, by placing this in your settings:

    "workbench.colorCustomizations": {
        "debugTokenExpression.number": "#cccccc99",
    }

or

    "workbench.colorCustomizations": {
        "debugTokenExpression.value": "#b5cea8",
    }
davidanderle commented 1 year ago

Hi, Thanks for looking into it! The colour customisation settings worked but as expected structs and arrays are now also coloured green: image This still gives a more coherent look to me so I'll set this for my setup.

HampusAdolfsson commented 1 year ago

Thanks for reporting this, fixes for both issues will be available in the next release.

davidanderle commented 1 year ago

@HampusAdolfsson, thank you, this was very quick! Any idea on the rough release date of this update?

HampusAdolfsson commented 1 year ago

Yes, probably some time in June.