microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.04k stars 28.5k forks source link

extensionService.activateByEvent should return even if some extension fails activation #62660

Closed isidorn closed 4 years ago

isidorn commented 5 years ago
  1. Have some extension which fails to activate on event myevent and crashes in its activation
  2. Have the following code in vsocde
    this.extensionService.activateByEvent('myevent').then(() => console.log('hi'), err => console.log('err');
  3. Notice that both code paths are not printed and the activateByEvent call does not return
alexdima commented 4 years ago

I think this has been fixed in the meantime. Here is what I have tried:

exports.activate = function (ctx) { console.log(62660 activated!); // throw new Error('an error!'); return Promise.reject('an error!'); }


Then, somewhere in the renderer code:

this._extensionService.activateByEvent('special').then(() => console.log('hi'), err => console.log('err'));



I have tried both variants, of return a rejected promise and throwing an error. In both cases I see `hi` printed.