12

Recently the ms-python extension (v2020.5.86806) for vscode implements grouping of variables in the debug console/variable explorer.

They appear as:

<object>
  > special variables
  > function variables

Is there a way to disable this behavior?

EDIT: Screenshot added: enter image description here

0

1 Answer 1

15

There's no single flag to revert to old behavior, but you can fine-tune it on a per-group basis in your launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ...,
            "module": ...,
            ...
            "variablePresentation": {
                "all": "inline",
                "class": "group",
                "function": "hide",
                "protected": ...,
                "special": ...
            }
        }
    ]
}

"all" applies to all groups, and sets the default that can be overridden as needed; other group names are self-explanatory. For values, "group" is the default behavior, "hide" removes those variables entirely, and "inline" places them without grouping.

Note that the VSCode JSON schema hasn't been updated to reflect this yet, so you'll get squiggles when editing. It'll still work, though.

Sign up to request clarification or add additional context in comments.

7 Comments

You might draw some attention to launch.json as people might try to configure this in settings.json.
Where exactly in the launch.json this goes? I added it to configurations, and it says Property variablePresentation is not allowed..
@Ashark: in the top level, so next to version and configurations, etc.
@Ashark it also says Property variablePresentation is not allowed for me but just do it anyway. It works
@Ashark top level did not work for me, I had to put it in the "configurations" list, at the same level as "name" and "module" as shown in the screenshot answered by @pavel-minaev
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.