mirror of
https://github.com/grumpycoders/pcsx-redux.git
synced 2025-04-02 10:41:54 -04:00
29 lines
690 B
JavaScript
29 lines
690 B
JavaScript
'use strict'
|
|
|
|
const vscode = require('vscode')
|
|
|
|
exports.notify = async function (title, message) {
|
|
let progressReporter
|
|
let progressResolver
|
|
|
|
const notificationDisplayed = new Promise((notificationReady) => {
|
|
vscode.window.withProgress(
|
|
{
|
|
location: vscode.ProgressLocation.Notification,
|
|
title,
|
|
cancellable: true
|
|
},
|
|
(progress) => {
|
|
progress.report({ message, increment: 0 })
|
|
progressReporter = progress
|
|
return new Promise((resolve) => {
|
|
notificationReady()
|
|
progressResolver = resolve
|
|
})
|
|
}
|
|
)
|
|
})
|
|
await notificationDisplayed
|
|
|
|
return { progressReporter, progressResolver }
|
|
}
|