@@ -26,7 +26,6 @@ import { Iterable } from 'vs/base/common/iterator';
26
26
import { KeyCode , KeyMod } from 'vs/base/common/keyCodes' ;
27
27
import { Lazy } from 'vs/base/common/lazy' ;
28
28
import { Disposable , DisposableStore , IDisposable , IReference , MutableDisposable , toDisposable } from 'vs/base/common/lifecycle' ;
29
- import { clamp } from 'vs/base/common/numbers' ;
30
29
import { count } from 'vs/base/common/strings' ;
31
30
import { ThemeIcon } from 'vs/base/common/themables' ;
32
31
import { URI } from 'vs/base/common/uri' ;
@@ -520,8 +519,8 @@ export class TestingOutputPeekController extends Disposable implements IEditorCo
520
519
* Shows a peek for the message in the editor.
521
520
*/
522
521
public async show ( uri : URI ) {
523
- const subjecet = this . retrieveTest ( uri ) ;
524
- if ( ! subjecet ) {
522
+ const subject = this . retrieveTest ( uri ) ;
523
+ if ( ! subject ) {
525
524
return ;
526
525
}
527
526
@@ -537,12 +536,12 @@ export class TestingOutputPeekController extends Disposable implements IEditorCo
537
536
this . peek . value ! . create ( ) ;
538
537
}
539
538
540
- if ( subjecet instanceof MessageSubject ) {
541
- const message = subjecet . messages [ subjecet . messageIndex ] ;
539
+ if ( subject instanceof MessageSubject ) {
540
+ const message = subject . messages [ subject . messageIndex ] ;
542
541
alert ( renderStringAsPlaintext ( message . message ) ) ;
543
542
}
544
543
545
- this . peek . value . setModel ( subjecet ) ;
544
+ this . peek . value . setModel ( subject ) ;
546
545
this . currentPeekUri = uri ;
547
546
}
548
547
@@ -1022,7 +1021,7 @@ const diffEditorOptions: IDiffEditorConstructionOptions = {
1022
1021
diffAlgorithm : 'advanced' ,
1023
1022
} ;
1024
1023
1025
- const isDiffable = ( message : ITestMessage ) : message is ITestErrorMessage & { actualOutput : string ; expectedOutput : string } =>
1024
+ const isDiffable = ( message : ITestMessage ) : message is ITestErrorMessage & { actual : string ; expected : string } =>
1026
1025
message . type === TestMessageType . Error && message . actual !== undefined && message . expected !== undefined ;
1027
1026
1028
1027
class DiffContentProvider extends Disposable implements IPeekOutputRenderer {
@@ -1381,8 +1380,9 @@ const firstLine = (str: string) => {
1381
1380
} ;
1382
1381
1383
1382
const isMultiline = ( str : string | undefined ) => ! ! str && str . includes ( '\n' ) ;
1384
- const hintPeekStrHeight = ( str : string | undefined ) =>
1385
- clamp ( str ? Math . max ( count ( str , '\n' ) , Math . ceil ( str . length / 80 ) ) + 3 : 0 , 14 , 24 ) ;
1383
+
1384
+ // add 5ish lines for the size of the title and decorations in the peek.
1385
+ const hintPeekStrHeight = ( str : string ) => Math . min ( count ( str , '\n' ) + 5 , 24 ) ;
1386
1386
1387
1387
class SimpleDiffEditorModel extends EditorModel {
1388
1388
public readonly original = this . _original . object . textEditorModel ;
0 commit comments