diff --git a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts index e33c15a909f9c527e8cd8a9023179125ee4cf336..4870b63347007dda9e947b54dca2e7961d8ae4e8 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts @@ -38,6 +38,7 @@ import { IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Position } from 'vs/editor/common/core/position'; import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; +import { first } from 'vs/base/common/arrays'; const HOVER_DELAY = 300; const LAUNCH_JSON_REGEX = /launch\.json$/; @@ -363,13 +364,7 @@ export class DebugEditorContribution implements IDebugEditorContribution { } // First call stack frame that is available is the frame where exception has been thrown - let exceptionSf; - for (let sf of callStack) { - if (sf.source && sf.source.available) { - exceptionSf = sf; - break; - } - } + const exceptionSf = first(callStack, sf => sf.source && sf.source.available, undefined); if (!exceptionSf) { this.closeExceptionWidget(); return;