Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf17c57d

Browse files
committed
added tests for property completion in object creation expressions
1 parent38a0734 commitf17c57d

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

‎vsintegration/src/unittests/Tests.LanguageService.Completion.fs‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
memberpublicthis.``ObjectInitializer.CompletionForProperties``()=
481+
lettypeDef1=
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+
lettypeDef2=
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+
lettypeDef3=
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+
lettypeDef4=
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")>]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp