Skip to content

PRovide a way to actually enable the natvis diagnostics in VS Code #1432

Open

Description

@nikitalita

There doesnt seem to be any way to enable the diagnostic output if you're using this with VS Code; I have no idea how to debug natvis issues without this ability.

Activity

  1. WardenGnaw commented on Dec 21, 2023

    @WardenGnaw
    Member

    You should be able to enable natvis diagnostic in your launch.json.

    E.g.

    {
       "program": ...,
       "natvisDiagnostics": "verbose"
    }
    

    See https://github.com/microsoft/vscode-cpptools/blob/8d42c49b77aadb5ae4286f21efcd159601118805/Extension/package.json#L3730

  2. nikitalita commented on Dec 21, 2023

    @nikitalita
    ContributorAuthor

    Ah, it needs to be in the logging object, like this:

    {
       "program": ...,
       "logging": {
             "natvisDiagnostics": "verbose",
        },
    }
    
  3. nikitalita commented on Dec 21, 2023

    @nikitalita
    Author
  4. NValerij commented on Jan 15, 2024

    @NValerij

    Andrew Wang (@WardenGnaw) could you write, please, in what window logs should appear?

  5. SoloWingPixy2097 commented on Dec 3, 2026

    @SoloWingPixy2097

    NValerij It seems any output from the logging section is piped to VSCode's Debug Console window
    You can test this with:

                "logging": {
                    "trace": true,
                    "traceResponse": true,
                    "engineLogging": true,
                    "natvisDiagnostics": true,
                },
    

    Which does appear to log Natvis XML Schema errors:
    [Error] Error "There is an error in XML document (11, 9)." while reading file: /*path to file*/debug_views.natvis

    But actual natvis representation syntax errors do not seem to get logged, unfortunately :(

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions