You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by Roger L Costello <co...@mitre.org> on 2024/07/09 13:08:37 UTC
My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don't see any way to select "mode".
[cid:image001.png@01DAD1DF.934DE9C0]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn't set the "mode" in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image002.png@01DAD1DF.934DE9C0]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a "launch configuration". Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There's a problem with the instructions:
[cid:image003.png@01DAD1DF.934DE9C0]
10. Unfortunately, the instructions are for creating a "launch configuration" for debugging. I don't want to debug, I just want to run my DFDL Schema.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image004.png@01DAD1DF.934DE9C0]
12. I selected Run >> Run Without Debugging and got this error box:
[cid:image005.png@01DAD1DF.934DE9C0]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image006.png@01DAD1DF.934DE9C0]
I changed all the backslashes to forward slashes. Now I don't get errors. Do I need file:// before C?
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I'm stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Larry Barber <la...@nteligen.com>.
Hi Roger,
I was wondering if you had any updates after reading through Regis' responses to your issues.
From: Regis Thomas <re...@nteligen.com>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don't see any way to select "mode".
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image001.png@01DAD452.F4670550]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn't set the "mode" in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image002.png@01DAD452.F4670550]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a "launch configuration". Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There's a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don't have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image003.png@01DAD452.F4670550]
10. Unfortunately, the instructions are for creating a "launch configuration" for debugging. I don't want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image004.png@01DAD452.F4670550]
12. I selected Run >> Run Without Debugging and got this error box:
I don't know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image005.png@01DAD452.F4670550]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image006.png@01DAD452.F4670550]
I changed all the backslashes to forward slashes. Now I don't get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn't matter, but I'm not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I'm stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Larry Barber <la...@nteligen.com>.
Hi Roger,
The issue with the infoset not opening with the button in the pop-up was corrected and is included in the 1.4.0 release.
The first release candidate was downvoted, but if you want to try using it, you should see the infoset open when clicking the button:
[cid:image001.png@01DAE7ED.2D480150]
You can find the vsix file to install here: dist - Revision 70726: /dev/daffodil/daffodil-vscode/1.4.0-rc1/bin (apache.org)<https://dist.apache.org/repos/dist/dev/daffodil/daffodil-vscode/1.4.0-rc1/bin/>
From: Roger L Costello <co...@mitre.org>
Sent: Tuesday, August 6, 2024 9:04 AM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
August 6, 2024
1. I’d like to pick up where I left off last time, i.e., I don’t want to have to recreate launch.json. We will see …
2. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
3. It appears that I still have launch.json and all the stuff from my last use:
[Graphical user interface Description automatically generated]
4. I will rerun the debugger on my schema and input: Run >> Start Debugging
5. A window popped up for a short period of time, indicating a way to open the output file:
[cid:image003.png@01DAE7ED.2D480150]
6. No output is displayed. I clicked on the Terminal menu. It has lots of unintelligible stuff. I can pick out one message, something about missing a logback-test.xml file. No idea what that is or why I should be concerned with it. Maybe the launch.json file has a logback-test property, let me check … nope, no logback or logback-test property. Below is the complete contents of the Terminal window.
7. Let me see if Run >> Run Without Debugger will generate the output file. Nope. No output.
8. The DFDL schema that I have been testing is old. Let me test a more recent schema.
9. Hmm, how do I close the old stuff? Ah, File >> Close Window seems to do the job.
10. I clicked on the [cid:image004.png@01DAE7ED.2D480150] icon in the top left-hand corner. That opened a panel. In that panel is an “Open Folder” button, which I clicked on. That resulted in a window opening prompting me to select the folder that has my DFDL schema and input file. I selected the folder. A window titled “Do you trust the authors of the files in this folder?” appeared. I clicked on “Yes, I trust the authors” button.
11. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. This opened a Launch Config Wizard tab. I filled in the configuration and hit Save.
12. I selected Run >> Start Debugging. Eek! I get this error message:
[cid:image005.png@01DAE7ED.2D480150]
13. I am stuck. No idea how to proceed.
> set DAFFODIL_DEBUG_CLASSPATH=
PS C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message> set DAFFODIL_DEBUG_LOG_LEVEL=INFO
PS C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message> set DAFFODIL_DEBUG_LOG_FILE=/tmp/daffodil-debugger.log
PS C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message> set JAVA_HOME=C:\java
PS C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message> c:\Users\costello\.vscode\extensions\asf.apache-daffodil-vscode-1.3.1\daffodil-debugger-3.5.0-1.3.1\bin\daffodil-debugger.bat --listenPort 4711
08:03:35,075 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
08:03:35,075 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/costello/.vscode/extensions/asf.apache-daffodil-vscode-1.3.1/daffodil-debugger-3.5.0-1.3.1/lib/org.apache.daffodil.daffodil-debugger-1.3.1.jar!/logback.xml]
08:03:35,075 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@6b8d96d9<ma...@6b8d96d9> - URL [jar:file:/C:/Users/costello/.vscode/extensions/asf.apache-daffodil-vscode-1.3.1/daffodil-debugger-3.5.0-1.3.1/lib/org.apache.daffodil.daffodil-debugger-1.3.1.jar!/logback.xml] is not of type file
08:03:35,141 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
08:03:35,141 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
08:03:35,148 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
08:03:35,148 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
08:03:35,182 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
08:03:35,182 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:68)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:39)
at at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:88)
at at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:79)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:64)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:134)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
at at org.typelevel.log4cats.slf4j.Slf4jLogger$.getLoggerFromName(Slf4jLogger.scala:30)
at at org.typelevel.log4cats.slf4j.Slf4jLogger$.getLogger(Slf4jLogger.scala:27)
at at org.apache.daffodil.debugger.dap.DAPodil$.<init>(DAPodil.scala:431)
at at org.apache.daffodil.debugger.dap.DAPodil$.<clinit>(DAPodil.scala)
at at org.apache.daffodil.debugger.dap.DAPodil.main(DAPodil.scala)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
at at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:55)
at ... 25 common frames omitted
08:03:35,182 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
08:03:35,184 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
08:03:35,186 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
08:03:35,186 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/tmp/daffodil-debugger.log]
08:03:35,187 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
08:03:35,187 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
08:03:35,187 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
08:03:35,187 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
08:03:35,188 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@436bc36<ma...@436bc36> - Registering current configuration as safe fallback point
2024-08-06 08:03:35,539 [io-compute-10] INFO o.a.d.d.d.DAPodil -
******************************************************
A DAP server for debugging Daffodil schema processors.
Build info:
version: 1.3.1
daffodilVersion: 3.5.0
scalaVersion: 2.12.15
sbtVersion: 1.8.2
Runtime info:
JVM version: 11.0.22 (C:\java)
******************************************************
2024-08-06 08:03:35,539 [io-compute-10] INFO o.a.d.d.d.DAPodil - launched with options listenPort: 4711, listenTimeout:
10 seconds
2024-08-06 08:03:35,547 [io-compute-10] INFO o.a.d.d.d.DAPodil - waiting at tcp://localhost:4711
2024-08-06 08:03:38,345 [io-compute-blocker-10] INFO o.a.d.d.d.DAPodil - connected at tcp://localhost:4711
2024-08-06 08:03:38,501 [io-compute-12] INFO o.a.d.d.d.DAPSession - R> #1 initialize {"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"dfdl","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true}
2024-08-06 08:03:38,531 [io-compute-4] INFO o.a.d.d.d.DAPSession - <R #1 initialize success {"supportsConfigurationDoneRequest":true,"supportsHitConditionalBreakpoints":false,"supportsConditionalBreakpoints":false,"supportsEvaluateForHovers":false,"supportsCompletionsRequest":false,"supportsRestartFrame":false,"supportsSetVariable":false,"supportsRestartRequest":false,"supportTerminateDebuggee":false,"supportsDelayedStackTraceLoading":false,"supportsLogPoints":false,"supportsExceptionInfoRequest":false,"supportsDataBreakpoints":false,"supportsClipboardContext":false,"supportsLoadedSourcesRequest":false}
2024-08-06 08:03:38,531 [io-compute-blocker-4] INFO o.a.d.d.d.DAPSession - <E initialized
2024-08-06 08:03:38,541 [io-compute-9] INFO o.a.d.d.d.DAPSession - R> #2 launch {"request":"launch","type":"dfdl","name":"Wizard Config","program":"c:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message\\repeating-label-message-characterization-1.dfdl.xsd","data":"c:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message\\input\\repeating-label-message-characterization-1.txt","debugServer":4711,"infosetFormat":"xml","infosetOutput":{"type":"file","path":"C:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message/target/infoset.xml"},"trace":true,"stopOnEntry":true,"useExistingServer":false,"openHexView":true,"openInfosetView":false,"openInfosetDiffView":false,"daffodilDebugClasspath":"","dataEditor":{"port":9000,"logging":{"file":"C:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message/dataEditor-${omegaEditPort}.log","level":"info"}},"dfdlDebugger":{"logging":{"file":"/tmp/daffodil-debugger.log","level":"INFO"}},"__configurationTarget":6,"__sessionId":"d8c1858c-9fa0-4e54-b9e0-19245a4743e1"}
2024-08-06 08:03:38,541 [io-compute-16] INFO o.a.d.d.d.DAPSession - R> #3 configurationDone null
2024-08-06 08:03:40,205 [io-compute-16] INFO o.a.d.d.d.DAPSession - <E thread started
2024-08-06 08:03:40,209 [io-compute-14] INFO o.a.d.d.d.DAPSession - <E stopped entry
2024-08-06 08:03:40,210 [io-compute-blocker-16] INFO o.a.d.d.d.DAPSession - <R #2 launch success null
2024-08-06 08:03:40,211 [io-compute-blocker-16] INFO o.a.d.d.d.DAPSession - <R #3 configurationDone success null
2024-08-06 08:03:40,212 [io-compute-18] INFO o.a.d.d.d.DAPSession - R> #4 threads null
2024-08-06 08:03:40,216 [io-compute-1] INFO o.a.d.d.d.DAPSession - <E daffodil.config
2024-08-06 08:03:40,218 [io-compute-13] INFO o.a.d.d.d.DAPSession - <R #4 threads success {"threads":[{"id":1,"name":"daffodil"}]}
2024-08-06 08:03:40,219 [io-compute-5] INFO o.a.d.d.d.DAPSession - <E daffodil.data
2024-08-06 08:03:40,223 [io-compute-4] INFO o.a.d.d.d.DAPSession - R> #5 threads null
2024-08-06 08:03:40,223 [io-compute-11] INFO o.a.d.d.d.DAPSession - <R #5 threads success {"threads":[{"id":1,"name":"daffodil"}]}
2024-08-06 08:03:40,223 [io-compute-20] INFO o.a.d.d.d.DAPSession - R> #6 stackTrace {"threadId":1,"startFrame":0,"levels":20}
2024-08-06 08:03:40,223 [io-compute-0] INFO o.a.d.d.d.DAPSession - <R #6 stackTrace success {"stackFrames":[{"id":1,"source":{"name":"repeating-label-message-characterization-1.dfdl.xsd","path":"c:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message\\repeating-label-message-characterization-1.dfdl.xsd","sourceReference":0},"line":2,"column":0,"name":"repeating-label-message"}],"totalFrames":1}
2024-08-06 08:03:40,319 [io-compute-7] INFO o.a.d.d.d.DAPSession - R> #7 threads null
2024-08-06 08:03:40,319 [io-compute-7] INFO o.a.d.d.d.DAPSession - <R #7 threads success {"threads":[{"id":1,"name":"daffodil"}]}
From: Regis Thomas <re...@nteligen.com>>
Sent: Thursday, August 1, 2024 8:56 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, The infoset should open in a new tab/pane in the VS Code editor window. It should also be saved as a new file in your workspace directory with the name from the launch. json file. You can click the file explorer icon in the
Good morning Roger,
The infoset should open in a new tab/pane in the VS Code editor window. It should also be saved as a new file in your workspace directory with the name from the launch.json file. You can click the file explorer icon in the actions pane [cid:image006.png@01DAE7ED.2D480150] to see if the file is there.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, August 1, 2024 7:05 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
August 1, 2024
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time.
3. I clicked on the [cid:image006.png@01DAE7ED.2D480150] icon in the top left-hand corner (thanks Larry!). That opened a panel. In that panel is an “Open Folder” button, which I clicked on. That resulted in a window opening prompting me to select the folder that has my DFDL schema and input file. I selected the folder. A window titled “Do you trust the authors of the files in this folder?” appeared. I clicked on “Yes, I trust the authors” button.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. This opened a Launch Config Wizard tab.
[cid:image007.png@01DAE7ED.2D480150]
5. I clicked the Browse button adjacent to a box labeled “Absolute path to the input data file.” I selected my input file. The path to my input file was inserted into the box – yea!
6. I would like to specify the output file. I guess that this is where it is specified:
[cid:image008.png@01DAE7ED.2D480150]
7. I clicked the Browse button adjacent to a box labeled “Absolute path to the DFDL schema file.” I selected my DFDL schema file. The path to my schema file was inserted into the box – yea!
8. I scrolled down to the bottom. I see some configuration settings that I have no idea what they are for:
[cid:image009.png@01DAE7ED.2D480150]
9. I guess that I am done configuring. I clicked on the Save button. It appears to have saved my configuration settings – yea!
10. The launch.json tab is now visible:
[cid:image010.png@01DAE7ED.2D480150]
11. I went back to this web page to find out what I should do next: https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0
12. I read the section titled “Launch a DFDL Parse Debugging Session.” It makes no sense:
[cid:image011.png@01DAE7ED.2D480150]
13. I’ll ignore the instructions and “wing it.” I selected Run >> Start Debugging
[cid:image012.png@01DAE7ED.2D480150]
14. Looks like it’s in the debugger – yea!
[cid:image013.png@01DAE7ED.2D480150]
15. I clicked on Run >> Continue. I guess the debugger ran through the entire DFDL schema:
[cid:image014.png@01DAE7ED.2D480150]
16. I clicked on the Open button (bottom right) to view the output XML file. Nothing. Where’s the XML? I clicked on OUTPUT and it’s empty:
[cid:image015.png@01DAE7ED.2D480150]
17. Using Windows Explorer I found the output XML file and opened it in Notepad++. Why can’t I see the file in the DFDL VS Code tool?
From: Larry Barber <la...@nteligen.com>>
Sent: Tuesday, July 23, 2024 12:44 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Roger, I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard. However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension. When
Hi Roger,
I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard.
However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension.
When I open Visual Studio I get this view
[cid:image016.png@01DAE7ED.2D480150]
If I do SHIFT-CTRL-P
[cid:image017.png@01DAE7ED.2D480150]
…and select Daffodil Debug: Configure launch.json
[cid:image018.png@01DAE7ED.2D480150]
…scrolling down to the bottom of the Wizard and clicking on Save does absolutely nothing, just as you reported.
This issue seems to be caused by the fact that you have not established or opened a workspace for visual Studio.
Note the little blue dot with the number one in the top left of the screen. That is the Visual Studio Explorer highlighting the fact that no folder has been opened.
Your screen indicates that you have the side panel minimized:
[cid:image019.png@01DAE7ED.2D480150]
Just click on the [cid:image006.png@01DAE7ED.2D480150] and the Explorer will open and then you can click on the Open Folder button. Navigate to and open the folder where your schema file and/or data file is located, then try opening the Configuration Wizard again (SHIFT-CTRL-P).
You should now be able to save your configuration settings.
There may be an addition issue that I don’tunderstand since your configuration wizard appears to be missing setting fields for the Main Schema File and Root Element settings, but we can attempt to figure that out if doesn’t go away once you have Visual Studio opened correctly.
Larry
From: Roger L Costello <co...@mitre.org>>
Sent: Monday, July 22, 2024 10:04 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image021.png@01DAE7ED.2D480150]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image022.png@01DAE7ED.2D480150]
6. I selected my input file:
[cid:image023.png@01DAE7ED.2D480150]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image024.png@01DAE7ED.2D480150]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image025.png@01DAE7ED.2D480150]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image026.png@01DAE7ED.2D480150]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image027.png@01DAE7ED.2D480150]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image028.png@01DAE7ED.2D480150]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image029.png@01DAE7ED.2D480150]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image030.png@01DAE7ED.2D480150]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image031.png@01DAE7ED.2D480150]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image032.png@01DAE7ED.2D480150]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image033.png@01DAE7ED.2D480150]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Roger L Costello <co...@mitre.org>.
August 14, 2024
1. I opened Visual Studio Code from the Windows Start icon. I got a window about an update to Visual Studio Code to version 1.92.1. Not at this time. I closed the Release Notes tab. No Welcome tab this time. That’s odd.
2. In the panel on the left side I clicked on the name of my DFDL schema file (test.dfdl.xsd). That resulted in opening a window which displays my schema -- okay!
3. I selected Run >> Start Debugging which resulted in this error message popping up:
[cid:image006.png@01DAEE19.C91D1390]
Once again, I am stuck. I have no idea how to proceed.
From: Larry Barber <la...@nteligen.com>
Sent: Wednesday, August 7, 2024 12:56 PM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Roger, The next time you get the debugger running, instead of clicking on the Continue button, try the Step Over button (don’t use the Step Into button, as it currently behaves like the Continue button). If you press/click on this Step Over
ZjQcmQRYFpfptBannerStart
Roger,
The next time you get the debugger running, instead of clicking on the [cid:image007.png@01DAEE19.C91D1390] Continue button, try the [cid:image008.png@01DAEE19.C91D1390] Step Over button (don’t use the [cid:image009.png@01DAEE19.C91D1390] Step Into button, as it currently behaves like the Continue button).
If you press/click on this Step Over button repeatedly, you can see the debugger step through the schema and data files.
Also, on the right half of the screen above the Data Editor window there will be a tab that you can click on that will display the temporary file being used to hold the infoset as it is being built. You can see how it grows… and shrinks when the parser backtracks.
The tab should be a truncated version of something that looks like this: [cid:image010.png@01DAEE19.C91D1390]
Once the file parsing completes, this file is removed and the display changes: [cid:image011.png@01DAEE19.C91D1390]
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Larry Barber <la...@nteligen.com>.
Roger,
The next time you get the debugger running, instead of clicking on the [cid:image001.png@01DAE8C7.4756FCB0] Continue button, try the [cid:image002.png@01DAE8C7.4756FCB0] Step Over button (don’t use the [cid:image005.png@01DAE8C9.253790C0] Step Into button, as it currently behaves like the Continue button).
If you press/click on this Step Over button repeatedly, you can see the debugger step through the schema and data files.
Also, on the right half of the screen above the Data Editor window there will be a tab that you can click on that will display the temporary file being used to hold the infoset as it is being built. You can see how it grows… and shrinks when the parser backtracks.
The tab should be a truncated version of something that looks like this: [cid:image003.png@01DAE8C8.0E793A60]
Once the file parsing completes, this file is removed and the display changes: [cid:image004.png@01DAE8C8.786FFF80]
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Roger L Costello <co...@mitre.org>.
August 6, 2024
1. I’d like to pick up where I left off last time, i.e., I don’t want to have to recreate launch.json. We will see …
2. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
3. It appears that I still have launch.json and all the stuff from my last use:
[Graphical user interface Description automatically generated]
4. I will rerun the debugger on my schema and input: Run >> Start Debugging
5. A window popped up for a short period of time, indicating a way to open the output file:
[cid:image030.png@01DAE7DF.8BAF84B0]
6. No output is displayed. I clicked on the Terminal menu. It has lots of unintelligible stuff. I can pick out one message, something about missing a logback-test.xml file. No idea what that is or why I should be concerned with it. Maybe the launch.json file has a logback-test property, let me check … nope, no logback or logback-test property. Below is the complete contents of the Terminal window.
7. Let me see if Run >> Run Without Debugger will generate the output file. Nope. No output.
8. The DFDL schema that I have been testing is old. Let me test a more recent schema.
9. Hmm, how do I close the old stuff? Ah, File >> Close Window seems to do the job.
10. I clicked on the [cid:image031.png@01DAE7DF.8BAF84B0] icon in the top left-hand corner. That opened a panel. In that panel is an “Open Folder” button, which I clicked on. That resulted in a window opening prompting me to select the folder that has my DFDL schema and input file. I selected the folder. A window titled “Do you trust the authors of the files in this folder?” appeared. I clicked on “Yes, I trust the authors” button.
11. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. This opened a Launch Config Wizard tab. I filled in the configuration and hit Save.
12. I selected Run >> Start Debugging. Eek! I get this error message:
[cid:image032.png@01DAE7DF.8BAF84B0]
13. I am stuck. No idea how to proceed.
> set DAFFODIL_DEBUG_CLASSPATH=
PS C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message> set DAFFODIL_DEBUG_LOG_LEVEL=INFO
PS C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message> set DAFFODIL_DEBUG_LOG_FILE=/tmp/daffodil-debugger.log
PS C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message> set JAVA_HOME=C:\java
PS C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message> c:\Users\costello\.vscode\extensions\asf.apache-daffodil-vscode-1.3.1\daffodil-debugger-3.5.0-1.3.1\bin\daffodil-debugger.bat --listenPort 4711
08:03:35,075 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
08:03:35,075 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/costello/.vscode/extensions/asf.apache-daffodil-vscode-1.3.1/daffodil-debugger-3.5.0-1.3.1/lib/org.apache.daffodil.daffodil-debugger-1.3.1.jar!/logback.xml]
08:03:35,075 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@6b8d96d9 - URL [jar:file:/C:/Users/costello/.vscode/extensions/asf.apache-daffodil-vscode-1.3.1/daffodil-debugger-3.5.0-1.3.1/lib/org.apache.daffodil.daffodil-debugger-1.3.1.jar!/logback.xml] is not of type file
08:03:35,141 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
08:03:35,141 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
08:03:35,148 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
08:03:35,148 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
08:03:35,182 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
08:03:35,182 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:68)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:39)
at at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:88)
at at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:79)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:64)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:134)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
at at org.typelevel.log4cats.slf4j.Slf4jLogger$.getLoggerFromName(Slf4jLogger.scala:30)
at at org.typelevel.log4cats.slf4j.Slf4jLogger$.getLogger(Slf4jLogger.scala:27)
at at org.apache.daffodil.debugger.dap.DAPodil$.<init>(DAPodil.scala:431)
at at org.apache.daffodil.debugger.dap.DAPodil$.<clinit>(DAPodil.scala)
at at org.apache.daffodil.debugger.dap.DAPodil.main(DAPodil.scala)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
at at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:55)
at ... 25 common frames omitted
08:03:35,182 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
08:03:35,184 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
08:03:35,186 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
08:03:35,186 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/tmp/daffodil-debugger.log]
08:03:35,187 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
08:03:35,187 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
08:03:35,187 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
08:03:35,187 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
08:03:35,188 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@436bc36 - Registering current configuration as safe fallback point
2024-08-06 08:03:35,539 [io-compute-10] INFO o.a.d.d.d.DAPodil -
******************************************************
A DAP server for debugging Daffodil schema processors.
Build info:
version: 1.3.1
daffodilVersion: 3.5.0
scalaVersion: 2.12.15
sbtVersion: 1.8.2
Runtime info:
JVM version: 11.0.22 (C:\java)
******************************************************
2024-08-06 08:03:35,539 [io-compute-10] INFO o.a.d.d.d.DAPodil - launched with options listenPort: 4711, listenTimeout:
10 seconds
2024-08-06 08:03:35,547 [io-compute-10] INFO o.a.d.d.d.DAPodil - waiting at tcp://localhost:4711
2024-08-06 08:03:38,345 [io-compute-blocker-10] INFO o.a.d.d.d.DAPodil - connected at tcp://localhost:4711
2024-08-06 08:03:38,501 [io-compute-12] INFO o.a.d.d.d.DAPSession - R> #1 initialize {"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"dfdl","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true}
2024-08-06 08:03:38,531 [io-compute-4] INFO o.a.d.d.d.DAPSession - <R #1 initialize success {"supportsConfigurationDoneRequest":true,"supportsHitConditionalBreakpoints":false,"supportsConditionalBreakpoints":false,"supportsEvaluateForHovers":false,"supportsCompletionsRequest":false,"supportsRestartFrame":false,"supportsSetVariable":false,"supportsRestartRequest":false,"supportTerminateDebuggee":false,"supportsDelayedStackTraceLoading":false,"supportsLogPoints":false,"supportsExceptionInfoRequest":false,"supportsDataBreakpoints":false,"supportsClipboardContext":false,"supportsLoadedSourcesRequest":false}
2024-08-06 08:03:38,531 [io-compute-blocker-4] INFO o.a.d.d.d.DAPSession - <E initialized
2024-08-06 08:03:38,541 [io-compute-9] INFO o.a.d.d.d.DAPSession - R> #2 launch {"request":"launch","type":"dfdl","name":"Wizard Config","program":"c:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message\\repeating-label-message-characterization-1.dfdl.xsd","data":"c:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message\\input\\repeating-label-message-characterization-1.txt","debugServer":4711,"infosetFormat":"xml","infosetOutput":{"type":"file","path":"C:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message/target/infoset.xml"},"trace":true,"stopOnEntry":true,"useExistingServer":false,"openHexView":true,"openInfosetView":false,"openInfosetDiffView":false,"daffodilDebugClasspath":"","dataEditor":{"port":9000,"logging":{"file":"C:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message/dataEditor-${omegaEditPort}.log","level":"info"}},"dfdlDebugger":{"logging":{"file":"/tmp/daffodil-debugger.log","level":"INFO"}},"__configurationTarget":6,"__sessionId":"d8c1858c-9fa0-4e54-b9e0-19245a4743e1"}
2024-08-06 08:03:38,541 [io-compute-16] INFO o.a.d.d.d.DAPSession - R> #3 configurationDone null
2024-08-06 08:03:40,205 [io-compute-16] INFO o.a.d.d.d.DAPSession - <E thread started
2024-08-06 08:03:40,209 [io-compute-14] INFO o.a.d.d.d.DAPSession - <E stopped entry
2024-08-06 08:03:40,210 [io-compute-blocker-16] INFO o.a.d.d.d.DAPSession - <R #2 launch success null
2024-08-06 08:03:40,211 [io-compute-blocker-16] INFO o.a.d.d.d.DAPSession - <R #3 configurationDone success null
2024-08-06 08:03:40,212 [io-compute-18] INFO o.a.d.d.d.DAPSession - R> #4 threads null
2024-08-06 08:03:40,216 [io-compute-1] INFO o.a.d.d.d.DAPSession - <E daffodil.config
2024-08-06 08:03:40,218 [io-compute-13] INFO o.a.d.d.d.DAPSession - <R #4 threads success {"threads":[{"id":1,"name":"daffodil"}]}
2024-08-06 08:03:40,219 [io-compute-5] INFO o.a.d.d.d.DAPSession - <E daffodil.data
2024-08-06 08:03:40,223 [io-compute-4] INFO o.a.d.d.d.DAPSession - R> #5 threads null
2024-08-06 08:03:40,223 [io-compute-11] INFO o.a.d.d.d.DAPSession - <R #5 threads success {"threads":[{"id":1,"name":"daffodil"}]}
2024-08-06 08:03:40,223 [io-compute-20] INFO o.a.d.d.d.DAPSession - R> #6 stackTrace {"threadId":1,"startFrame":0,"levels":20}
2024-08-06 08:03:40,223 [io-compute-0] INFO o.a.d.d.d.DAPSession - <R #6 stackTrace success {"stackFrames":[{"id":1,"source":{"name":"repeating-label-message-characterization-1.dfdl.xsd","path":"c:\\Users\\costello\\Documents\\BACKUP\\DFDL\\daffodil\\daffodil-2.5.0-incubating\\DFDL-class\\examples\\repeating-label-message\\repeating-label-message-characterization-1.dfdl.xsd","sourceReference":0},"line":2,"column":0,"name":"repeating-label-message"}],"totalFrames":1}
2024-08-06 08:03:40,319 [io-compute-7] INFO o.a.d.d.d.DAPSession - R> #7 threads null
2024-08-06 08:03:40,319 [io-compute-7] INFO o.a.d.d.d.DAPSession - <R #7 threads success {"threads":[{"id":1,"name":"daffodil"}]}
From: Regis Thomas <re...@nteligen.com>
Sent: Thursday, August 1, 2024 8:56 AM
To: users@daffodil.apache.org
Cc: Johnson, Kirk <jo...@ctc.com>; Dave Schloss <da...@nteligen.com>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, The infoset should open in a new tab/pane in the VS Code editor window. It should also be saved as a new file in your workspace directory with the name from the launch. json file. You can click the file explorer icon in the
Good morning Roger,
The infoset should open in a new tab/pane in the VS Code editor window. It should also be saved as a new file in your workspace directory with the name from the launch.json file. You can click the file explorer icon in the actions pane [cid:image033.png@01DAE7DF.8BAF84B0] to see if the file is there.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, August 1, 2024 7:05 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
August 1, 2024
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time.
3. I clicked on the [cid:image033.png@01DAE7DF.8BAF84B0] icon in the top left-hand corner (thanks Larry!). That opened a panel. In that panel is an “Open Folder” button, which I clicked on. That resulted in a window opening prompting me to select the folder that has my DFDL schema and input file. I selected the folder. A window titled “Do you trust the authors of the files in this folder?” appeared. I clicked on “Yes, I trust the authors” button.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. This opened a Launch Config Wizard tab.
[cid:image034.png@01DAE7DF.8BAF84B0]
5. I clicked the Browse button adjacent to a box labeled “Absolute path to the input data file.” I selected my input file. The path to my input file was inserted into the box – yea!
6. I would like to specify the output file. I guess that this is where it is specified:
[cid:image035.png@01DAE7DF.8BAF84B0]
7. I clicked the Browse button adjacent to a box labeled “Absolute path to the DFDL schema file.” I selected my DFDL schema file. The path to my schema file was inserted into the box – yea!
8. I scrolled down to the bottom. I see some configuration settings that I have no idea what they are for:
[cid:image036.png@01DAE7DF.8BAF84B0]
9. I guess that I am done configuring. I clicked on the Save button. It appears to have saved my configuration settings – yea!
10. The launch.json tab is now visible:
[cid:image037.png@01DAE7DF.8BAF84B0]
11. I went back to this web page to find out what I should do next: https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0
12. I read the section titled “Launch a DFDL Parse Debugging Session.” It makes no sense:
[cid:image038.png@01DAE7DF.8BAF84B0]
13. I’ll ignore the instructions and “wing it.” I selected Run >> Start Debugging
[cid:image039.png@01DAE7DF.8BAF84B0]
14. Looks like it’s in the debugger – yea!
[cid:image040.png@01DAE7DF.8BAF84B0]
15. I clicked on Run >> Continue. I guess the debugger ran through the entire DFDL schema:
[cid:image041.png@01DAE7DF.8BAF84B0]
16. I clicked on the Open button (bottom right) to view the output XML file. Nothing. Where’s the XML? I clicked on OUTPUT and it’s empty:
[cid:image042.png@01DAE7DF.8BAF84B0]
17. Using Windows Explorer I found the output XML file and opened it in Notepad++. Why can’t I see the file in the DFDL VS Code tool?
From: Larry Barber <la...@nteligen.com>>
Sent: Tuesday, July 23, 2024 12:44 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Roger, I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard. However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension. When
Hi Roger,
I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard.
However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension.
When I open Visual Studio I get this view
[cid:image043.png@01DAE7DF.8BAF84B0]
If I do SHIFT-CTRL-P
[cid:image044.png@01DAE7DF.8BAF84B0]
…and select Daffodil Debug: Configure launch.json
[cid:image045.png@01DAE7DF.8BAF84B0]
…scrolling down to the bottom of the Wizard and clicking on Save does absolutely nothing, just as you reported.
This issue seems to be caused by the fact that you have not established or opened a workspace for visual Studio.
Note the little blue dot with the number one in the top left of the screen. That is the Visual Studio Explorer highlighting the fact that no folder has been opened.
Your screen indicates that you have the side panel minimized:
[cid:image046.png@01DAE7DF.8BAF84B0]
Just click on the [cid:image033.png@01DAE7DF.8BAF84B0] and the Explorer will open and then you can click on the Open Folder button. Navigate to and open the folder where your schema file and/or data file is located, then try opening the Configuration Wizard again (SHIFT-CTRL-P).
You should now be able to save your configuration settings.
There may be an addition issue that I don’tunderstand since your configuration wizard appears to be missing setting fields for the Main Schema File and Root Element settings, but we can attempt to figure that out if doesn’t go away once you have Visual Studio opened correctly.
Larry
From: Roger L Costello <co...@mitre.org>>
Sent: Monday, July 22, 2024 10:04 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image048.png@01DAE7DF.8BAF84B0]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image049.png@01DAE7DF.8BAF84B0]
6. I selected my input file:
[cid:image050.png@01DAE7DF.8BAF84B0]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image051.png@01DAE7DF.8BAF84B0]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image052.png@01DAE7DF.8BAF84B0]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image053.png@01DAE7DF.8BAF84B0]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image054.png@01DAE7DF.8BAF84B0]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image055.png@01DAE7DF.8BAF84B0]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image056.png@01DAE7DF.8BAF84B0]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image057.png@01DAE7DF.8BAF84B0]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image058.png@01DAE7DF.8BAF84B0]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image059.png@01DAE7DF.8BAF84B0]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image060.png@01DAE7DF.8BAF84B0]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Regis Thomas <re...@nteligen.com>.
Good morning Roger,
The infoset should open in a new tab/pane in the VS Code editor window. It should also be saved as a new file in your workspace directory with the name from the launch.json file. You can click the file explorer icon in the actions pane [cid:image001.png@01DAE3EF.A847D620] to see if the file is there.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com
From: Roger L Costello <co...@mitre.org>
Sent: Thursday, August 1, 2024 7:05 AM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
August 1, 2024
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time.
3. I clicked on the [cid:image001.png@01DAE3EF.A847D620] icon in the top left-hand corner (thanks Larry!). That opened a panel. In that panel is an “Open Folder” button, which I clicked on. That resulted in a window opening prompting me to select the folder that has my DFDL schema and input file. I selected the folder. A window titled “Do you trust the authors of the files in this folder?” appeared. I clicked on “Yes, I trust the authors” button.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. This opened a Launch Config Wizard tab.
[cid:image002.png@01DAE3EF.A847D620]
5. I clicked the Browse button adjacent to a box labeled “Absolute path to the input data file.” I selected my input file. The path to my input file was inserted into the box – yea!
6. I would like to specify the output file. I guess that this is where it is specified:
[cid:image003.png@01DAE3EF.A847D620]
7. I clicked the Browse button adjacent to a box labeled “Absolute path to the DFDL schema file.” I selected my DFDL schema file. The path to my schema file was inserted into the box – yea!
8. I scrolled down to the bottom. I see some configuration settings that I have no idea what they are for:
[cid:image004.png@01DAE3EF.A847D620]
9. I guess that I am done configuring. I clicked on the Save button. It appears to have saved my configuration settings – yea!
10. The launch.json tab is now visible:
[cid:image005.png@01DAE3EF.A847D620]
11. I went back to this web page to find out what I should do next: https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0
12. I read the section titled “Launch a DFDL Parse Debugging Session.” It makes no sense:
[cid:image006.png@01DAE3EF.A847D620]
13. I’ll ignore the instructions and “wing it.” I selected Run >> Start Debugging
[cid:image007.png@01DAE3EF.A847D620]
14. Looks like it’s in the debugger – yea!
[cid:image008.png@01DAE3EF.A847D620]
15. I clicked on Run >> Continue. I guess the debugger ran through the entire DFDL schema:
[cid:image009.png@01DAE3EF.A847D620]
16. I clicked on the Open button (bottom right) to view the output XML file. Nothing. Where’s the XML? I clicked on OUTPUT and it’s empty:
[cid:image010.png@01DAE3EF.A847D620]
17. Using Windows Explorer I found the output XML file and opened it in Notepad++. Why can’t I see the file in the DFDL VS Code tool?
From: Larry Barber <la...@nteligen.com>>
Sent: Tuesday, July 23, 2024 12:44 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Roger, I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard. However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension. When
Hi Roger,
I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard.
However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension.
When I open Visual Studio I get this view
[cid:image011.png@01DAE3EF.A847D620]
If I do SHIFT-CTRL-P
[cid:image012.png@01DAE3EF.A847D620]
…and select Daffodil Debug: Configure launch.json
[cid:image013.png@01DAE3EF.A847D620]
…scrolling down to the bottom of the Wizard and clicking on Save does absolutely nothing, just as you reported.
This issue seems to be caused by the fact that you have not established or opened a workspace for visual Studio.
Note the little blue dot with the number one in the top left of the screen. That is the Visual Studio Explorer highlighting the fact that no folder has been opened.
Your screen indicates that you have the side panel minimized:
[cid:image014.png@01DAE3EF.A847D620]
Just click on the [cid:image001.png@01DAE3EF.A847D620] and the Explorer will open and then you can click on the Open Folder button. Navigate to and open the folder where your schema file and/or data file is located, then try opening the Configuration Wizard again (SHIFT-CTRL-P).
You should now be able to save your configuration settings.
There may be an addition issue that I don’tunderstand since your configuration wizard appears to be missing setting fields for the Main Schema File and Root Element settings, but we can attempt to figure that out if doesn’t go away once you have Visual Studio opened correctly.
Larry
From: Roger L Costello <co...@mitre.org>>
Sent: Monday, July 22, 2024 10:04 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image016.png@01DAE3EF.A847D620]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image017.png@01DAE3EF.A847D620]
6. I selected my input file:
[cid:image018.png@01DAE3EF.A847D620]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image019.png@01DAE3EF.A847D620]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image020.png@01DAE3EF.A847D620]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image021.png@01DAE3EF.A847D620]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image022.png@01DAE3EF.A847D620]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image023.png@01DAE3EF.A847D620]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image024.png@01DAE3EF.A847D620]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image025.png@01DAE3EF.A847D620]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image026.png@01DAE3EF.A847D620]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image027.png@01DAE3EF.A847D620]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image028.png@01DAE3EF.A847D620]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Roger L Costello <co...@mitre.org>.
August 1, 2024
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time.
3. I clicked on the [cid:image004.png@01DAE3E1.2598AB40] icon in the top left-hand corner (thanks Larry!). That opened a panel. In that panel is an “Open Folder” button, which I clicked on. That resulted in a window opening prompting me to select the folder that has my DFDL schema and input file. I selected the folder. A window titled “Do you trust the authors of the files in this folder?” appeared. I clicked on “Yes, I trust the authors” button.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. This opened a Launch Config Wizard tab.
[cid:image005.png@01DAE3E1.2598AB40]
5. I clicked the Browse button adjacent to a box labeled “Absolute path to the input data file.” I selected my input file. The path to my input file was inserted into the box – yea!
6. I would like to specify the output file. I guess that this is where it is specified:
[cid:image006.png@01DAE3E1.2598AB40]
7. I clicked the Browse button adjacent to a box labeled “Absolute path to the DFDL schema file.” I selected my DFDL schema file. The path to my schema file was inserted into the box – yea!
8. I scrolled down to the bottom. I see some configuration settings that I have no idea what they are for:
[cid:image022.png@01DAE3E1.2598AB40]
9. I guess that I am done configuring. I clicked on the Save button. It appears to have saved my configuration settings – yea!
10. The launch.json tab is now visible:
[cid:image023.png@01DAE3E1.2598AB40]
11. I went back to this web page to find out what I should do next: https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0
12. I read the section titled “Launch a DFDL Parse Debugging Session.” It makes no sense:
[cid:image024.png@01DAE3E1.2598AB40]
13. I’ll ignore the instructions and “wing it.” I selected Run >> Start Debugging
[cid:image025.png@01DAE3E1.2598AB40]
14. Looks like it’s in the debugger – yea!
[cid:image026.png@01DAE3E1.2598AB40]
15. I clicked on Run >> Continue. I guess the debugger ran through the entire DFDL schema:
[cid:image027.png@01DAE3E1.2598AB40]
16. I clicked on the Open button (bottom right) to view the output XML file. Nothing. Where’s the XML? I clicked on OUTPUT and it’s empty:
[cid:image028.png@01DAE3E1.2598AB40]
17. Using Windows Explorer I found the output XML file and opened it in Notepad++. Why can’t I see the file in the DFDL VS Code tool?
From: Larry Barber <la...@nteligen.com>
Sent: Tuesday, July 23, 2024 12:44 PM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Roger, I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard. However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension. When
Hi Roger,
I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard.
However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension.
When I open Visual Studio I get this view
[cid:image029.png@01DAE3E1.2598AB40]
If I do SHIFT-CTRL-P
[cid:image030.png@01DAE3E1.2598AB40]
…and select Daffodil Debug: Configure launch.json
[cid:image031.png@01DAE3E1.2598AB40]
…scrolling down to the bottom of the Wizard and clicking on Save does absolutely nothing, just as you reported.
This issue seems to be caused by the fact that you have not established or opened a workspace for visual Studio.
Note the little blue dot with the number one in the top left of the screen. That is the Visual Studio Explorer highlighting the fact that no folder has been opened.
Your screen indicates that you have the side panel minimized:
[cid:image032.png@01DAE3E1.2598AB40]
Just click on the [cid:image004.png@01DAE3E1.2598AB40] and the Explorer will open and then you can click on the Open Folder button. Navigate to and open the folder where your schema file and/or data file is located, then try opening the Configuration Wizard again (SHIFT-CTRL-P).
You should now be able to save your configuration settings.
There may be an addition issue that I don’tunderstand since your configuration wizard appears to be missing setting fields for the Main Schema File and Root Element settings, but we can attempt to figure that out if doesn’t go away once you have Visual Studio opened correctly.
Larry
From: Roger L Costello <co...@mitre.org>>
Sent: Monday, July 22, 2024 10:04 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image034.png@01DAE3E1.2598AB40]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image035.png@01DAE3E1.2598AB40]
6. I selected my input file:
[cid:image036.png@01DAE3E1.2598AB40]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image037.png@01DAE3E1.2598AB40]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image038.png@01DAE3E1.2598AB40]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image039.png@01DAE3E1.2598AB40]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image040.png@01DAE3E1.2598AB40]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image041.png@01DAE3E1.2598AB40]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image042.png@01DAE3E1.2598AB40]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image043.png@01DAE3E1.2598AB40]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image044.png@01DAE3E1.2598AB40]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image045.png@01DAE3E1.2598AB40]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image046.png@01DAE3E1.2598AB40]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Larry Barber <la...@nteligen.com>.
Hi Roger,
I was able to duplicate a condition that replicated your “nothing happens when I click SAVE in the Configuration Wizard.
However, this turns out to be an issue with how Visual Studio works, not the Daffodil Debugger Extension.
When I open Visual Studio I get this view
[cid:image007.png@01DADCFB.4E171AD0]
If I do SHIFT-CTRL-P
[cid:image001.png@01DADCFB.8EFE6670]
…and select Daffodil Debug: Configure launch.json
[cid:image002.png@01DADCFB.EC108AA0]
…scrolling down to the bottom of the Wizard and clicking on Save does absolutely nothing, just as you reported.
This issue seems to be caused by the fact that you have not established or opened a workspace for visual Studio.
Note the little blue dot with the number one in the top left of the screen. That is the Visual Studio Explorer highlighting the fact that no folder has been opened.
Your screen indicates that you have the side panel minimized:
[cid:image003.png@01DADCFD.48301C00]
Just click on the [cid:image004.png@01DADCFD.48301C00] and the Explorer will open and then you can click on the Open Folder button. Navigate to and open the folder where your schema file and/or data file is located, then try opening the Configuration Wizard again (SHIFT-CTRL-P).
You should now be able to save your configuration settings.
There may be an addition issue that I don’tunderstand since your configuration wizard appears to be missing setting fields for the Main Schema File and Root Element settings, but we can attempt to figure that out if doesn’t go away once you have Visual Studio opened correctly.
Larry
From: Roger L Costello <co...@mitre.org>
Sent: Monday, July 22, 2024 10:04 AM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image009.png@01DADCFB.4E171AD0]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image010.png@01DADCFB.4E171AD0]
6. I selected my input file:
[cid:image011.png@01DADCFB.4E171AD0]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image012.png@01DADCFB.4E171AD0]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image013.png@01DADCFB.4E171AD0]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image014.png@01DADCFB.4E171AD0]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image015.png@01DADCFB.4E171AD0]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image016.png@01DADCFB.4E171AD0]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image017.png@01DADCFB.4E171AD0]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image018.png@01DADCFB.4E171AD0]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image019.png@01DADCFB.4E171AD0]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image020.png@01DADCFB.4E171AD0]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image021.png@01DADCFB.4E171AD0]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Regis Thomas <re...@nteligen.com>.
Hello Roger,
I noticed one more thing in your screen captures, the explorer panel is collapsed. When you want to see the explorer panel, click any icon in the activity panel to open the explorer panel to that item. Click on the same activity panel icon to collapse the explorer panel view. See my full explanations below. Sorry to keep adding to my response.
[cid:image033.png@01DADCC6.9E9F3440]
[cid:image034.png@01DADCC6.9E9F3440]
From: Regis Thomas
Sent: Tuesday, July 23, 2024 5:44 AM
To: users@daffodil.apache.org
Cc: 'Johnson, Kirk' (Johnson@ctc.com) <Jo...@ctc.com>; Dave Schloss <da...@nteligen.com>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger,
I re-read through my response yesterday and noticed a couple of errors, I made the corrections in the original text below.
From: Regis Thomas <re...@nteligen.com>>
Sent: Monday, July 22, 2024 3:05 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good afternoon Roger,
When you save the launch config, VS Code writes the selected configuration elements to a file called launch.json in a folder named “.vscode” your workspace directory, but it doesn’t execute the configuration. In a previous screen capture of yours below, it looks like you may not have selected a workspace directory.
Here I opened VS Code and closed all open tabs, then I selected Open Folder from the file menu. I selected a sampleWorkspace directory on my machine.
[cid:image001.png@01DADCC6.2AEB7400]
That directory opens and I can see the files there. Next I click the Run and Debug icon from the actions menu in the panel to the far left to open the Run and Debug panel
[cid:image002.png@01DADCC6.2AEB7400]
When the run and debug panel opens I can select create a launch.json file or I can use CTRL + SHIFT + P
to create a launch.json file.
[cid:image003.png@01DADCC6.2AEB7400]
If I choose the “create a launch.json file link” I’ll get a prompt to select the debugger I want to use, I chose “daffodil” and a default launch.json file is created in a new .vscode directory in my workspace directory. I click the debug and run icon again to open the run and debug panel.
[cid:image004.png@01DADCC6.2AEB7400]
Now, “Ask for File Name” is available in the run and debug dropdown menu. “Ask for File Name” is the default configuration name in the launch.json file. When I press the green triangle/arrow/start icon, the configuration in the launch.json will run.
[cid:image005.png@01DADCC6.2AEB7400]
When the configuration runs, an explorer window will popup to select a schema file.
[cid:image006.png@01DADCC6.2AEB7400]
Then an explorer window will popup to select a data file.
[cid:image007.png@01DADCC6.2AEB7400]
Finally the selected schema will open with a debug control (circled in red) floating above the schema file and it will use the selected data file to produce an infoset. The default launch.json sets the display of the infoset and the display of the data editor windows to false so only the schema file will be open at this time.
[cid:image008.png@01DADCC6.2AEB7400]
If you want to watch the infoset build or see the data as you step through the code, you can edit the launch.json file to do this. First stop the debugger by clicking the red square in the debug controls, then close the schema file. Click the explore icon in the actions panel (left most panel, the icon circled in red that looks like the windows “copy” icon) to view the workspace folder. Click on the .vscode folder if it isn’t open, then click on the launch.json file to open it in the editor. Change the value for openInfoSetView and/or openDataEditor to true to open either or both of those the next time you launch the debugger. Type CTRL + SHIFT + S to save the launch.json file, you’ll be prompted to overwrite the existing file, once the file is saved close the launch.json file.
[cid:image009.png@01DADCC6.2AEB7400]
Then click the run and debug icon in the action panel (far left panel, run and debug icon circled in red) to open the run and debug panel. Click the green triangle/arrow/start button to run the launch.json with your changes. You will be prompted to select the schema and data files again. The schema file will open with the debug control above it. A tab will also open with a blank infoset (if you changed the configuration to open it to true) and a tab with the Data Editor will open in another tab (if you changed the configuration to open it to true). If you chose to open both the infoset and the Data Editor, two windows will show, the schema window and the Data Editor window. If you want to see the infoset instead of the Data Editor, click on the infoset tab. To step through the lines of the schema and watch the infoset build, click on the half circle arrow icon with a dot under it (circled in the debug control above the schema file).
[cid:image010.png@01DADCC6.2AEB7400]
Data Editor tab in view.
[cid:image011.png@01DADCC6.2AEB7400]
If you opened the Data Editor on a Windows machine, a Data Editor server window will also open. When you finish stepping through the schema or you press the red square in the debug controls to stop the debugger, the Data Editor server window will close.
[cid:image012.png@01DADCC6.2AEB7400]
Stepping through the schema view.
[cid:image013.png@01DADCC6.2AEB7400]
If you step through to the end of the schema file, you’ll be prompted to view the infoset, If you select open, the infoset will open along side the temporary infoset. If you click on the explore icon on the actions panel (circled in red at the top of the left most panel, the explorer panel will display. You will see the infoset saved to a new target directory in your workspace directory. You will also see some new log files written to the workspace directory (where these files are written is configurable in the launch.json file).
[cid:image014.png@01DADCC6.2AEB7400]
Next close both infoset windows, leaving open only the schema file. Click copy TDML file in the upper right area above the schema file. You’ll be prompted to name the TDML file and save it.
[cid:image015.png@01DADCC6.2AEB7400]
It will be saved to your workspace directory
[cid:image016.png@01DADCC6.2AEB7400]
The next time you want to use the same schema and data file click the tdml file from the explorer tab to open the file, then select Execute TDML from the top right (due to a timing bug that hasn’t been resolved yet, you will need to quickly hit the enter key to two prompts that appear above the tdml file window after clicking the execute button).
[cid:image017.png@01DADCC6.2AEB7400]
The previously selected schema file will open for debugging with the previously select datafile along with a new temporary infoset file window.
[cid:image018.png@01DADCC6.2AEB7400]
Note: IF you select CLTR_SHIFT+P to configure the launch.json instead, all the above options are available, they will be presented in a form format rather than as a json file. but make sure you have selected a folder as the workspace before pressing CTRL+SHIFT+P. Also the “save” button at the end of the configuration screen saves the selected configuration to a launch.json file in the .vscode directory of your workspace, but does not launch the debugger.
Hope this helps!
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Monday, July 22, 2024 10:04 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image020.png@01DADCC6.2AEB7400]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image021.png@01DADCC6.2AEB7400]
6. I selected my input file:
[cid:image022.png@01DADCC6.2AEB7400]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image023.png@01DADCC6.2AEB7400]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image024.png@01DADCC6.2AEB7400]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image025.png@01DADCC6.2AEB7400]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image026.png@01DADCC6.2AEB7400]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image027.png@01DADCC6.2AEB7400]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image028.png@01DADCC6.2AEB7400]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image029.png@01DADCC6.2AEB7400]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image030.png@01DADCC6.2AEB7400]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image031.png@01DADCC6.2AEB7400]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image032.png@01DADCC6.2AEB7400]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Regis Thomas <re...@nteligen.com>.
Good morning Roger,
I re-read through my response yesterday and noticed a couple of errors, I made the corrections in the original text below.
From: Regis Thomas <re...@nteligen.com>
Sent: Monday, July 22, 2024 3:05 PM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good afternoon Roger,
When you save the launch config, VS Code writes the selected configuration elements to a file called launch.json in a folder named “.vscode” your workspace directory, but it doesn’t execute the configuration. In a previous screen capture of yours below, it looks like you may not have selected a workspace directory.
Here I opened VS Code and closed all open tabs, then I selected Open Folder from the file menu. I selected a sampleWorkspace directory on my machine.
[cid:image015.png@01DADCC2.D59663A0]
That directory opens and I can see the files there. Next I click the Run and Debug icon from the actions menu in the panel to the far left to open the Run and Debug panel
[cid:image016.png@01DADCC2.D59663A0]
When the run and debug panel opens I can select create a launch.json file or I can use CTRL + SHIFT + P
to create a launch.json file.
[cid:image017.png@01DADCC2.D59663A0]
If I choose the “create a launch.json file link” I’ll get a prompt to select the debugger I want to use, I chose “daffodil” and a default launch.json file is created in a new .vscode directory in my workspace directory. I click the debug and run icon again to open the run and debug panel.
[cid:image018.png@01DADCC2.D59663A0]
Now, “Ask for File Name” is available in the run and debug dropdown menu. “Ask for File Name” is the default configuration name in the launch.json file. When I press the green triangle/arrow/start icon, the configuration in the launch.json will run.
[cid:image019.png@01DADCC2.D59663A0]
When the configuration runs, an explorer window will popup to select a schema file.
[cid:image020.png@01DADCC2.D59663A0]
Then an explorer window will popup to select a data file.
[cid:image021.png@01DADCC2.D59663A0]
Finally the selected schema will open with a debug control (circled in red) floating above the schema file and it will use the selected data file to produce an infoset. The default launch.json sets the display of the infoset and the display of the data editor windows to false so only the schema file will be open at this time.
[cid:image022.png@01DADCC2.D59663A0]
If you want to watch the infoset build or see the data as you step through the code, you can edit the launch.json file to do this. First stop the debugger by clicking the red square in the debug controls, then close the schema file. Click the explore icon in the actions panel (left most panel, the icon circled in red that looks like the windows “copy” icon) to view the workspace folder. Click on the .vscode folder if it isn’t open, then click on the launch.json file to open it in the editor. Change the value for openInfoSetView and/or openDataEditor to true to open either or both of those the next time you launch the debugger. Type CTRL + SHIFT + S to save the launch.json file, you’ll be prompted to overwrite the existing file, once the file is saved close the launch.json file.
[cid:image023.png@01DADCC2.D59663A0]
Then click the run and debug icon in the action panel (far left panel, run and debug icon circled in red) to open the run and debug panel. Click the green triangle/arrow/start button to run the launch.json with your changes. You will be prompted to select the schema and data files again. The schema file will open with the debug control above it. A tab will also open with a blank infoset (if you changed the configuration to open it to true) and a tab with the Data Editor will open in another tab (if you changed the configuration to open it to true). If you chose to open both the infoset and the Data Editor, two windows will show, the schema window and the Data Editor window. If you want to see the infoset instead of the Data Editor, click on the infoset tab. To step through the lines of the schema and watch the infoset build, click on the half circle arrow icon with a dot under it (circled in the debug control above the schema file).
[cid:image024.png@01DADCC2.D59663A0]
Data Editor tab in view.
[cid:image025.png@01DADCC2.D59663A0]
If you opened the Data Editor on a Windows machine, a Data Editor server window will also open. When you finish stepping through the schema or you press the red square in the debug controls to stop the debugger, the Data Editor server window will close.
[cid:image026.png@01DADCC2.D59663A0]
Stepping through the schema view.
[cid:image027.png@01DADCC2.D59663A0]
If you step through to the end of the schema file, you’ll be prompted to view the infoset, If you select open, the infoset will open along side the temporary infoset. If you click on the explore icon on the actions panel (circled in red at the top of the left most panel, the explorer panel will display. You will see the infoset saved to a new target directory in your workspace directory. You will also see some new log files written to the workspace directory (where these files are written is configurable in the launch.json file).
[cid:image028.png@01DADCC2.D59663A0]
Next close both infoset windows, leaving open only the schema file. Click copy TDML file in the upper right area above the schema file. You’ll be prompted to name the TDML file and save it.
[cid:image030.png@01DADCC2.D59663A0]
It will be saved to your workspace directory
[cid:image031.png@01DADCC2.D59663A0]
The next time you want to use the same schema and data file click the tdml file from the explorer tab to open the file, then select Execute TDML from the top right (due to a timing bug that hasn’t been resolved yet, you will need to quickly hit the enter key to two prompts that appear above the tdml file window after clicking the execute button).
[cid:image033.png@01DADCC2.D59663A0]
The previously selected schema file will open for debugging with the previously select datafile along with a new temporary infoset file window.
[cid:image034.png@01DADCC2.D59663A0]
Note: IF you select CLTR_SHIFT+P to configure the launch.json instead, all the above options are available, they will be presented in a form format rather than as a json file. but make sure you have selected a folder as the workspace before pressing CTRL+SHIFT+P. Also the “save” button at the end of the configuration screen saves the selected configuration to a launch.json file in the .vscode directory of your workspace, but does not launch the debugger.
Hope this helps!
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Monday, July 22, 2024 10:04 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image036.png@01DADCC2.D59663A0]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image037.png@01DADCC2.D59663A0]
6. I selected my input file:
[cid:image038.png@01DADCC2.D59663A0]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image039.png@01DADCC2.D59663A0]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image040.png@01DADCC2.D59663A0]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image041.png@01DADCC2.D59663A0]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image042.png@01DADCC2.D59663A0]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image043.png@01DADCC2.D59663A0]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image044.png@01DADCC2.D59663A0]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image045.png@01DADCC2.D59663A0]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image046.png@01DADCC2.D59663A0]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image047.png@01DADCC2.D59663A0]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image048.png@01DADCC2.D59663A0]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Regis Thomas <re...@nteligen.com>.
Good afternoon Roger,
When you save the launch config, VS Code writes the selected configuration elements to a file called launch.json in a folder named “.vscode” your workspace directory, but it doesn’t execute the configuration. In a previous screen capture below, it looks like you may not have selected a workspace directory.
Here I opened VS Code and closed all open tabs, then I selected Open Folder from the file menu. I selected a sampleWorkspace directory on my machine.[cid:image015.png@01DADC35.DC265CD0]
That directory opens and I can see the files there. Next I click the Run and Debug icon from the actions menu in the panel to the far left to open the Run and Debug panel
[cid:image016.png@01DADC36.95E15C10]
When the run and debug panel opens I can select create a launch.json file or I can use CTRL + SHIFT + P
to create a launch.json file.
[cid:image017.png@01DADC37.14998B90]
If I choose the “create a launch.json file link” I’ll get a prompt to select the debugger I want to use, I chose “daffodil” and a default launch.json file is created in a new .vscode directory in my workspace directory. I click the debug and run icon again to open the run and debug panel.
[cid:image018.png@01DADC38.F11F2380]
Now, “Ask for File Name” is available in the run and debug dropdown menu. “Ask for File Name” is the default configuration name in the launch.json file. When I press the green triangle/arrow/start icon, the configuration in the launch.json will run.
[cid:image019.png@01DADC39.8AA9EE90]
When the configuration runs, an explorer window will popup to select a schema file.
[cid:image020.png@01DADC3A.0210A4B0]
Then an explorer window will popup to select a data file.
[cid:image021.png@01DADC3A.0210A4B0]
Finally the selected schema will open with a debug control (circled in red) at the top and it will use the selected data file to produce an infoset. The default launch.json sets the display of the infoset and the display of the data editor to false so only the schema file will be open at this time.
[cid:image022.png@01DADC3B.209EF340]
If you want to watch the infoset build or see the data as you step through the code, you can edit the launch.json file to do this. First stop the debugger by clicking the red triangle in the debug controls, then close the schema file.
Click the explore icon in the actions panel (left most panel, the icon circled in red that looks like the windows “copy” icon) to view the workspace folder. Click on the .vscode folder if it isn’t open, then click on the launch.json file to open it in the editor. Change the value for openInfoSetView and/or openDataEditor to true to open either or both of those the next time you launch the debugger. Type CTRL + SHIFT + S to save the lhe Launch.json file, you’ll be prompted to overwrite the existing file, once the file is saved close the launch.json file.
[cid:image023.png@01DADC3C.0C590500]
Then click the run and debug icon in the action panel (far left panel, run and debug icon circled in red) to open the run and debug panel. Click the green triangle/arrow/start button to run the launch.json with your changes. You will be prompted to select the schema and data files again. The schema file will open with the debug control above it. A tab will also open with a blank infoset (if you changed the configuration to open it to true) and a tab with the Data Editor will open in another tab (if you changed the configuration to open it to true). If you chose to open both the infoset and the Data Editor, two windows will show, the schema window and the Data Editor window. If you want to see the infoset instead of the Data Editor, click on the infoset tab. To step through the lines of the schema and watch the dataset build, click on the half circle arrow icon with a dot under it (circled in the debug control above the schema file).
[cid:image024.png@01DADC3E.7F89C7B0]
Data Editor tab in view.
[cid:image025.png@01DADC3F.9F18E470]
If you opened the Data Editor on a Windows machine, a Data Editor server window will also open. When you finish stepping through the schema or you press the red square in the debug controls to stop the debugger, the Date Editor server window will close.
[cid:image026.png@01DADC3F.F6D05630]
Stepping through the schema view.
[cid:image027.png@01DADC3F.F6D05630]
If you step through the to the end of the schema file, you’ll be prompted to view the infoset, If you select open, the infoset will open along side the temporary infoset. If you click on the explore icon (circled in red at the top of the left most panel, the explorer panel will display. You will see the infoset saved to a new target directory in your workspace directory. You will also see some new log files written to the workspace directory (where these files are written to can be changed in the launch.json file).
[cid:image028.png@01DADC41.6ABFA360]
Next close both infoset windows, leaving open only the schema file. Click copy TDML file in the upper right area above the schema file. You’ll be prompted to name the TDML file and save it.
[cid:image030.png@01DADC43.18E68110]
It will be saved to you workspace directory
[cid:image031.png@01DADC43.18E68110]
The next time you want to use the same schema and data file click the tdml file from the explorer tab to open the file, then select Execute TDML form the top right (you will need to quickly hit the enter key to two prompts due to a timing bug that hasn’t been resolved yet).
[cid:image029.png@01DADC44.0451FDA0]
The previously selected schema file will open to debugging with the previously select datafile.
[cid:image032.png@01DADC47.801305D0]
Note: IF you select CLTR_SHIFT+P to configure the launch.json, all the above options are available, but make sure you have selected a folder as the workspace before pressing CTRL+SHIFT+P. Also the “save” button at the end of the configuration screen saves the selected configuration to a launch.json file in the .vscode directory of your workspace, but does not launch the debugger.
Hope this helps!
Rege
From: Roger L Costello <co...@mitre.org>
Sent: Monday, July 22, 2024 10:04 AM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image002.png@01DADC34.127FB3A0]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image003.png@01DADC34.127FB3A0]
6. I selected my input file:
[cid:image004.png@01DADC34.127FB3A0]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image005.png@01DADC34.127FB3A0]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image006.png@01DADC34.127FB3A0]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image007.png@01DADC34.127FB3A0]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Cc: Johnson, Kirk <jo...@ctc.com>>; Dave Schloss <da...@nteligen.com>>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image008.png@01DADC34.127FB3A0]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image009.png@01DADC34.127FB3A0]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image010.png@01DADC34.127FB3A0]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image011.png@01DADC34.127FB3A0]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image012.png@01DADC34.127FB3A0]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image013.png@01DADC34.127FB3A0]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image014.png@01DADC34.127FB3A0]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Roger L Costello <co...@mitre.org>.
Hi Regis,
Thank you for your helpful instructions. Unfortunately, I still am unable to create the launch.json file. Let me show you—through a series of screenshots—exactly what I did. Perhaps you will see where I went astray.
1. I opened Visual Studio Code from the Windows Start icon. I closed the Welcome tab.
2. There is a tab containing the DFDL schema that I had opened the last time:
[Text Description automatically generated]
3. In the bottom right corner I see “dfdl”. When I hover over it, I see “Select Language Mode”. Yea! This is good.
4. I typed CTRL+Shift+P and then typed at the search bar: Daffodil. I selected Configure launch.json:
[cid:image002.png@01DADC1E.8038B2E0]
5. I clicked on the Browse button at “Absolute path to the input data file”:
[cid:image003.png@01DADC1E.8038B2E0]
6. I selected my input file:
[cid:image004.png@01DADC1E.8038B2E0]
7. The result? Nothing happened, i.e., the path to my input file did not appear in the text field:
[cid:image005.png@01DADC1E.8038B2E0]
8. Ignoring that problem, I scrolled down and selected the Open Infoset View box:
[cid:image006.png@01DADC1E.8038B2E0]
9. Now I will try to save my settings. I scrolled down to the bottom and clicked on the Save button:
[cid:image014.png@01DADC1E.8038B2E0]
Bummer. What to do?
From: Regis Thomas <re...@nteligen.com>
Sent: Friday, July 19, 2024 7:57 AM
To: users@daffodil.apache.org
Cc: Johnson, Kirk <jo...@ctc.com>; Dave Schloss <da...@nteligen.com>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Good morning Roger, Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image015.png@01DADC1E.8038B2E0]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image016.png@01DADC1E.8038B2E0]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image017.png@01DADC1E.8038B2E0]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image018.png@01DADC1E.8038B2E0]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image019.png@01DADC1E.8038B2E0]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image020.png@01DADC1E.8038B2E0]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image021.png@01DADC1E.8038B2E0]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Regis Thomas <re...@nteligen.com>.
Good morning Roger,
Sorry you are still having problems. It seems there are two issues here. VS Code has its own learning curve, it is a product in it’s own right. The daffodil extension is a plugin that utilizes the elements already built in to VS Code. Microsoft has various tutorials for getting started and learning to use VS Code at https://code.visualstudio.com/learn.
Some things that are VS Code specific are:
The Welcome tab
The basic screen layout (although highly configurable)
The tool bar at the top of the app
The icons at the far right top of the tool bar
The activity bar at the left most position on the screen (although the position is configurable)
Many of the menu Icons that appear to the upper right corner of the file screen(s) below the tool bar
The Command Palette (accessed with CTRL+Shift+P)
And many other elements
As an almost daily user of VS Code, my earlier reply left out the steps that I think of as part of VS Code, that would be common to any development language.
Here are some of the additional steps or information I left out.
First, once you have the daffodil VS Code extension installed, you can open a schema file and use the extension’s intellisense capability without setting up the debugger to open a file. As long as the language mode in the lower right corner is set to dfdl the daffodil intellisense will be enabled (the dfdl language mode is set automatically when you open a .dfdl.xsd file in most environments, but no all).
One VS Code best features is it can be used in almost any environment, but default functionality depends on the environment.
This step is specific to the daffodil extension:
If you want to use the debugger to step through the schema lines and observe what is written to the infoset at each step and/ or also observer what byte of the data file is being processed and the value of that data at each step, then you need to use the launch.json file to configure the debug process. In the configuration file, you can indicate whether you want to open the infoset to watch as it creates (openInfosetView=true), you also indicate whether you to open the data file to see the byte position and value at each step (openDataEditor=true). You can also indicate you want to see a diff of the original schema as you are editing it (openInfosetDiffView=true). Along with other options such as hard coding the schema file and the data file. As an FYI the infoset format can be changed from “xml” to “json” in the data section also. if desired . The default value in the launch json is to “ask” for the schema and data files by popping up a file explorer dialog to select the files you want to use. If the value of path in the schema configuration is “${command:AskForSchemaName}” and the value for the path in the data configuration is “${command:AskForDataName}” you will be prompted with file explorer dialog boxes to choose the schema file and the data file. The path and file name for the infoset file and the path and file name for logging of the data editor and debugger information are prefilled/hardcoded, but can be modified to whatever you wish.
After configuring and saving the launch.json file, navigate to the activity bar on the left of the screen with the magnifying glass icon and the icon of a triangle with a bug in the lower corner. To launch the debugger with the saved launch.json configuration, click on the “triangle with a bug” icon. The second panel on the left will change to the debug panel. At the top of the panel where it says “RUN AND DEBUG” there will be dropdown with the name of the configuration from the launch.json file that was previously saved. Click on that configuration name and the files you configured will open in VS Code. Any screen already opened will stay opened, but the screen(s) for the files you configured to open will be visible, and only the tabs for the other files will be visible.
The default is to open two screens side by side. If you opened more than two files and/or if there were previously opened files, including the welcome screen, the file(s) not visible can be made visible by clicking on the tab of that file across the top of the screen. Or you can configure VS Code to open more files side by side.
I hope this helps to at least get you started.
Rege
From: Roger L Costello <co...@mitre.org>
Sent: Thursday, July 18, 2024 7:23 AM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image007.png@01DAD9A8.473ACD20]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image008.png@01DAD9A8.473ACD20]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image009.png@01DAD9A8.473ACD20]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image010.png@01DAD9A8.473ACD20]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image011.png@01DAD9A8.473ACD20]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image012.png@01DAD9A8.473ACD20]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image013.png@01DAD9A8.473ACD20]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Roger L Costello <co...@mitre.org>.
July 18, 2024
1. I opened Visual Studio Code from the Windows Start icon. The result is a screen filled with a bewildering amount of stuff. I don’t know what all that stuff is for. I’ll ignore it. (Oh, it’s the Welcome tab)
2. I selected File >> Open file to open an example DFDL Schema that I have. My schema appears in the right panel.
3. It seems that the tool has remembered my last session because now I have two copies (two tabs) of my schema. I’ll close one of them and close the Welcome tab.
4. Regis wrote: You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json. Apparently this launch.json thingy is important. Okay, I entered Ctrl+Shift+P which resulted in a popup menu appearing, with a search bar at top; I started typing Configure lau and that resulted in the appearance of Daffodil Debug: Configure Launch Json:
[cid:image007.png@01DAD8E3.4ECACBA0]
5. I selected it and that opened a tab labelled Launch Config Wizard. Lots of stuff in this tab. I entered the path to my input file: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\input\repeating-label-message-characterization-1.txt
And I entered the path to my DFDL schema: C:\Users\costello\Documents\BACKUP\DFDL\daffodil\daffodil-2.5.0-incubating\DFDL-class\examples\repeating-label-message\repeating-label-message-characterization-1.dfdl.xsd
Then I pressed the Save button. Nothing happened.
I am lost. Again. This is frustrating. Lots of time spent. No results.
From: Regis Thomas <re...@nteligen.com>
Sent: Tuesday, July 9, 2024 3:31 PM
To: users@daffodil.apache.org
Subject: [EXT] RE: My notes on my (failed) attempt to use DFDL VS Code
Hello Roger, I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch. json file to false in order to successfully open the dfdl schema and the data
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the “use existing server” value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don’t see any way to select “mode”.
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image001.png@01DAD8E2.2C8122C0]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn’t set the “mode” in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image002.png@01DAD8E2.2C8122C0]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a “launch configuration”. Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There’s a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don’t have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image003.png@01DAD8E2.2C8122C0]
10. Unfortunately, the instructions are for creating a “launch configuration” for debugging. I don’t want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image004.png@01DAD8E2.2C8122C0]
12. I selected Run >> Run Without Debugging and got this error box:
I don’t know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image005.png@01DAD8E2.2C8122C0]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image006.png@01DAD8E2.2C8122C0]
I changed all the backslashes to forward slashes. Now I don’t get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn’t matter, but I’m not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I’m stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Regis Thomas <re...@nteligen.com>.
Hello Roger,
I loaded the VSIX file in VS Code in my Windows 10 environment. I noticed that I had to change the "use existing server" value in the Launch.json file to false in order to successfully open the dfdl schema and the data file.
Rege
From: Regis Thomas <re...@nteligen.com>
Sent: Tuesday, July 9, 2024 9:51 AM
To: users@daffodil.apache.org
Subject: RE: My notes on my (failed) attempt to use DFDL VS Code
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com<ma...@nteligen.com>
From: Roger L Costello <co...@mitre.org>>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don't see any way to select "mode".
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image001.png@01DAD214.EDBB87C0]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn't set the "mode" in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image002.png@01DAD214.EDBB87C0]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a "launch configuration". Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There's a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don't have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image003.png@01DAD214.EDBB87C0]
10. Unfortunately, the instructions are for creating a "launch configuration" for debugging. I don't want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image004.png@01DAD214.EDBB87C0]
12. I selected Run >> Run Without Debugging and got this error box:
I don't know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image005.png@01DAD214.EDBB87C0]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image006.png@01DAD214.EDBB87C0]
I changed all the backslashes to forward slashes. Now I don't get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn't matter, but I'm not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I'm stuck.
RE: My notes on my (failed) attempt to use DFDL VS Code
Posted by Regis Thomas <re...@nteligen.com>.
Good Morning Roger,
Thanks for trying the vscode extension. I replied to your comments in red below. Also in the wiki page below, you can click on the bold blue or black headings to get additional information and instructions.
Regis Thomas
Nteligen, LLC
6716 Alexander Bell Drive,
Suite 120
Columbia, MD 20146
(240) 864-5042 x126
regis.thomas@nteligen.com
From: Roger L Costello <co...@mitre.org>
Sent: Tuesday, July 9, 2024 9:09 AM
To: users@daffodil.apache.org
Subject: My notes on my (failed) attempt to use DFDL VS Code
1. I followed the instructions on the web page on the Daffodil VS tool (https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code:-v1.4.0)
2. I downloaded VS Code (https://code.visualstudio.com/download)
3. I installed VS Code (I clicked on the downloaded VSCodeUserSetup-x64-1.91.0.exe file). VS Code was installed here: C:\Users\costello\AppData\Local\Programs\Microsoft VS Code. The installation added Visual Studio Code to my Start Menu. It installed successfully and then automatically opened VS Code.
4. I installed the Apache Daffodil extension to VS Code: I went to the VS Code Extension Marketplace (https://marketplace.visualstudio.com/vscode) and typed this at the search bar: Apache Daffodil. It took about a minute for VS Code to install the Daffodil extension. Pretty long. I was starting to wonder if something was wrong.
5. There were two tabs open in VS Code. I closed them.
6. The instructions say: Since DFDL Schema files end with .xsd (XML Schema Definition or XSD), the editor needs to be informed specifically that DFDL mode is desired over the more general XML mode. The mode is selected in the status bar at the bottom of the editor window. I see the status bar at the bottom, but I don't see any way to select "mode".
A schema file needs to be in the window before the mode can be set. I some environments the dfdl mode is set automatically. It may depend on whether other extension that handle XML are also installed.
[cid:image001.png@01DAD1E1.C3A4B890]
7. I selected File >> Open file to open an example DFDL Schema that I have. As best I can tell, the editor is DFDL-aware even though I didn't set the "mode" in Step 6.
8. I positioned my cursor within a <xs:sequence> element and hit the space bar. I list of DFDL properties available popped up (nice!):
[cid:image002.png@01DAD1E1.C3A4B890]
9. Next, I decided to run Daffodil on the DFDL schema (above) and the input file that I have. The instructions (see 1 above) talks about a "launch configuration". Instead of having to select the DFDL Schema and the data file each time from a file picker, a "launch configuration" can be created, which is a JSON description of the debugging session. There's a problem with the instructions:
Currently the launch configuration will work if you have an existing TDML. If you don't have a TDML file you can enter the information in the TDML section of the launch JSON file. See below to create a launch json file.
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
[cid:image003.png@01DAD1E1.C3A4B890]
10. Unfortunately, the instructions are for creating a "launch configuration" for debugging. I don't want to debug, I just want to run my DFDL Schema.
You can create a launch Json file from the vscode palette menu (CTRL+SHIFT+P) and typing config and selecting Daffodil Debug: Configure Launch Json.
11. Once the launch.json file has been created. My VS Code editor named it settings.json, not launch.json:
[cid:image004.png@01DAD1E1.C3A4B890]
12. I selected Run >> Run Without Debugging and got this error box:
I don't know if I have ever tried to run the extension without the debugger. If you choose to run with the debugger, it will pause on the first line of the schema, but you press the continue button on the Debug tool bar to build the infoset without stopping as long as no breakpoints are set.
[cid:image005.png@01DAD1E1.C3A4B890]
I am stuck. As far as I can tell, I cannot run my DFDL Schemas using this tool.
13. In settings.json I hardcoded the path to my DFDL Schema and to my input file:
[cid:image006.png@01DAD1E1.C3A4B890]
I changed all the backslashes to forward slashes. Now I don't get errors. Do I need file:// before C?
I would delete the settings.json file and create the launch.json file. The forward slash or backslash shouldn't matter, but I'm not sure what the setiings.json file might be doing.
14. I again selected Run >> Run Without Debugging and got the same error. Bummer. I'm stuck.