async function getFile()

in src/adapter/activateDaffodilDebug.ts [38:76]


async function getFile(fileRequested, label, title) {
  let file = ''

  if (fileRequested && fs.existsSync(fileRequested)) {
    file = fileRequested
  } else if (fileRequested && !fs.existsSync(fileRequested)) {
    file = ''
  } else {
    file = await vscode.window
      .showOpenDialog({
        canSelectMany: false,
        openLabel: label,
        canSelectFiles: true,
        canSelectFolders: false,
        title: title,
      })
      .then((fileUri) => {
        if (fileUri && fileUri[0]) {
          let path = fileUri[0].fsPath

          if (
            process.platform === 'win32' &&
            path.length > 2 &&
            path.charCodeAt(0) > 97 &&
            path.charCodeAt(0) <= 122 &&
            path.charAt(1) === ':'
          ) {
            path = path.charAt(0).toUpperCase() + path.slice(1)
          }

          return path
        }

        return ''
      })
  }

  return file
}