import { StatusBarItem , window } from 'coc.nvim' ; export async function withProgress ( text , fn ) { const status = window . createStatusBarItem ( 90 , { progress : true } ) ; 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 ( ) ; }