File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/vs/workbench/contrib/testing/browser Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1332,6 +1332,8 @@ class TestMessageDecoration implements ITestDecoration {
1332
1332
}
1333
1333
}
1334
1334
1335
+ const ERROR_CONTENT_WIDGET_HEIGHT = 20 ;
1336
+
1335
1337
class TestErrorContentWidget extends Disposable implements IContentWidget {
1336
1338
private readonly id = generateUuid ( ) ;
1337
1339
@@ -1360,6 +1362,18 @@ class TestErrorContentWidget extends Disposable implements IContentWidget {
1360
1362
) {
1361
1363
super ( ) ;
1362
1364
1365
+ const setMarginTop = ( ) => {
1366
+ const lineHeight = editor . getOption ( EditorOption . lineHeight ) ;
1367
+ this . node . root . style . marginTop = ( lineHeight - ERROR_CONTENT_WIDGET_HEIGHT ) / 2 + 'px' ;
1368
+ } ;
1369
+
1370
+ setMarginTop ( ) ;
1371
+ this . _register ( editor . onDidChangeConfiguration ( e => {
1372
+ if ( e . hasChanged ( EditorOption . lineHeight ) ) {
1373
+ setMarginTop ( ) ;
1374
+ }
1375
+ } ) ) ;
1376
+
1363
1377
let text : string ;
1364
1378
if ( message . expected !== undefined && message . actual !== undefined ) {
1365
1379
text = `${ truncateMiddle ( message . actual , 15 ) } != ${ truncateMiddle ( message . expected , 15 ) } ` ;
You can’t perform that action at this time.
0 commit comments