"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withProgress = withProgress;
const coc_nvim_1 = require("coc.nvim");
// eslint-disable-next-line no-unused-vars
async function withProgress(text, fn) {
    const status = coc_nvim_1.window.createStatusBarItem(90, { progress: true });
    // Show status item at leaste one second
    let offset = 1000;
    const t = setTimeout(() => (offset = 0), offset);
    const dispose = () => {
        clearTimeout(t);
        setTimeout(() => status.dispose(), offset);
    };
    status.text = text;
    status.show();
    await fn(status);
    dispose();
}
//# sourceMappingURL=ui.js.map