@@ -474,6 +474,75 @@ type AutoCompletionListTests() as this =
474474" type B() = inherit A(System.String.)"
475475]
476476 AssertCtrlSpaceCompleteContains code" System.String." [ " Empty" ] [ " Array" ; " Collections" ]
477+
478+ [<Test>]
479+ [<Category( " Completion in object initializer" ) >]
480+ member public this. ``ObjectInitializer.CompletionForProperties`` () =
481+ let typeDef1 =
482+ [
483+ " type A() ="
484+ " member val SettableProperty = 1 with get,set"
485+ " member val AnotherSettableProperty = 1 with get,set"
486+ " member val NonSettableProperty = 1"
487+ ]
488+ AssertCtrlSpaceCompleteContains( typeDef1@ [ " A((**))" ]) " A((**)" [ " SettableProperty" ; " AnotherSettableProperty" ] [ " NonSettableProperty" ]
489+ AssertCtrlSpaceCompleteContains( typeDef1@ [ " A(S = 1)" ]) " A(S" [ " SettableProperty" ] [ " NonSettableProperty" ]
490+ AssertCtrlSpaceCompleteContains( typeDef1@ [ " A(S = 1)" ]) " A(S = 1" [] [ " SettableProperty" ; " NonSettableProperty" ] // neg test
491+ AssertCtrlSpaceCompleteContains( typeDef1@ [ " A(S = 1,)" ]) " A(S = 1," [ " AnotherSettableProperty" ] [ " NonSettableProperty" ]
492+ AssertCtrlSpaceCompleteContains( typeDef1@ [ " new A((**))" ]) " A((**)" [ " SettableProperty" ; " AnotherSettableProperty" ] [ " NonSettableProperty" ]
493+ AssertCtrlSpaceCompleteContains( typeDef1@ [ " new A(S = 1)" ]) " A(S" [ " SettableProperty" ] [ " NonSettableProperty" ]
494+ AssertCtrlSpaceCompleteContains( typeDef1@ [ " new A(S = 1)" ]) " A(S = 1" [] [ " SettableProperty" ; " NonSettableProperty" ] // neg test
495+ AssertCtrlSpaceCompleteContains( typeDef1@ [ " new A(S = 1,)" ]) " A(S = 1," [ " AnotherSettableProperty" ] [ " NonSettableProperty" ]
496+
497+ let typeDef2 =
498+ [
499+ " type A<'a>() ="
500+ " member val SettableProperty = 1 with get,set"
501+ " member val AnotherSettableProperty = 1 with get,set"
502+ " member val NonSettableProperty = 1"
503+ ]
504+ AssertCtrlSpaceCompleteContains( typeDef2@ [ " A((**))" ]) " A((**)" [ " SettableProperty" ; " AnotherSettableProperty" ] [ " NonSettableProperty" ]
505+ AssertCtrlSpaceCompleteContains( typeDef2@ [ " A(S = 1)" ]) " A(S" [ " SettableProperty" ] [ " NonSettableProperty" ]
506+ AssertCtrlSpaceCompleteContains( typeDef2@ [ " A(S = 1)" ]) " A(S = 1" [] [ " SettableProperty" ; " NonSettableProperty" ] // neg test
507+ AssertCtrlSpaceCompleteContains( typeDef2@ [ " A(S = 1,)" ]) " A(S = 1," [ " AnotherSettableProperty" ] [ " NonSettableProperty" ]
508+ AssertCtrlSpaceCompleteContains( typeDef2@ [ " new A<_>((**))" ]) " A<_>((**)" [ " SettableProperty" ; " AnotherSettableProperty" ] [ " NonSettableProperty" ]
509+ AssertCtrlSpaceCompleteContains( typeDef2@ [ " new A<_>(S = 1)" ]) " A<_>(S" [ " SettableProperty" ] [ " NonSettableProperty" ]
510+ AssertCtrlSpaceCompleteContains( typeDef2@ [ " new A<_>(S = 1)" ]) " A<_>(S = 1" [] [ " SettableProperty" ; " NonSettableProperty" ] // neg test
511+ AssertCtrlSpaceCompleteContains( typeDef2@ [ " new A<_>(S = 1,)" ]) " A<_>(S = 1," [ " AnotherSettableProperty" ] [ " NonSettableProperty" ]
512+
513+ let typeDef3 =
514+ [
515+ " module M ="
516+ " type A() ="
517+ " member val SettableProperty = 1 with get,set"
518+ " member val AnotherSettableProperty = 1 with get,set"
519+ " member val NonSettableProperty = 1"
520+ ]
521+ AssertCtrlSpaceCompleteContains( typeDef3@ [ " M.A((**))" ]) " A((**)" [ " SettableProperty" ; " AnotherSettableProperty" ] [ " NonSettableProperty" ]
522+ AssertCtrlSpaceCompleteContains( typeDef3@ [ " M.A(S = 1)" ]) " A(S" [ " SettableProperty" ] [ " NonSettableProperty" ]
523+ AssertCtrlSpaceCompleteContains( typeDef3@ [ " M.A(S = 1)" ]) " A(S = 1" [] [ " NonSettableProperty" ; " SettableProperty" ] // neg test
524+ AssertCtrlSpaceCompleteContains( typeDef3@ [ " M.A(S = 1,)" ]) " A(S = 1," [ " AnotherSettableProperty" ] [ " NonSettableProperty" ]
525+ AssertCtrlSpaceCompleteContains( typeDef3@ [ " new M.A((**))" ]) " A((**)" [ " SettableProperty" ; " AnotherSettableProperty" ] [ " NonSettableProperty" ]
526+ AssertCtrlSpaceCompleteContains( typeDef3@ [ " new M.A(S = 1)" ]) " A(S" [ " SettableProperty" ] [ " NonSettableProperty" ]
527+ AssertCtrlSpaceCompleteContains( typeDef3@ [ " new M.A(S = 1)" ]) " A(S = 1" [] [ " NonSettableProperty" ; " SettableProperty" ] // neg test
528+ AssertCtrlSpaceCompleteContains( typeDef3@ [ " new M.A(S = 1,)" ]) " A(S = 1," [ " AnotherSettableProperty" ] [ " NonSettableProperty" ]
529+
530+ let typeDef4 =
531+ [
532+ " module M ="
533+ " type A<'a, 'b>() ="
534+ " member val SettableProperty = 1 with get,set"
535+ " member val AnotherSettableProperty = 1 with get,set"
536+ " member val NonSettableProperty = 1"
537+ ]
538+ AssertCtrlSpaceCompleteContains( typeDef4@ [ " M.A((**))" ]) " A((**)" [ " SettableProperty" ; " AnotherSettableProperty" ] [ " NonSettableProperty" ]
539+ AssertCtrlSpaceCompleteContains( typeDef4@ [ " M.A(S = 1)" ]) " A(S" [ " SettableProperty" ] [ " NonSettableProperty" ]
540+ AssertCtrlSpaceCompleteContains( typeDef4@ [ " M.A(S = 1)" ]) " A(S = 1" [] [ " SettableProperty" ; " NonSettableProperty" ] // neg test
541+ AssertCtrlSpaceCompleteContains( typeDef4@ [ " M.A(S = 1,)" ]) " A(S = 1," [ " AnotherSettableProperty" ] [ " NonSettableProperty" ]
542+ AssertCtrlSpaceCompleteContains( typeDef4@ [ " new M.A<_, _>((**))" ]) " A<_, _>((**)" [ " SettableProperty" ; " AnotherSettableProperty" ] [ " NonSettableProperty" ]
543+ AssertCtrlSpaceCompleteContains( typeDef4@ [ " new M.A<_, _>(S = 1)" ]) " A<_, _>(S" [ " SettableProperty" ] [ " NonSettableProperty" ]
544+ AssertCtrlSpaceCompleteContains( typeDef4@ [ " new M.A<_, _>(S = 1)" ]) " A<_, _>(S = 1" [] [ " NonSettableProperty" ; " SettableProperty" ]
545+ AssertCtrlSpaceCompleteContains( typeDef4@ [ " new M.A<_, _>(S = 1,)" ]) " A<_, _>(S = 1," [ " AnotherSettableProperty" ] [ " NonSettableProperty" ]
477546
478547[<Test>]
479548[<Category( " RangeOperator" ) >]