joplin
joplin copied to clipboard
Implement a plugin API to display a progress bar
Like in VSCode. Maybe that could also be generalised so that we can use it for OCR or other long running processes.
Ref: https://discourse.joplinapp.org/t/the-joplin-plugin-api-should-consider-adding-a-function-similar-to-vscode-window-withprogress/38362/3?u=laurent
vscode.commands.registerCommand('joplin.test', async () => {
await vscode.window.withProgress(
{
title: 'Test',
location: vscode.ProgressLocation.Notification,
},
async (process) => {
for (let i = 1; i <= 10; i++) {
process.report({ increment: 1, message: `Processing ${i}` })
await new Promise((resolve) => setTimeout(resolve, 1000))
}
},
)
})