@@ -50,6 +50,7 @@ function registerLanguageConfiguration(instantiationService: TestInstantiationSe
50
50
case Language . TypeScript :
51
51
disposables . add ( languageConfigurationService . register ( languageId , {
52
52
brackets : [
53
+ [ '${' , '}' ] ,
53
54
[ '{' , '}' ] ,
54
55
[ '[' , ']' ] ,
55
56
[ '(' , ')' ]
@@ -552,6 +553,45 @@ suite('`Full` Auto Indent On Paste - TypeScript/JavaScript', () => {
552
553
] . join ( '\n' ) ) ;
553
554
} ) ;
554
555
} ) ;
556
+
557
+ test . skip ( 'issue #201420: incorrect indentation when first line is comment' , ( ) => {
558
+
559
+ // https://github.com/microsoft/vscode/issues/201420
560
+
561
+ const model = createTextModel ( [
562
+ 'function bar() {' ,
563
+ '' ,
564
+ '}' ,
565
+ ] . join ( '\n' ) , languageId , { } ) ;
566
+ disposables . add ( model ) ;
567
+
568
+ withTestCodeEditor ( model , { autoIndent : 'full' } , ( editor , viewModel , instantiationService ) => {
569
+ const tokens = [
570
+ [ { startIndex : 0 , value : 0 } , { startIndex : 8 , value : 0 } , { startIndex : 9 , value : 0 } , { startIndex : 12 , value : 0 } , { startIndex : 13 , value : 0 } , { startIndex : 14 , value : 0 } , { startIndex : 15 , value : 0 } , { startIndex : 16 , value : 0 } ] ,
571
+ [ { startIndex : 0 , value : 1 } , { startIndex : 2 , value : 1 } , { startIndex : 3 , value : 1 } , { startIndex : 10 , value : 1 } ] ,
572
+ [ { startIndex : 0 , value : 0 } , { startIndex : 5 , value : 0 } , { startIndex : 6 , value : 0 } , { startIndex : 9 , value : 0 } , { startIndex : 10 , value : 0 } , { startIndex : 11 , value : 0 } , { startIndex : 12 , value : 0 } , { startIndex : 14 , value : 0 } ] ,
573
+ [ { startIndex : 0 , value : 0 } , { startIndex : 1 , value : 0 } ]
574
+ ] ;
575
+ registerLanguage ( instantiationService , languageId , Language . TypeScript , disposables ) ;
576
+ registerTokens ( instantiationService , tokens , languageId , disposables ) ;
577
+
578
+ editor . setSelection ( new Selection ( 2 , 1 , 2 , 1 ) ) ;
579
+ const text = [
580
+ '// comment' ,
581
+ 'const foo = 42' ,
582
+ ] . join ( '\n' ) ;
583
+ registerLanguage ( instantiationService , languageId , Language . TypeScript , disposables ) ;
584
+ const autoIndentOnPasteController = editor . registerAndInstantiateContribution ( AutoIndentOnPaste . ID , AutoIndentOnPaste ) ;
585
+ viewModel . paste ( text , true , undefined , 'keyboard' ) ;
586
+ autoIndentOnPasteController . trigger ( new Range ( 2 , 1 , 3 , 15 ) ) ;
587
+ assert . strictEqual ( model . getValue ( ) , [
588
+ 'function bar() {' ,
589
+ ' // comment' ,
590
+ ' const foo = 42' ,
591
+ '}' ,
592
+ ] . join ( '\n' ) ) ;
593
+ } ) ;
594
+ } ) ;
555
595
} ) ;
556
596
557
597
suite ( '`Full` Auto Indent On Type - TypeScript/JavaScript' , ( ) => {
@@ -1105,7 +1145,7 @@ suite('Auto Indent On Type - CPP', () => {
1105
1145
assert . ok ( true ) ;
1106
1146
} ) ;
1107
1147
1108
- test ( 'issue #178334: incorrect outdent of } when signature spans multiple lines' , ( ) => {
1148
+ test . skip ( 'issue #178334: incorrect outdent of } when signature spans multiple lines' , ( ) => {
1109
1149
1110
1150
// https://github.com/microsoft/vscode/issues/178334
1111
1151
0 commit comments