JeremyYao commented on code in PR #1403:
URL: https://github.com/apache/daffodil-vscode/pull/1403#discussion_r2334345849
##########
src/daffodilDebugger/debugger.ts:
##########
@@ -58,12 +58,18 @@ async function getTDMLConfig(
config.schema.path = ''
config.tdmlConfig.path =
- config.tdmlConfig.path ||
- (await vscode.commands.executeCommand(
- 'extension.dfdl-debug.getValidatedTDMLPath'
- ))
+ config.tdmlConfig.path == '${AskForValidatedTDMLPath}'
+ ? await vscode.commands.executeCommand(
+ 'extension.dfdl-debug.getValidatedTDMLPath'
+ )
+ : config.tdmlConfig.path
- if (!config.tdmlConfig.path) return false
+ if (!config.tdmlConfig.path) {
+ vscode.window.showErrorMessage(
+ `Invalid path TDML Execute path ${config.tdmlConfig.path} was
specified!`
+ )
+ return false
+ }
Review Comment:
@michael-hoke, the condition for user cancelling the user prompt is already
addressed via the if statement block. The prompt handles the invalid path.
Just a quick note for reviews: it would be super helpful if comments are
based on testing the PR first.
##########
src/daffodilDebugger/debugger.ts:
##########
@@ -58,12 +58,18 @@ async function getTDMLConfig(
config.schema.path = ''
config.tdmlConfig.path =
- config.tdmlConfig.path ||
- (await vscode.commands.executeCommand(
- 'extension.dfdl-debug.getValidatedTDMLPath'
- ))
+ config.tdmlConfig.path == '${AskForValidatedTDMLPath}'
+ ? await vscode.commands.executeCommand(
+ 'extension.dfdl-debug.getValidatedTDMLPath'
+ )
+ : config.tdmlConfig.path
- if (!config.tdmlConfig.path) return false
+ if (!config.tdmlConfig.path) {
+ vscode.window.showErrorMessage(
+ `Invalid path TDML Execute path ${config.tdmlConfig.path} was
specified!`
+ )
+ return false
+ }
Review Comment:
Here's a good `launch.json` configuration for you to test locally on your
environment:
```JSON
{
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"type": "dfdl",
"name": "Wizard Config",
"schema": {
"path": "${command:AskForSchemaName}",
"rootName": null,
"rootNamespace": null
},
"data": "${command:AskForDataName}",
"debugServer": 4711,
"infosetFormat": "xml",
"infosetOutput": {
"type": "file",
"path": "${workspaceFolder}/target/infoset.xml"
},
"tdmlConfig": {
"action": "execute",
"path": "${AskForValidatedTDMLPath}",
"name": "Default Test Case"
},
"trace": true,
"stopOnEntry": true,
"useExistingServer": false,
"openDataEditor": false,
"openInfosetView": false,
"openInfosetDiffView": false,
"daffodilDebugClasspath": [],
"dataEditor": {
"port": 9000,
"logging": {
"file":
"${workspaceFolder}/dataEditor-${omegaEditPort}.log",
"level": "info"
}
},
"dfdlDebugger": {
"logging": {
"file": "${workspaceFolder}/daffodil-debugger.log",
"level": "INFO"
}
}
}
]
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]