Handle Promise errors caused by cancellation (#2420)

- Port of 34ca4c78b2
- This fixes issues where opening an editor send unhandled errors to the debug console, making it hard to debug issues.
This commit is contained in:
Kevin Cunnane
2018-09-05 14:01:09 -07:00
committed by GitHub
parent ac96919caf
commit b7f4f6af3a
6 changed files with 27 additions and 34 deletions

View File

@@ -33,6 +33,7 @@ import { SyntaxRangeProvider, ID_SYNTAX_PROVIDER } from './syntaxRangeProvider';
import { CancellationToken } from 'vs/base/common/cancellation';
import { InitializingRangeProvider, ID_INIT_PROVIDER } from 'vs/editor/contrib/folding/intializingRangeProvider';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { onUnexpectedError } from 'vs/base/common/errors';
export const ID = 'editor.contrib.folding';
@@ -166,7 +167,7 @@ export class FoldingController implements IEditorContribution {
if (foldingModel) {
foldingModel.applyMemento(state.collapsedRegions);
}
});
}).done(undefined, onUnexpectedError);
}
}
@@ -312,7 +313,7 @@ export class FoldingController implements IEditorContribution {
}
}
}
});
}).done(undefined, onUnexpectedError);
}
@@ -404,7 +405,7 @@ export class FoldingController implements IEditorContribution {
}
}
}
});
}).done(undefined, onUnexpectedError);
}
public reveal(position: IPosition): void {