JeremyYao commented on issue #1540:
URL: 
https://github.com/apache/daffodil-vscode/issues/1540#issuecomment-3563495342

   From main
   
   set breakpoint in 
   
   ```typescript
   // Function for setting up the commands for Run and Debug file
   async function createDebugRunFileConfigs(
     resource: vscode.Uri,
     runOrDebug: String,
     tdmlAction: string | undefined,
     runLast = false
   ) {
     let targetResource: vscode.Uri | undefined = resource
     let noDebug = runOrDebug === 'run'
   
     if (!targetResource) {
       if (vscode.window.activeTextEditor) {
         targetResource = vscode.window.activeTextEditor.document.uri
       } else if (TDMLProvider.getDocumentUri()) {
         targetResource = TDMLProvider.getDocumentUri()
       }
     }
   
     if (targetResource) {
       const normalizedResource = normalizePath(targetResource.fsPath)
   
       let infosetFile = `${
         path.basename(normalizedResource).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 | undefined = undefined
         var newData: string | undefined = undefined
         var newSchema: string | undefined = normalizedResource
   
         if (tdmlAction) {
           tdmlConfig = { action: tdmlAction }
   
           if (tdmlAction === 'execute') {
             tdmlConfig.path = normalizedResource
             newData = undefined
             newSchema = undefined
           }
         }
   
         const config = getConfig({
           name: 'Run File',
           request: 'launch',
           type: 'dfdl',
           schema: {
             path: newSchema,
             rootName: null,
             rootNamespace: null,
           },
           data: newData,
           infosetFormat: 'xml',
           infosetOutput: {
             type: 'file',
             path: '${workspaceFolder}/' + infosetFile,
           },
           ...(tdmlConfig && { tdmlConfig: tdmlConfig }),
         })
   
         vscode.debug.startDebugging(undefined, config, { noDebug: noDebug })
       }
     }
   }
   ```
   
   config value is 
   
   ```JSON
   {
     name: "Run File",
     request: "launch",
     type: "dfdl",
     schema: {
       path: "${command:AskForSchemaName}",
       rootName: null,
       rootNamespace: null,
     },
     infosetFormat: "xml",
     infosetOutput: {
       type: "file",
       path: "${workspaceFolder}/1347-infoset.xml",
     },
     tdmlConfig: {
       action: "execute",
       name: "Default Test Case",
       path: 
"C:\\Users\\jeremy.yao\\repos\\sampleWorkspace\\test_images\\1347.tdml",
     },
     data: "",
     debugServer: 4711,
     stopOnEntry: true,
     useExistingServer: false,
     trace: true,
     openDataEditor: false,
     openInfosetView: false,
     openInfosetDiffView: false,
     daffodilDebugClasspath: [
     ],
     dataEditor: {
       port: 9000,
       logging: {
         file: "${workspaceFolder}/dataEditor-${omegaEditPort}.log",
         level: "info",
       },
     },
     dfdlDebugger: {
       daffodilVersion: "3.11.0",
       timeout: "10s",
       logging: {
         level: "INFO",
         file: "${workspaceFolder}/daffodil-debugger.log",
       },
     },
   }
   ```


-- 
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]

Reply via email to