Skip to content

Commit 1edd865

Browse files
authored
testing: fix peek over eagerly reveals lines (microsoft#201004)
Fixes microsoft#200944
1 parent ee39176 commit 1edd865

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vs/workbench/contrib/testing/browser/testingOutputPeek.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
5757
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
5858
import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
5959
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
60-
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
60+
import { ITextEditorOptions, TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor';
6161
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
6262
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
6363
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
@@ -252,7 +252,7 @@ export class TestingPeekOpener extends Disposable implements ITestingPeekOpener
252252
messageIndex: candidate.index,
253253
resultId: result.id,
254254
testExtId: test.item.extId,
255-
}, undefined, { selection: candidate.location.range, ...options });
255+
}, undefined, { selection: candidate.location.range, selectionRevealType: TextEditorSelectionRevealType.NearTopIfOutsideViewport, ...options });
256256
return true;
257257
}
258258

@@ -1023,7 +1023,8 @@ class TestResultsPeek extends PeekViewWidget {
10231023
}
10241024

10251025
this.show(subject.revealLocation.range, TestResultsPeek.lastHeightInLines || hintMessagePeekHeight(message));
1026-
this.editor.revealPositionNearTop(subject.revealLocation.range.getStartPosition(), ScrollType.Smooth);
1026+
const startPosition = subject.revealLocation.range.getStartPosition();
1027+
this.editor.revealRangeNearTopIfOutsideViewport(Range.fromPositions(startPosition), ScrollType.Smooth);
10271028

10281029
return this.showInPlace(subject);
10291030
}

0 commit comments

Comments
 (0)