With async/await it should be very rare that you have to explicitly create a promise. If the function returns a promise then you probably can just declare the function async and then it will always return a promise. just `return` what you want to resolve or throw what you want to reject.
Here are a few:
https://github.com/mongodb-js/vscode/blob/no-floating-promises/src/explorer/databaseTreeItem.ts#L62-L78
and others. There are about a dozen across the codebase. Just search for `return new Promise`.
- is related to
-
VSCODE-286 Finish replacing promises with async/await
- Closed