progress.js 496 B

1234567891011121314151617
  1. import { createDecorator } from '../../instantiation/common/instantiation.js';
  2. export const emptyProgressRunner = Object.freeze({
  3. total() { },
  4. worked() { },
  5. done() { }
  6. });
  7. export class Progress {
  8. constructor(callback) {
  9. this.callback = callback;
  10. }
  11. report(item) {
  12. this._value = item;
  13. this.callback(this._value);
  14. }
  15. }
  16. Progress.None = Object.freeze({ report() { } });
  17. export const IEditorProgressService = createDecorator('editorProgressService');