@@ -741,6 +741,8 @@ suite('`Full` Auto Indent On Type - TypeScript/JavaScript', () => {
741
741
// issue: Should indent after an equal sign is detected followed by whitespace characters.
742
742
// This should be outdented when a semi-colon is detected indicating the end of the assignment.
743
743
744
+ // TODO: requires exploring indent/outdent pairs instead
745
+
744
746
const model = createTextModel ( [
745
747
'const array ='
746
748
] . join ( '\n' ) , languageId , { } ) ;
@@ -762,6 +764,8 @@ suite('`Full` Auto Indent On Type - TypeScript/JavaScript', () => {
762
764
// https://github.com/microsoft/vscode/issues/43244
763
765
// issue: When a dot is written, we should detect that this is a method call and indent accordingly
764
766
767
+ // TODO: requires exploring indent/outdent pairs instead
768
+
765
769
const model = createTextModel ( [
766
770
'const array = [1, 2, 3];' ,
767
771
'array.'
@@ -785,6 +789,8 @@ suite('`Full` Auto Indent On Type - TypeScript/JavaScript', () => {
785
789
// https://github.com/microsoft/vscode/issues/43244
786
790
// issue: When a dot is written, we should detect that this is a method call and indent accordingly
787
791
792
+ // TODO: requires exploring indent/outdent pairs instead
793
+
788
794
const model = createTextModel ( [
789
795
'const array = [1, 2, 3]' ,
790
796
] . join ( '\n' ) , languageId , { } ) ;
@@ -807,6 +813,8 @@ suite('`Full` Auto Indent On Type - TypeScript/JavaScript', () => {
807
813
// https://github.com/microsoft/vscode/issues/43244
808
814
// Currently passes, but should pass with all the tests above too
809
815
816
+ // TODO: requires exploring indent/outdent pairs instead
817
+
810
818
const model = createTextModel ( [
811
819
'const array = [1, 2, 3]' ,
812
820
' .filter(() => true)'
@@ -825,10 +833,38 @@ suite('`Full` Auto Indent On Type - TypeScript/JavaScript', () => {
825
833
} ) ;
826
834
} ) ;
827
835
836
+ test . skip ( 'issue #43244: keep indentation when chained methods called on object/array' , ( ) => {
837
+
838
+ // https://github.com/microsoft/vscode/issues/43244
839
+ // When the call chain is not finished yet, and we type a dot, we do not want to change the indentation
840
+
841
+ // TODO: requires exploring indent/outdent pairs instead
842
+
843
+ const model = createTextModel ( [
844
+ 'const array = [1, 2, 3]' ,
845
+ ' .filter(() => true)' ,
846
+ ' '
847
+ ] . join ( '\n' ) , languageId , { } ) ;
848
+ disposables . add ( model ) ;
849
+
850
+ withTestCodeEditor ( model , { autoIndent : "full" } , ( editor , viewModel , instantiationService ) => {
851
+ registerLanguage ( instantiationService , languageId , Language . TypeScript , disposables ) ;
852
+ editor . setSelection ( new Selection ( 3 , 5 , 3 , 5 ) ) ;
853
+ viewModel . type ( "." ) ;
854
+ assert . strictEqual ( model . getValue ( ) , [
855
+ 'const array = [1, 2, 3]' ,
856
+ ' .filter(() => true)' ,
857
+ ' .' // here we don't want to increase the indentation because we have chained methods
858
+ ] . join ( '\n' ) ) ;
859
+ } ) ;
860
+ } ) ;
861
+
828
862
test . skip ( 'issue #43244: outdent when a semi-color is detected indicating the end of the assignment' , ( ) => {
829
863
830
864
// https://github.com/microsoft/vscode/issues/43244
831
865
866
+ // TODO: requires exploring indent/outdent pairs instead
867
+
832
868
const model = createTextModel ( [
833
869
'const array = [1, 2, 3]' ,
834
870
' .filter(() => true);'
0 commit comments