Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "artificial-debug-extension",
"displayName": "Artificial Inc. Workflow Debugger VSCode Extension",
"version": "1.2.0",
"version": "1.2.1",
"publisher": "artificial",
"description": "Enables debugging of Artificial, Inc. Workflows.",
"author": {
Expand Down
19 changes: 12 additions & 7 deletions src/activateWorkflowDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ArtificialWorkflowDebugConfigurationProvider implements vscode.DebugConfig
* Massage a debug configuration just before a debug session is being launched,
* e.g. add all missing attributes to the debug configuration.
*/
resolveDebugConfiguration(folder: WorkspaceFolder | undefined, config: DebugConfiguration, token?: CancellationToken): ProviderResult<DebugConfiguration> {
async resolveDebugConfiguration(folder: WorkspaceFolder | undefined, config: DebugConfiguration, token?: CancellationToken): Promise<DebugConfiguration | undefined> {

// if launch.json is missing or empty
if (!config.type && !config.request && !config.name) {
Expand All @@ -58,19 +58,24 @@ class ArtificialWorkflowDebugConfigurationProvider implements vscode.DebugConfig
}

if (!config.program) {
return vscode.window.showInformationMessage("Cannot find a program to debug").then(_ => {
return undefined; // abort launch
});
await vscode.window.showErrorMessage("Cannot find a program to debug");
return undefined; // abort launch
}

if (config.type == 'attach' && !config.jobId && !config.jobName) {
return vscode.window.showInformationMessage("jobId or jobName must be specified in attach config").then(_ => {
return undefined; // abort launch
});
await vscode.window.showErrorMessage("jobId or jobName must be specified in attach config");
return undefined;
}

config.envFile = config.envFile ?? vscode.workspace.getConfiguration('artificial.workflow.debug').envFilePath

try {
await vscode.workspace.fs.stat(vscode.Uri.parse('file:///home/code/.local/bin/wfdebug'));
}
catch (ex: any) {
const fileSystemError: vscode.FileSystemError = ex;
vscode.window.showWarningMessage(`Cannot access wfdebug utility; please ensure that the artificial-debug-adapter package is installed. Error: ${fileSystemError.message}`);
}
return config;
}
}
Expand Down