scholarsmate commented on code in PR #904:
URL: https://github.com/apache/daffodil-vscode/pull/904#discussion_r1413920913
##########
src/launchWizard/launchWizard.js:
##########
@@ -27,15 +27,88 @@ function getConfigIndex() {
if (configSelectedValue === 'New Config') {
document.getElementById('nameLabel').style =
'margin-top: 10px; visibility: visible;'
+ document.getElementById('copyLaunchConfigButton').style =
+ 'visibility: hidden;'
} else {
document.getElementById('nameLabel').style = 'visibility: hidden;'
+ document.getElementById('copyLaunchConfigButton').style =
+ 'visibility: visible;'
}
return configSelectedValue === 'New Config'
? -1
: configSelectionBox.selectedIndex
}
+function getConfigValues() {
+ var configSelectionBox = document.getElementById('configSelected')
+ var configSelectedValue =
+ configSelectionBox.options[configSelectionBox.selectedIndex].value
+ const name =
+ configSelectedValue === 'New Config'
+ ? document.getElementById('name').value
+ : configSelectedValue
+ const data = document.getElementById('data').value
+ const debugServer = parseInt(document.getElementById('debugServer').value)
+ const infosetFormat = document.getElementById('infosetFormat').value
+ const infosetOutputFilePath = document.getElementById(
+ 'infosetOutputFilePath'
+ ).value
+ const infosetOutputType = document.getElementById('infosetOutputType').value
+ const tdmlAction = document.getElementById('tdmlAction').value
+ const tdmlName = document.getElementById('tdmlName').value
+ const tdmlDescription = document.getElementById('tdmlDescription').value
+ const tdmlPath = document.getElementById('tdmlPath').value
+ const openHexView = document.getElementById('openHexView').checked
+ const openInfosetDiffView = document.getElementById(
+ 'openInfosetDiffView'
+ ).checked
+ const openInfosetView = document.getElementById('openInfosetView').checked
+ const program = document.getElementById('program').value
+ const stopOnEntry = document.getElementById('stopOnEntry').checked
+ const trace = document.getElementById('trace').checked
+ const useExistingServer =
document.getElementById('useExistingServer').checked
+ const dataEditorPort = parseInt(
+ document.getElementById('dataEditorPort').value
+ )
+ const dataEditorLogFile = document.getElementById('dataEditorLogFile').value
+ const dataEditorLogLevel =
document.getElementById('dataEditorLogLevel').value
+ const dfdlDebuggerLogFile = document.getElementById(
+ 'dfdlDebuggerLogFile'
+ ).value
+ const dfdlDebuggerLogLevel = document.getElementById(
+ 'dfdlDebuggerLogLevel'
+ ).value
+
+ const daffodilDebugClasspath = getDaffodilDebugClasspathString()
+
+ return [
+ name,
+ data,
+ debugServer,
+ infosetFormat,
+ infosetOutputFilePath,
+ infosetOutputType,
+ tdmlAction,
+ tdmlName,
+ tdmlDescription,
+ tdmlPath,
+ openHexView,
+ openInfosetDiffView,
+ openInfosetView,
+ program,
+ stopOnEntry,
+ trace,
+ useExistingServer,
+ dataEditorPort,
+ dataEditorLogFile,
+ dataEditorLogLevel,
+ dfdlDebuggerLogFile,
+ dfdlDebuggerLogLevel,
+ daffodilDebugClasspath,
+ ]
Review Comment:
This is fragile. Just one value out of place and bad things will happen. I
suggest using key/value pairs so that simple changes or reorderings don't break
in subtle ways.
--
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]