in src/adapter/activateDaffodilDebug.ts [79:144]
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
}
vscode.debug.startDebugging(
undefined,
getConfig({
name: 'Run File',
request: 'launch',
type: 'dfdl',
program: targetResource.fsPath,
data: false,
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)
})
})
}
}