@@ -592,7 +592,7 @@ suite('TextModel.getLineIndentGuide', () => {
592592
593593 test ( 'getLineIndentGuide one level 2' , ( ) => {
594594 assertIndentGuides ( [
595- [ 0 , 1 , 1 , 0 , 'A' ] ,
595+ [ 0 , 2 , 4 , 1 , 'A' ] ,
596596 [ 1 , 2 , 4 , 1 , ' A' ] ,
597597 [ 1 , 2 , 4 , 1 , ' A' ] ,
598598 [ 1 , 2 , 4 , 1 , ' A' ] ,
@@ -601,83 +601,83 @@ suite('TextModel.getLineIndentGuide', () => {
601601
602602 test ( 'getLineIndentGuide two levels' , ( ) => {
603603 assertIndentGuides ( [
604- [ 0 , 1 , 1 , 0 , 'A' ] ,
605- [ 1 , 2 , 5 , 1 , ' A' ] ,
604+ [ 0 , 2 , 5 , 1 , 'A' ] ,
606605 [ 1 , 2 , 5 , 1 , ' A' ] ,
606+ [ 1 , 4 , 5 , 2 , ' A' ] ,
607607 [ 2 , 4 , 5 , 2 , ' A' ] ,
608608 [ 2 , 4 , 5 , 2 , ' A' ] ,
609609 ] , 2 ) ;
610610 } ) ;
611611
612612 test ( 'getLineIndentGuide three levels' , ( ) => {
613613 assertIndentGuides ( [
614- [ 0 , 1 , 1 , 0 , 'A' ] ,
615- [ 1 , 2 , 4 , 1 , ' A' ] ,
616- [ 2 , 3 , 4 , 2 , ' A' ] ,
614+ [ 0 , 2 , 4 , 1 , 'A' ] ,
615+ [ 1 , 3 , 5 , 2 , ' A' ] , // TODO 5 => 4
616+ [ 2 , 4 , 5 , 3 , ' A' ] , // TODO 5 => 4
617617 [ 3 , 4 , 4 , 3 , ' A' ] ,
618- [ 0 , 5 , 5 , 0 , 'A' ] ,
618+ [ 0 , 2 , 4 , 1 , 'A' ] , // TODO => too big of a difference with the line above?
619619 ] , 2 ) ;
620620 } ) ;
621621
622622 test ( 'getLineIndentGuide decreasing indent' , ( ) => {
623623 assertIndentGuides ( [
624624 [ 2 , 1 , 1 , 2 , ' A' ] ,
625- [ 1 , 1 , 2 , 1 , ' A' ] ,
626- [ 0 , 3 , 3 , 0 , 'A' ] ,
625+ [ 1 , 1 , 1 , 2 , ' A' ] ,
626+ [ 0 , 1 , 2 , 1 , 'A' ] ,
627627 ] , 2 ) ;
628628 } ) ;
629629
630630 test ( 'getLineIndentGuide Java' , ( ) => {
631631 assertIndentGuides ( [
632- /* 1*/ [ 0 , 1 , 1 , 0 , 'class A {' ] ,
633- /* 2*/ [ 1 , 2 , 9 , 1 , ' void foo() {' ] ,
632+ /* 1*/ [ 0 , 2 , 9 , 1 , 'class A {' ] ,
633+ /* 2*/ [ 1 , 3 , 4 , 2 , ' void foo() {' ] ,
634634 /* 3*/ [ 2 , 3 , 4 , 2 , ' console.log(1);' ] ,
635635 /* 4*/ [ 2 , 3 , 4 , 2 , ' console.log(2);' ] ,
636- /* 5*/ [ 1 , 2 , 9 , 1 , ' }' ] ,
636+ /* 5*/ [ 1 , 3 , 4 , 2 , ' }' ] ,
637637 /* 6*/ [ 1 , 2 , 9 , 1 , '' ] ,
638- /* 7*/ [ 1 , 2 , 9 , 1 , ' void bar() {' ] ,
638+ /* 7*/ [ 1 , 8 , 8 , 2 , ' void bar() {' ] ,
639639 /* 8*/ [ 2 , 8 , 8 , 2 , ' console.log(3);' ] ,
640- /* 9*/ [ 1 , 2 , 9 , 1 , ' }' ] ,
641- /*10*/ [ 0 , 10 , 10 , 0 , '}' ] ,
642- /*11*/ [ 0 , 11 , 11 , 0 , 'interface B {' ] ,
640+ /* 9*/ [ 1 , 8 , 8 , 2 , ' }' ] ,
641+ /*10*/ [ 0 , 2 , 9 , 1 , '}' ] ,
642+ /*11*/ [ 0 , 12 , 12 , 1 , 'interface B {' ] ,
643643 /*12*/ [ 1 , 12 , 12 , 1 , ' void bar();' ] ,
644- /*13*/ [ 0 , 13 , 13 , 0 , '}' ] ,
644+ /*13*/ [ 0 , 12 , 12 , 1 , '}' ] ,
645645 ] , 2 ) ;
646646 } ) ;
647647
648648 test ( 'getLineIndentGuide Javadoc' , ( ) => {
649649 assertIndentGuides ( [
650- [ 0 , 1 , 1 , 0 , '/**' ] ,
650+ [ 0 , 2 , 3 , 1 , '/**' ] ,
651651 [ 1 , 2 , 3 , 1 , ' * Comment' ] ,
652652 [ 1 , 2 , 3 , 1 , ' */' ] ,
653- [ 0 , 4 , 4 , 0 , 'class A {' ] ,
653+ [ 0 , 5 , 6 , 1 , 'class A {' ] ,
654654 [ 1 , 5 , 6 , 1 , ' void foo() {' ] ,
655655 [ 1 , 5 , 6 , 1 , ' }' ] ,
656- [ 0 , 7 , 7 , 0 , '}' ] ,
656+ [ 0 , 5 , 6 , 1 , '}' ] ,
657657 ] , 2 ) ;
658658 } ) ;
659659
660660 test ( 'getLineIndentGuide Whitespace' , ( ) => {
661661 assertIndentGuides ( [
662- [ 0 , 1 , 1 , 0 , 'class A {' ] ,
662+ [ 0 , 1 , 1 , 0 , 'class A {' ] , // TODO => the next one is not working here
663663 [ 1 , 2 , 7 , 1 , '' ] ,
664- [ 1 , 2 , 7 , 1 , ' void foo() {' ] ,
664+ [ 1 , 2 , 7 , 1 , ' void foo() {' ] , // TODO => also not working here
665665 [ 2 , 4 , 5 , 2 , ' ' ] ,
666666 [ 3 , 5 , 5 , 3 , ' return 1;' ] ,
667- [ 1 , 2 , 7 , 1 , ' }' ] ,
667+ [ 1 , 4 , 5 , 2 , ' }' ] ,
668668 [ 1 , 2 , 7 , 1 , ' ' ] ,
669669 [ 0 , 8 , 8 , 0 , '}' ]
670670 ] , 2 ) ;
671671 } ) ;
672672
673673 test ( 'getLineIndentGuide Tabs' , ( ) => {
674674 assertIndentGuides ( [
675- [ 0 , 1 , 1 , 0 , 'class A {' ] ,
675+ [ 0 , 1 , 1 , 0 , 'class A {' ] , // TODO => not working here
676676 [ 1 , 2 , 7 , 1 , '\t\t' ] ,
677- [ 1 , 2 , 7 , 1 , '\tvoid foo() {' ] ,
677+ [ 1 , 4 , 5 , 2 , '\tvoid foo() {' ] ,
678678 [ 2 , 4 , 5 , 2 , '\t \t//hello' ] ,
679679 [ 2 , 4 , 5 , 2 , '\t return 2;' ] ,
680- [ 1 , 2 , 7 , 1 , ' \t}' ] ,
680+ [ 1 , 4 , 5 , 2 , ' \t}' ] ,
681681 [ 1 , 2 , 7 , 1 , ' ' ] ,
682682 [ 0 , 8 , 8 , 0 , '}' ]
683683 ] , 4 ) ;
@@ -688,61 +688,61 @@ suite('TextModel.getLineIndentGuide', () => {
688688 /* 1*/ [ 0 , 1 , 1 , 0 , '/// <reference path="binder.ts"/>' ] ,
689689 /* 2*/ [ 0 , 2 , 2 , 0 , '' ] ,
690690 /* 3*/ [ 0 , 3 , 3 , 0 , '/* @internal */' ] ,
691- /* 4*/ [ 0 , 4 , 4 , 0 , 'namespace ts {' ] ,
691+ /* 4*/ [ 0 , 5 , 16 , 1 , 'namespace ts {' ] ,
692692 /* 5*/ [ 1 , 5 , 16 , 1 , ' let nextSymbolId = 1;' ] ,
693693 /* 6*/ [ 1 , 5 , 16 , 1 , ' let nextNodeId = 1;' ] ,
694694 /* 7*/ [ 1 , 5 , 16 , 1 , ' let nextMergeId = 1;' ] ,
695695 /* 8*/ [ 1 , 5 , 16 , 1 , ' let nextFlowId = 1;' ] ,
696696 /* 9*/ [ 1 , 5 , 16 , 1 , '' ] ,
697- /*10*/ [ 1 , 5 , 16 , 1 , ' export function getNodeId(node: Node): number {' ] ,
698- /*11*/ [ 2 , 11 , 15 , 2 , ' if (!node.id) {' ] ,
697+ /*10*/ [ 1 , 11 , 15 , 2 , ' export function getNodeId(node: Node): number {' ] ,
698+ /*11*/ [ 2 , 12 , 13 , 3 , ' if (!node.id) {' ] ,
699699 /*12*/ [ 3 , 12 , 13 , 3 , ' node.id = nextNodeId;' ] ,
700700 /*13*/ [ 3 , 12 , 13 , 3 , ' nextNodeId++;' ] ,
701- /*14*/ [ 2 , 11 , 15 , 2 , ' }' ] ,
701+ /*14*/ [ 2 , 12 , 13 , 3 , ' }' ] ,
702702 /*15*/ [ 2 , 11 , 15 , 2 , ' return node.id;' ] ,
703- /*16*/ [ 1 , 5 , 16 , 1 , ' }' ] ,
704- /*17*/ [ 0 , 17 , 17 , 0 , '}' ]
703+ /*16*/ [ 1 , 11 , 15 , 2 , ' }' ] ,
704+ /*17*/ [ 0 , 5 , 16 , 1 , '}' ]
705705 ] , 4 ) ;
706706 } ) ;
707707
708708 test ( 'issue #8425 - Missing indentation lines for first level indentation' , ( ) => {
709709 assertIndentGuides ( [
710- [ 1 , 1 , 4 , 1 , '\tindent1' ] ,
710+ [ 1 , 2 , 3 , 2 , '\tindent1' ] ,
711711 [ 2 , 2 , 3 , 2 , '\t\tindent2' ] ,
712712 [ 2 , 2 , 3 , 2 , '\t\tindent2' ] ,
713- [ 1 , 1 , 4 , 1 , '\tindent1' ]
713+ [ 1 , 2 , 3 , 2 , '\tindent1' ]
714714 ] , 4 ) ;
715715 } ) ;
716716
717717 test ( 'issue #8952 - Indentation guide lines going through text on .yml file' , ( ) => {
718718 assertIndentGuides ( [
719- [ 0 , 1 , 1 , 0 , 'properties:' ] ,
720- [ 1 , 2 , 5 , 1 , ' emailAddress:' ] ,
719+ [ 0 , 2 , 5 , 1 , 'properties:' ] ,
720+ [ 1 , 3 , 6 , 2 , ' emailAddress:' ] , // TODO 6 => 5
721721 [ 2 , 3 , 5 , 2 , ' - bla' ] ,
722- [ 2 , 3 , 5 , 2 , ' - length:' ] ,
722+ [ 2 , 5 , 6 , 3 , ' - length:' ] , // TODO 6 => 5
723723 [ 3 , 5 , 5 , 3 , ' max: 255' ] ,
724- [ 0 , 6 , 6 , 0 , 'getters:' ]
724+ [ 0 , 2 , 5 , 1 , 'getters:' ]
725725 ] , 4 ) ;
726726 } ) ;
727727
728728 test ( 'issue #11892 - Indent guides look funny' , ( ) => {
729729 assertIndentGuides ( [
730- [ 0 , 1 , 1 , 0 , 'function test(base) {' ] ,
731- [ 1 , 2 , 7 , 1 , '\tswitch (base) {' ] ,
732- [ 2 , 3 , 6 , 2 , '\t\tcase 1:' ] ,
730+ [ 0 , 2 , 7 , 1 , 'function test(base) {' ] ,
731+ [ 1 , 3 , 6 , 2 , '\tswitch (base) {' ] ,
732+ [ 2 , 4 , 4 , 3 , '\t\tcase 1:' ] ,
733733 [ 3 , 4 , 4 , 3 , '\t\t\treturn 1;' ] ,
734- [ 2 , 3 , 6 , 2 , '\t\tcase 2:' ] ,
734+ [ 2 , 6 , 8 , 3 , '\t\tcase 2:' ] , // TODO 8 => 6 or 7
735735 [ 3 , 6 , 6 , 3 , '\t\t\treturn 2;' ] ,
736- [ 1 , 2 , 7 , 1 , '\t}' ] ,
737- [ 0 , 8 , 8 , 0 , '}' ]
736+ [ 1 , 3 , 6 , 2 , '\t}' ] ,
737+ [ 0 , 2 , 7 , 1 , '}' ]
738738 ] , 4 ) ;
739739 } ) ;
740740
741741 test ( 'issue #12398 - Problem in indent guidelines' , ( ) => {
742742 assertIndentGuides ( [
743- [ 2 , 1 , 2 , 2 , '\t\t.bla' ] ,
743+ [ 2 , 2 , 3 , 3 , '\t\t.bla' ] ,
744744 [ 3 , 2 , 2 , 3 , '\t\t\tlabel(for)' ] ,
745- [ 0 , 3 , 3 , 0 , 'include script' ]
745+ [ 0 , 1 , 2 , 1 , 'include script' ]
746746 ] , 4 ) ;
747747 } ) ;
748748
@@ -771,22 +771,22 @@ suite('TextModel.getLineIndentGuide', () => {
771771 assertIndentGuides ( [
772772 [ 0 , 1 , 1 , 0 , 'A' ] ,
773773 [ 0 , 2 , 2 , 0 , 'A' ]
774- ] ) ;
774+ ] , 2 ) ;
775775 } ) ;
776776
777777 test ( 'tweaks - inside scope' , ( ) => {
778778 assertIndentGuides ( [
779779 [ 0 , 2 , 2 , 1 , 'A' ] ,
780780 [ 1 , 2 , 2 , 1 , ' A' ]
781- ] ) ;
781+ ] , 2 ) ;
782782 } ) ;
783783
784784 test ( 'tweaks - scope start' , ( ) => {
785785 assertIndentGuides ( [
786786 [ 0 , 2 , 2 , 1 , 'A' ] ,
787787 [ 1 , 2 , 2 , 1 , ' A' ] ,
788788 [ 0 , 2 , 2 , 1 , 'A' ]
789- ] ) ;
789+ ] , 2 ) ;
790790 } ) ;
791791
792792 test ( 'tweaks - empty line' , ( ) => {
@@ -796,6 +796,6 @@ suite('TextModel.getLineIndentGuide', () => {
796796 [ 1 , 2 , 4 , 1 , '' ] ,
797797 [ 1 , 2 , 4 , 1 , ' A' ] ,
798798 [ 0 , 2 , 4 , 1 , 'A' ]
799- ] ) ;
799+ ] , 2 ) ;
800800 } ) ;
801801} ) ;
0 commit comments