apache / daffodil-vscode

Apache Daffodilâ„¢ Extension for Visual Studio Code
https://daffodil.apache.org/
Apache License 2.0
11 stars 20 forks source link

Ensure xsd and dfdl.xsd files can register breakpoints #80

Open arosien opened 2 years ago

arosien commented 2 years ago

The extension registers itself as a debugger for xml files, but often schema files have extensions like .dfdl.xsd, and you can't then define breakpoints in those files. (If you manually change the file type to "xml" you can then add breakpoints.) The extension should register as a debugger for these additional file types to support debugging (via something in the extension manifest?).

arosien commented 2 years ago

breakpoints section?

"breakpoints": [
      {
        "language": "xml"
      }
    ],
mbeckerle commented 2 years ago

I need a workaround in v1.1.0 for this bug if possible.

Do I really have to rename files (which then requires me to update schemas which have include/import statements, or is there a setting I can set somewhere globally to VSCode?

By convention we use ".dfdl.xsd" but ".xsd" is also common. Multiple freely available example DFDL schemas like EDIFACT, IBM4690Tlog, etc. use ".xsd" as the file extension, and breakpoints won't work as a result.

I am trying to debug EDIFACT (on github) the launch.json is attached.

mbeckerle commented 2 years ago
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "dfdl",
            "request": "launch",
            "name": "INVOICE_1",
            "program": "${workspaceFolder}/src/main/resources/EDIFACT-SupplyChain-D03B/EDIFACT-SupplyChain-Messages-D.03B.xsd",
            "stopOnEntry": true,
            "data": "${workspaceFolder}/src/test/resources/EDIFACT-SupplyChain-D03B/TestData/INVOIC_D.03B_Interchange_with_UNA.txt",
            "infosetOutput": {
                "type": "file",
                "path": "/tmp/infoset.xml"
            },
            "debugServer": 4711,
            "openHexView": false,
            "openInfosetView": false,
            "openInfosetDiffView": false,
            "daffodilDebugClasspath": "${workspaceFolder}/src/main/resources:${workspaceFolder}/src/test/resources"

        }
    ]
}