================
@@ -23,31 +22,41 @@ function createDefaultLLDBDapOptions(): LLDBDapOptions {
return packageJSONExecutable;
}
- try {
- const fileStats = await fs.stat(path);
- if (!fileStats.isFile() && !fileStats.isSymbolicLink()) {
- throw new Error(`Error: ${path} is not a file`);
- }
- } catch (err) {
- const error: Error = err as Error;
- const openSettingsAction = "Open Settings";
- const callBackValue = await vscode.window.showErrorMessage(
- error.message,
- { modal: true },
- openSettingsAction,
- );
- if (openSettingsAction === callBackValue) {
- vscode.commands.executeCommand(
- "workbench.action.openSettings",
- "lldb-dap.executable-path",
- );
- }
- }
+ vscode.workspace.fs.stat(vscode.Uri.file(path)).then(
----------------
walter-erquinigo wrote:
could you make `createDefaultLLDBDapOptions` be an async function so that you
can use `await` instead of `then`? it's way more readable
https://github.com/llvm/llvm-project/pull/104711
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits