Limit Jedi RAM consumption by MikhailArkhipov · Pull Request #744 · microsoft/vscode-python
What's the purpose of doNotWait. If i'm not mistaken, we'd only use this in case where we don't care about any exceptions raised at all. Hence I'd say, we don't care about the errors, that's why we didn't have any error handlers in the first place. If we do want them, then i'd put the logging in the code itself, rather than creating an extension method.
So, all we need is:
/** * Explicitly tells that promise should be run asynchonously. */ Promise.prototype.doNotWait = function(this: Promise) { this.catch(()=>{}); // or this.catch(nop); };
Now, when you look at the code, this extension feels kind of redundant or we should rename it to something such as ignoreErrors().
Because technically this still returns a promise that will get resolved. So it not about waiting or not. We just want to ignore the errors.