in src/main.ts [172:205]
function generateHandleServerProviderEvent() {
let dots = 0;
return (e: string, ...args: any[]) => {
switch (e) {
case Events.INSTALL_START:
outputChannel.show(true);
statusView.show();
outputChannel.appendLine(`Installing ${Constants.serviceName} service to ${args[0]}`);
statusView.text = 'Installing Service';
break;
case Events.INSTALL_END:
outputChannel.appendLine('Installed');
break;
case Events.DOWNLOAD_START:
outputChannel.appendLine(`Downloading ${args[0]}`);
outputChannel.append(`(${Math.ceil(args[1] / 1024)} KB)`);
statusView.text = 'Downloading Service';
break;
case Events.DOWNLOAD_PROGRESS:
let newDots = Math.ceil(args[0] / 5);
if (newDots > dots) {
outputChannel.append('.'.repeat(newDots - dots));
dots = newDots;
}
break;
case Events.DOWNLOAD_END:
outputChannel.appendLine('Done!');
break;
default:
console.error(`Unknown event from Server Provider ${e}`);
break;
}
};
}