Open amylizzle opened 1 month ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.92.1. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
The task provider is providing this CustomExecution
which is running, but the ProcessExecution
doesn't run the executable and onDidEndTaskProcess()
doesn't fire until you terminate the task.
getCompilerExecution(dme: string): vscode.CustomExecution {
return new vscode.CustomExecution(
async (resolvedDefinition): Promise<vscode.Pseudoterminal> => {
await this.updateOpenDreamBinary(this.path);
const writeEmitter = new vscode.EventEmitter<string>();
const closeEmitter = new vscode.EventEmitter<number>();
const pty: vscode.Pseudoterminal = {
onDidWrite: writeEmitter.event,
onDidClose: closeEmitter.event,
open: () => { },
close: () => { }
};
let PE = new ProcessExecution(`${this.path}/DMCompiler_${getArchSuffix()}/DMCompiler${os.platform() === "win32" ? ".exe" : ""}`, [
dme,
]);
const task = new vscode.Task(
resolvedDefinition,
vscode.TaskScope.Workspace,
'compiler',
'custom',
PE
);
vscode.tasks.executeTask(task).then((t) => {
writeEmitter.fire('Process execution started.\r\n');
// Listen for task process end event
const disposable = vscode.tasks.onDidEndTaskProcess((event) => {
if (event.execution === t) {
if (event.exitCode === 0) {
writeEmitter.fire('Process execution completed successfully.\r\n');
closeEmitter.fire(0);
} else {
writeEmitter.fire(`Process execution failed with exit code ${event.exitCode}.\r\n`);
closeEmitter.fire(event.exitCode || 1);
}
disposable.dispose();
}
});
}, (error) => {
writeEmitter.fire(`Process execution failed: ${error}\r\n`);
closeEmitter.fire(1);
});
return pty;
});
}
We found a workaround https://github.com/OpenDreamProject/vscode-opendream/pull/5
and you're sure this is new behavior as of 1.92? I'm not sure of any changes that could explain this
Oh sorry, no we tried rolling back and still encountered the issue. Honestly I'm not even sure how the extension ever worked in the first place. It seems like starting a Task from inside another Task just doesn't work randomly, it was very inconsistent.
Thanks for the info. Glad you found a workaround because honestly not sure when I will get to this, but your detailed report will help
Does this issue occur when all extensions are disabled?: No
Steps to Reproduce:
test.dme
The OpenDream binaries are downloaded, and then this occurs:
The extension seemed to be working fine (and does so on my laptop still) but other computers (also linux based) are encountering the same bug. It is unclear why.