apache / daffodil-vscode

Apache Daffodil™ Extension for Visual Studio Code
https://daffodil.apache.org/
Apache License 2.0
10 stars 20 forks source link

Fix TDML Copy, Execute and Append functionality in MacOS Platform #1035

Open hdalsania opened 1 month ago

hdalsania commented 1 month ago

TDML Copy, Execute and Append functionality is broken since inception of the TDML GUI editor (PR# 936).

Fix the default settings for test case name, description and path as it is showing as "Undefined" in Launch.json file.

The Copy TDML File button exists but will not save the .tdml file anywhere once the data debugger is finished and I attempt to save.

VSCode Debug Output

simulatorDirPath: undefined
deviceFilePath: undefined
simulatorDirPath: undefined
deviceFilePath: undefined
detected java homes: [{"path":"/Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/Home","version":"11.0.16","security":0,"isJDK":true,"is64Bit":true,"executables":{"java":"/Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/Home/bin/java","javac":"/Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/Home/bin/javac","javap":"/Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/Home/bin/javap"}},{"path":"/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home","version":"11.0.16","security":0,"isJDK":true,"is64Bit":true,"executables":{"java":"/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home/bin/java","javac":"/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home/bin/javac","javap":"/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home/bin/javap"}},{"path":"/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home","version":"1.8.0","security":302,"isJDK":true,"is64Bit":true,"executables":{"java":"/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/bin/java","javac":"/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/bin/javac","javap":"/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/bin/javap"}}]
choosing java home at /Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/Home, version 11.0.16, is at least JDK 17: false
No test suite found in source XML buffer

The output line: No test suite found in source XML buffer gets outputted every time I attempt to save the generate .tdml file via Copy TDML File.

Originally posted by @stricklandrbls in https://github.com/apache/daffodil-vscode/issues/1022#issuecomment-2135799767

@stricklandrbls did a little digging and running the extension in debug mode w/ breakpoints. It looks like this is coming from this scope of code:

https://github.com/apache/daffodil-vscode/blob/5bd426e1dbdf25b40193ba0a2eb17dbc9d861ba1/src/tdmlEditor/utilities/tdmlXmlUtils.ts#L277-L295

I think it has something to do with this function being async but not returning a Promise because this block of code throws with all of the scoped variables being undefined or uninitialized.

Originally posted by @stricklandrbls in https://github.com/apache/daffodil-vscode/issues/1022#issuecomment-2136309539