function createDebugRunFileConfigs()

in src/adapter/activateDaffodilDebug.ts [133:209]


function createDebugRunFileConfigs(
  resource: vscode.Uri,
  runOrDebug: String,
  tdmlAction: String | undefined,
  runLast = false
) {
  let targetResource = resource
  let noDebug = runOrDebug === 'run'

  if (!targetResource && vscode.window.activeTextEditor) {
    targetResource = vscode.window.activeTextEditor.document.uri
  }
  if (targetResource) {
    let infosetFile = `${
      path.basename(targetResource.fsPath).split('.')[0]
    }-infoset.xml`
    vscode.window.showInformationMessage(infosetFile)

    let currentConfig = getCurrentConfig()

    if (runLast && currentConfig) {
      vscode.debug.startDebugging(undefined, currentConfig, {
        noDebug: noDebug,
      })
    } else {
      var tdmlConfig = <TDMLConfig>{}

      if (tdmlAction) {
        tdmlConfig.action = tdmlAction

        if (tdmlAction === 'execute') {
          tdmlConfig.name = '${command:AskForTDMLName}'
          tdmlConfig.description = '${command:AskForTDMLDescription}'
          tdmlConfig.path = targetResource.fsPath
        }
      }

      vscode.debug.startDebugging(
        undefined,
        getConfig({
          name: 'Run File',
          request: 'launch',
          type: 'dfdl',
          schema: {
            path: tdmlConfig.action === 'execute' ? '' : targetResource.fsPath,
            rootName: null,
            rootNamespace: null,
          },
          data:
            tdmlConfig.action === 'execute' ? '' : '${command:AskForDataName}',
          debugServer: false,
          infosetFormat: 'xml',
          infosetOutput: {
            type: 'file',
            path: '${workspaceFolder}/' + infosetFile,
          },
          tdmlConfig: tdmlConfig,
        }),
        { noDebug: noDebug }
      )
    }

    vscode.debug.onDidTerminateDebugSession(async () => {
      if (!vscode.workspace.workspaceFolders) {
        return
      }

      vscode.workspace
        .openTextDocument(
          `${vscode.workspace.workspaceFolders[0].uri.fsPath}/${infosetFile}`
        )
        .then((doc) => {
          vscode.window.showTextDocument(doc)
        })
    })
  }
}