shanedell opened a new pull request, #935:
URL: https://github.com/apache/daffodil-vscode/pull/935
Added settings for root element name and namespace
- Created setting "rootName" for specifing the root element's name.
- Created setting "rootNamespace" for specifing the root element's namespace.
- Tied both the settings "rootName" and "rootNamespace" into the extension
and the debugger.
Closes #653
## Test Instructions
### Prepare schemas
To be able to test this PR you will need to test it with the
envelope-payload. This requires cloning and building a couple different DFDL
Schemas. Below are the commands needed to run locally to get the schemas
prepared before we start testing the debugging of the schema.
```bash
for schema in $(echo "ethernetIP PCAP tcpMessage mil-std-2045
envelope-payload"); do
git clone https://github.com/DFDLSchemas/$schema.git dfdl-$schema
cd dfdl-$schema
sbt compile
sbt publishLocal
cd ../
done
```
### Debugging envelope-payload
Now that you have built and prepared the needed schemas we can test the
debugger. You will run the debugger locally like you normally do, make when the
extension launches it is opening the parent directory that you cloned all the
schemas to. Once you have the directory with all the schemas opened you will
need to make `.vscode/launch.json`, if it doesn't exist already, with this
inside of it:
```json
{
"version": "0.2.0",
"configurations": [
{
"type": "dfdl",
"request": "launch",
"name": "Envelope Payload",
"rootName": "message",
"schema":
"${workspaceFolder}/dfdl-envelope-payload/src/main/resources/io/github/dfdlschemas/envelopepayload/xsd/envelopePayload.dfdl.xsd",
"stopOnEntry": true,
"data":
"${workspaceFolder}/dfdl-envelope-payload/src/test/resources/io/github/dfdlschemas/envelopepayload/test_01.dat",
"infosetFormat": "xml",
"infosetOutput": {
"type": "file",
"path": "${workspaceFolder}/infoset.xml"
},
"debugServer": 4711,
"openDataEditor": false,
"openInfosetView": false,
"openInfosetDiffView": false,
"daffodilDebugClasspath":
"${workspaceFolder}/dfdl-mil-std-2045/src/main/resources:${workspaceFolder}/dfdl-mil-std-2045/target/classes:${workspaceFolder}/dfdl-tcpMessage/src/main/resources:${workspaceFolder}/dfdl-tcpMessage/target/classes:${workspaceFolder}/dfdl-PCAP/src/main/resources:${workspaceFolder}/dfdl-PCAP/target/classes:${workspaceFolder}/dfdl-envelope-payload/src/main/resources:${workspaceFolder}/dfdl-envelope-payload/target/classes:${workspaceFolder}/dfdl-ethernetIP/src/main/resources:${workspaceFolder}/dfdl-ethernetIP/target/classes",
"variables": {},
"tunables": {},
"dataEditor": {
"port": 9000,
"logFile":
"${workspaceFolder}/dataEditor-${omegaEditPort}.log",
"logLevel": "info"
}
}
]
}
```
If you already have a `.vscode/launch.json` at the same level as the schemas
you cloned you can just copy the specific configuration. To be specific you
will copy from and including opened curly brace (`{`) right after the opened
square brace (`[`) to and including the closing curly brace (`}`) before the
closing square brace (`]`). Now you want to go to the debug section and select
the `Envelope Payload` launch configuration and hit the play button. The
debugger should run without at problems and stop you right at in the
`dfdl-tcpMessage/src/main/resources/io/github/dfdlschemas/tcpMessage/xsd/tcpMessage.dfdl.xsd`
file. This shown in the screenshot below, after clicking continue the debugger
should finish running and write the infoset.

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]