TS Template added by @mjbvz
TypeScript Version: 4.2.0-dev.20201116
Search Terms
getCommands(filterUnderscoreCommands: boolean = false): Promise<string[]> {
this._logService.trace('ExtHostCommands#getCommands', filterUnderscoreCommands);
return this._proxy.$getCommands().then(result => {
if (filterUnderscoreCommands) {
result = result.filter(command => command[0] !== '_');
}
return result;
});
}

Minimal repo:
function getCommands(): Promise<any> {
return Promise.resolve(1).then(result => {
result = result + 2;
});
}
results in:
async function getCommands(): Promise<any> {
const result = await Promise.resolve(1);
result = result + 2;
}
What the expected result for this issue?
/cc @mjbvz
To use let instead.
@joaomoreno Like so?
ts
async function getCommands(): Promise<any> {
let result = await Promise.resolve(1);
result = result + 2;
}
Most helpful comment
Minimal repo:
results in: