This is an automated email from the ASF dual-hosted git repository.

rthomas320 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git


The following commit(s) were added to refs/heads/main by this push:
     new 24f41cb  Fix lstat "" issue and Daffodil Debugger part of `yarn test` 
hanging
24f41cb is described below

commit 24f41cb5409c92ac6eff25e785efb4204c836d2c
Author: Jeremy Yao <[email protected]>
AuthorDate: Thu Nov 6 15:06:15 2025 -0500

    Fix lstat "" issue and Daffodil Debugger part of `yarn test` hanging
    
    Closes #1518
    Closes #1519
---
 src/adapter/activateDaffodilDebug.ts | 63 ++++++------------------------------
 1 file changed, 10 insertions(+), 53 deletions(-)

diff --git a/src/adapter/activateDaffodilDebug.ts 
b/src/adapter/activateDaffodilDebug.ts
index 474dd8f..6fd2095 100644
--- a/src/adapter/activateDaffodilDebug.ts
+++ b/src/adapter/activateDaffodilDebug.ts
@@ -595,11 +595,11 @@ class DaffodilConfigurationProvider
    * Massage a debug configuration just before a debug session is being 
launched,
    * e.g. add all missing attributes to the debug configuration.
    */
-  async resolveDebugConfiguration(
+  resolveDebugConfiguration(
     folder: WorkspaceFolder | undefined,
     config: DebugConfiguration,
     token?: CancellationToken
-  ): Promise<DebugConfiguration | undefined> {
+  ): ProviderResult<DebugConfiguration> {
     // if launch.json is missing or empty
     if (!config.type && !config.request && !config.name) {
       config = getConfig({ name: 'Launch', request: 'launch', type: 'dfdl' })
@@ -609,57 +609,14 @@ class DaffodilConfigurationProvider
       config.debugServer = 4711
     }
 
-    const schemaMissing = !config.schema?.path || config.schema.path === ''
-    const dataMissing = !config.data || config.data === ''
-
-    let schemaPath: string | undefined
-    let dataPath: string | undefined
-
-    // --- If either is missing, always prompt in the correct order ---
-    if (schemaMissing || dataMissing) {
-      // Always prompt for schema first
-      schemaPath = await vscode.commands.executeCommand<string>(
-        'extension.dfdl-debug.getSchemaName'
-      )
-      if (!schemaPath) {
-        return undefined
-      }
-      config.schema.path = schemaPath
-
-      dataPath = await vscode.commands.executeCommand<string>(
-        'extension.dfdl-debug.getDataName'
-      )
-      if (!dataPath) {
-        return undefined
-      }
-      config.data = dataPath
-    }
-
-    // --- Clean up placeholders safely (no accidental empty strings) ---
-    if (config.schema?.path?.includes('${command:AskForSchemaName}')) {
-      if (schemaPath && schemaPath.trim() !== '') {
-        config.schema.path = schemaPath
-      } else {
-        config.schema.path = config.schema.path.replace(
-          '${command:AskForSchemaName}',
-          ''
-        )
-        console.warn(
-          'Schema placeholder removed but no schema file was selected.'
-        )
-      }
-    }
-
-    if (
-      typeof config.data === 'string' &&
-      config.data.includes('${command:AskForDataName}')
-    ) {
-      if (dataPath && dataPath.trim() !== '') {
-        config.data = dataPath
-      } else {
-        config.data = config.data.replace('${command:AskForDataName}', '')
-        console.warn('Data placeholder removed but no data file was selected.')
-      }
+    // default schema path and data paths to ask for file prompts if they are 
null, undefined, or '' in launch.json config
+    config = {
+      ...config,
+      schema: {
+        ...config.schema,
+        path: config.schema?.path || '${command:AskForSchemaName}',
+      },
+      data: config.data || '${command:AskForDataName}',
     }
 
     let dataFolder = config.data

Reply via email to