-
Notifications
You must be signed in to change notification settings - Fork 26
Introduction to Daffodil VS Code Extension
| Introduction to the Apache Daffodil Extension for Visual Studio Code |
![]() |
|
The Mission: Make Daffodil Coding & Debugging Easier The Command Line Interface with existing Daffodil debugging capability is non-intuitive and difficult to master |
![]() |
|
The Solution: Integrate Daffodil with VS Code
|
![]() |
The How:
|
![]() |
The Caveats:
|
|
Don’t worry if you’re new to IDE use and don’t know what any of this means. We’ll cover it in detail later.
|
IDE Basics Integrated Development Environment A single program that integrates all the steps of software development
|
![]() |
|
IDE Basics Integrated Development Environment A single program that integrates all the steps of software development
|
![]() |
|
IDE Basics Integrated Development Environment A single program that integrates all the steps of software development
|
![]() |
|
IDE Basics Integrated Development Environment A single program that integrates all the steps of software development
|
![]() |
|
IDE Basics Integrated Development Environment A single program that integrates all the steps of software development
|
![]() |
Install VS Code
|
Click Image for Download Page:
|
Installing the Daffodil Extension
|
![]() |
Installing the Daffodil Extension
|
![]() |
Installing the Daffodil Extension
|
![]() |
Installing the Daffodil Extension
|
![]() |
Installing the Daffodil Extension
|
![]() |
|
Configuring for First Use Create a working directory
Free sample schemas here |
This example uses a Daffdile logo saved as a PNG file
|
|
Configuring for First Use Open the working directory
|
![]() |
Note that if you wind up working on multiple DFDL projects in different folders, you will need to configure each folder with its own launch.json file
Another important issue to note when choosing working directories is that VSCode, like many IDEs, seems to not like projects that are on paths reachable via symlinks. Using symlinks in paths is highly likely to cause problems and thus should be avoided.
|
Configuring for First Use Configuring Launch.json file
|
![]() |
|
![]() |
Note that the debugger should run with the default settings. You may simply scroll down to the bottom of the configuration wizard and click the SAVE button, then close the wizard.
If you run into a problem, the most likely problem is that you have not yet opened a working folder/directory. If VS Code opens settings.json instead of launch.json make sure that you have created and opened the intended folder/directory. The second most likely culprit is a port conflict and you can simply reopen the configuration wizard and change the port settings and save the new configuration.
|
Configuring for First Use Launch Config Wizard
1. Enter a name for the new configuration |
![]() |
|
Configuring for First Use Launch Config Wizard |
|
|
Main Schema File/Input Data File The input files can be hard coded into the configuration by clicking the Browse button and navigating to the file and clicking on it |
![]() |
Leave the ${command:AskForSchemaName}/${command:AskForDataName} values and you will be prompted for the file names each time you execute a parse. This option can be useful if you will be testing with a variety of input files, rather than running the same files repeatedly
|
Configuring for First Use Launch Config Wizard |
|
|
Root Element For simple schemas, this field may be left set to undefined
|
![]() |
|
Configuring for First Use Launch Config Wizard |
|
Debugger Settings
|
![]() |
|
Configuring for First Use Launch Config Wizard |
|
Classpath
|
![]() |
|
Configuring for First Use Launch Config Wizard |
|
|
![]() |
| Debugging for the first time for Visual Studio Code | |
| Make sure you have open data editor on debug start checked in launch config wizard | ![]() |
|
Configuring for First Use Launch Config Wizard TDML Options |
|
|
![]() |
|
Configuring for First Use Launch Config Wizard Data Editor Configuration |
|
|
![]() |
|
Configuring for First Use Launch Config Wizard |
|
| Don't forget to save your configuration settings! If you have a problem saving your settings, verify that you have opened a valid working folder. |
![]() |
| Debugging for the first time for Visual Studio Code | |
| Click on play button to start a DFDL schema debugging session | ![]() |
| Debugging for the first time for Visual Studio Code | |
| You will see the data editor pop up! | ![]() |
| Generate TDML Temporary File | |
| In launch config wizard, set TDML action to generate, and save. Note: You can go back to previously set configs and edit them and save those changes |
![]() |
| Generate TDML Temporary File | |
| Run the corresponding DFDL debug extension from prior step. |
![]() |
| Generate Temporary TDML File | |
| Press the continue button to produce the infoset. |
![]() |
| Generate Temporary TDML File | |
| When the infoset generates, a temporary TDML schema will generate. |
![]() |
| Create TDML File | |
| Close all windows except the DFDL schema window. Click “Create TDML File” in the command view panel or "Daffodil Debug: Create TDML File" in the command palette. |
![]() |
| Create TDML File | |
| Enter a name for the TDML file, click “Save TDML File. Save the TDML in the current project folder, folder that's currently open in VS Code. |
![]() |
| Create TDML File | |
| Close the DFDL schema in the editor window. Click the explore tab to verify file is in project folder. |
![]() |
| Execute TDML File | |
| Open the TDML file. |
![]() |
| Execute TDML File | |
| After the TDML file opens, select the “Execute TDML” option from the dropdown, or “Execute TDML” in the command view panel, or "Daffodil Debug: Execute TDML" in the command palette. |
![]() |
| Execute TDML File | |
| Select the name of the test case to execute. |
![]() |
| Execute TDML File | |
| The DFDL schema and a new infoset will utilize the values from the TDML file. |
![]() |
Copyright © 2023 The Apache Software Foundation. Licensed under the Apache License, Version 2.0.
Apache, Apache Daffodil, Daffodil, and the Apache Daffodil logo are trademarks of The Apache Software Foundation.















This example uses a Daffdile logo saved as a PNG file
























