shanedell commented on code in PR #664:
URL: https://github.com/apache/daffodil-vscode/pull/664#discussion_r1232492401
##########
src/launchWizard/launchWizard.js:
##########
@@ -18,12 +18,62 @@
// Retrieve vscode api - Doing this multiple times causes issues with the
scripts
const vscode = acquireVsCodeApi()
+// Function to get config index
+function getConfigIndex() {
+ var configSelectionBox = document.getElementById('configSelected')
+ var configSelectedValue =
+ configSelectionBox.options[configSelectionBox.selectedIndex].value
+
+ if (configSelectedValue === 'New Config') {
+ document.getElementById('nameLabel').style =
+ 'margin-top: 10px; visibility: visible;'
+ } else {
+ document.getElementById('nameLabel').style = 'visibility: hidden;'
+ }
+
+ return configSelectedValue === 'New Config'
+ ? -1
+ : configSelectionBox.selectedIndex
+}
+
+// Function get daffodil debug classpath string
+function getDaffodilDebugClasspathString() {
+ let list = document.getElementById('daffodilDebugClasspathTable')
+
+ let daffodilDebugClasspath = ''
+
+ list.childNodes.forEach((childNode) => {
+ let classpath = childNode.textContent
+ .replaceAll(' ', '') // remove any un-needed whitespace
+ .replace('-', '') // remove initial - in front of every item
+ .split('\n')
+ .filter((cp) => cp != '')
+ .join(':')
+
+ if (classpath != '') {
+ daffodilDebugClasspath +=
+ childNode === list.childNodes[list.childNodes.length - 1]
+ ? classpath
+ : classpath + ':'
+ }
+ })
+
+ return daffodilDebugClasspath
+}
+
// Function to call extension to open file picker
function filePicker(id, description) {
+ let extraData = {}
+ if (id === 'daffodilDebugClasspath') {
+ extraData['daffodilDebugClasspath'] = getDaffodilDebugClasspathString()
+ }
+
vscode.postMessage({
Review Comment:
So the reason this happens is because this JS can't have access to some
different items like node packages that the TS code will. So this is needed to
make all functionality work. The JS basically interacts with UI for events,
getting data, etc. Then it sends that data back to the extension TS which takes
care of writing a file, calculation, etc. The TS code then sends back any
needed information to the JS code where it can update the UI with that
information.
--
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]