apache / apache/daffodil-vscode

TDML: Temp generatedTDML.tdml file in user's temp directory has incorrect paths if launch.json configuration specifies absolute paths

Open
#1,289 1 comment 0 reactions 0 assignees View on GitHub
bug TDML
Dominant language
TypeScript
Stars
18
Forks
33
Avg merge
3d 6h
Merged PRs (30d)
7

Description

### Versions

- 1.4.0 (VS Code marketplace install)
- 1.4.1 rc1

Ran on both versions to verify it existed in 1.4.0 and not a 1.4.1 bug.

### Description

If a launch.json configuration has file paths for the schema and/or data that are absolute paths, the generatedTDML.tdml file in the user's temp folder contains invalid paths. This affects TDML functionality like Copy TDML and Append TDML as it relies on the paths in generatedTDML.tdml being correct.

Comparing and contrasting the resultant generatedTDML.tdml files with absolute and relative paths. It seems like generatedTDML.tdml generates correctly for relative paths where the relative paths are valid per PowerShell's `Test-Path` tests.

### How I replicated the issue

In your launch.json, have a configuration with absolute paths for data and the schema. My configuration item that I used looks like
```JSON
{
"request": "launch",
"type": "dfdl",
"name": "Absolute_Path",
"schema": {
"path": "c:\\Users\\jeremy.yao\\repos\\sampleWorkspace\\2_pass\\read_number.dfdl.xsd",
"rootName": null,
"rootNamespace": null
},
"data": "c:\\Users\\jeremy.yao\\repos\\sampleWorkspace\\2_pass\\6ints.txt",
"debugServer": 4711,
"infosetFormat": "xml",
"infosetOutput": {
"type": "file",
"path": "${workspaceFolder}/target/infoset.xml"
},
"tdmlConfig": {
"action": "generate",
"name": "undefined",
"description": "undefined",
"path": "undefined"
},
"trace": true,
"stopOnEntry": true,
"useExistingServer": false,
"openDataEditor": false,
"openInfosetView": false,
"openInfosetDiffView": false,
"daffodilDebugClasspath": [],
"dataEditor": {
"port": 7777,
"logging": {
"file": "${workspaceFolder}/dataEditor-${omegaEditPort}.log",
"level": "info"
}
},
"dfdlDebugger": {
"logging": {
"file": "${workspaceFolder}/daffodil-debugger.log",
"level": "INFO"
}
}
},
```

The contents of my generatedTDML.tdml is
```XML



..\..\..\/c:/Users/jeremy.yao/repos/sampleWorkspace/2_pass/6ints.txt


..\..\..\repos/sampleWorkspace/target/infoset.xml

```

### Configuration + generatedTDML w/ Relative Paths (working and has valid paths)

Launch.json configuration item example
```JSON
{
"request": "launch",
"type": "dfdl",
"name": "Cat_DFDL",
"schema": {
"path": "${workspaceFolder}/src/main/resources/com/mitre/jpeg/xsd/jpeg.dfdl.xsd",
"rootName": null,
"rootNamespace": null
},
"data": "${workspaceFolder}/test_images/curious-cat-thumb.jpg",
"debugServer": 4712,
"infosetFormat": "xml",
"infosetOutput": {
"type": "file",
"path": "${workspaceFolder}/target/infoset.xml"
},
"tdmlConfig": {
"action": "generate",
"path": "undefined",
"name": "skbidi",
"description": "skbidi"
},
"trace": true,
"stopOnEntry": true,
"useExistingServer": false,
"openDataEditor": true,
"openInfosetView": false,
"openInfosetDiffView": false,
"daffodilDebugClasspath": [],
"dataEditor": {
"port": 9090,
"logging": {
"file": "${workspaceFolder}/dataEditor-${omegaEditPort}.log",
"level": "info"
}
},
"dfdlDebugger": {
"logging": {
"file": "./daffodil-debugger.log",
"level": "INFO"
}
}
}
```

generatedTDML.tdml

```XML



..\..\..\repos/sampleWorkspace/test_images/curious-cat-thumb.jpg


..\..\..\repos/sampleWorkspace/target/infoset.xml

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the launch.json handling and generatedTDML.tdml generation in the TypeScript extension. Reproduce the issue with the absolute-path and relative-path configurations shown, then verify that generatedTDML.tdml preserves valid paths for the schema, data, and infoset output.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.