@@ -254,7 +254,7 @@ export class TestingDecorationService extends Disposable implements ITestingDeco
254
254
}
255
255
256
256
/** @inheritdoc */
257
- public getDecoratedRangeForTest ( resource : URI , testId : string ) {
257
+ public getDecoratedTestPosition ( resource : URI , testId : string ) {
258
258
const model = this . modelService . getModel ( resource ) ;
259
259
if ( ! model ) {
260
260
return undefined ;
@@ -265,7 +265,8 @@ export class TestingDecorationService extends Disposable implements ITestingDeco
265
265
return undefined ;
266
266
}
267
267
268
- return model . getDecorationRange ( decoration . id ) || undefined ;
268
+ // decoration is collapsed, so the range is meaningless; only position matters.
269
+ return model . getDecorationRange ( decoration . id ) ?. getStartPosition ( ) ;
269
270
}
270
271
271
272
private invalidate ( ) {
@@ -512,11 +513,11 @@ export class TestingDecorations extends Disposable implements IEditorContributio
512
513
}
513
514
}
514
515
515
- const firstLineRange = ( originalRange : IRange ) => ( {
516
+ const collapseRange = ( originalRange : IRange ) => ( {
516
517
startLineNumber : originalRange . startLineNumber ,
517
518
endLineNumber : originalRange . startLineNumber ,
518
- startColumn : 0 ,
519
- endColumn : Number . MAX_SAFE_INTEGER ,
519
+ startColumn : originalRange . startColumn ,
520
+ endColumn : originalRange . startColumn ,
520
521
} ) ;
521
522
522
523
const createRunTestDecoration = ( tests : readonly IncrementalTestCollectionItem [ ] , states : readonly ( TestResultItem | undefined ) [ ] , visible : boolean ) : IModelDeltaDecoration => {
@@ -526,7 +527,7 @@ const createRunTestDecoration = (tests: readonly IncrementalTestCollectionItem[]
526
527
}
527
528
528
529
if ( ! visible ) {
529
- return { range : firstLineRange ( range ) , options : { isWholeLine : true , description : 'run-test-decoration' } } ;
530
+ return { range : collapseRange ( range ) , options : { isWholeLine : true , description : 'run-test-decoration' } } ;
530
531
}
531
532
532
533
let computedState = TestResultState . Unset ;
@@ -560,10 +561,10 @@ const createRunTestDecoration = (tests: readonly IncrementalTestCollectionItem[]
560
561
}
561
562
562
563
return {
563
- range : firstLineRange ( range ) ,
564
+ range : collapseRange ( range ) ,
564
565
options : {
565
566
description : 'run-test-decoration' ,
566
- isWholeLine : true ,
567
+ showIfCollapsed : true ,
567
568
get hoverMessage ( ) {
568
569
if ( ! hoverMessage ) {
569
570
const building = hoverMessage = new MarkdownString ( '' , true ) . appendText ( hoverMessageParts . join ( ', ' ) + '.' ) ;
0 commit comments